This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Cloud Application Architecture Patterns: Designing, Building, and Modernizing for the Cloud and have Kyle Brown, Bobby Woolf and Joseph Yodor on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Package not found error

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I m trying to deploy an apllication on tomcat.(tomcat 4.0.6 ).
The welcome page is mapped inside web.xml inside web-inf folder of my applicatin.When i type the url to access applicatin, it gives compilation error saying 'package *** not found in import.These packages are placed inside different folder structors and i hv placed all of them inside Web-Inf/classes folder.Even i tried setting the exact class path of these packages inside my environmental variable. But still not working.
Thanks for helps in adavance.
regards
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you post your mappings from web.xml?
 
Sheriff
Posts: 67756
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"aarati a.t",

There aren't may rules that have been put into place here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
Forum Bartender
 
aarati teacher
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ben Souther:
Can you post your mappings from web.xml?



thanks for the prompt reply, now the tomcat is picking up the page mapped in web.xml file, but now new probs hv come up.
Now i m using usebean tag to create java bean object
<jsp:useBean id="eventProcessor" type="com.sourcetap.sfa.event.GenericEventProcessor" scope="application" />

the GenericEventProcessor class is placed inside package
com/sourcetap/sfa/event which is inside web-inf/classes inside my application folder

thanks
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi! meera
you are using wrong attribute in usebean tag you have to use "class" instead of "type".
you can only use 'type" attribute when object of that class already exist and you want to use it.But if you want to create object you have to use "class" attribute .
if you want to more hepl,you can email me on this Id: [email protected]

Best Regards
kirti
 
aarati teacher
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for the suggestion,
i changed the 'type' attribute to 'class', now it is giving foll error
javax.servlet.ServletException: class org.ofbiz.entity.GenericDelegator : java.lang.IllegalAccessException: org.ofbiz.entity.GenericDelegator

now it gives following error
javax.servlet.ServletException: class org.ofbiz.entity.GenericDelegator : java.lang.IllegalAccessException: org.ofbiz.entity.GenericDelegator

here is piece of code form GenericDelegator class
package org.ofbiz.entity;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.URL;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;

import javax.xml.parsers.ParserConfigurationException;

import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilCache;
import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.base.util.UtilXml;
import org.ofbiz.entity.condition.*;
import org.ofbiz.entity.config.EntityConfigUtil;
import org.ofbiz.entity.datasource.GenericHelper;
import org.ofbiz.entity.datasource.GenericHelperFactory;
import org.ofbiz.entity.eca.EntityEcaHandler;
import org.ofbiz.entity.model.DynamicViewEntity;
import org.ofbiz.entity.model.ModelEntity;
import org.ofbiz.entity.model.ModelField;
import org.ofbiz.entity.model.ModelFieldType;
import org.ofbiz.entity.model.ModelFieldTypeReader;
import org.ofbiz.entity.model.ModelGroupReader;
import org.ofbiz.entity.model.ModelKeyMap;
import org.ofbiz.entity.model.ModelReader;
import org.ofbiz.entity.model.ModelRelation;
import org.ofbiz.entity.model.ModelViewEntity;
import org.ofbiz.entity.serialize.SerializeException;
import org.ofbiz.entity.serialize.XmlSerializer;
import org.ofbiz.entity.transaction.TransactionUtil;
import org.ofbiz.entity.util.DistributedCacheClear;
import org.ofbiz.entity.util.EntityFindOptions;
import org.ofbiz.entity.util.EntityListIterator;
import org.ofbiz.entity.util.EntityUtil;
import org.ofbiz.entity.util.SequenceUtil;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.xml.sax.SAXException;


public class GenericDelegator implements DelegatorInterface {

public static final String module = GenericDelegator.class.getName();

/** the delegatorCache will now be a HashMap, allowing reload of definitions,
* but the delegator will always be the same object for the given name */
protected static Map delegatorCache = new HashMap();
protected String delegatorName;
protected EntityConfigUtil.DelegatorInfo delegatorInfo = null;

/** set this to true for better performance; set to false to be able to reload definitions at runtime throught the cache manager */
public static final boolean keepLocalReaders = true;
protected ModelReader modelReader = null;
protected ModelGroupReader modelGroupReader = null;

protected UtilCache primaryKeyCache = null;
protected UtilCache allCache = null;
protected UtilCache andCache = null;

// keeps a list of field key sets used in the by and cache, a Set (of Sets of fieldNames) for each entityName
protected Map andCacheFieldSets = new HashMap();

protected DistributedCacheClear distributedCacheClear = null;

protected EntityEcaHandler entityEcaHandler = null;
public static final String ECA_HANDLER_CLASS_NAME = "org.ofbiz.entityext.eca.DelegatorEcaHandler";

protected SequenceUtil sequencer = null;

public static GenericDelegator getGenericDelegator(String delegatorName) {
GenericDelegator delegator = (GenericDelegator) delegatorCache.get(delegatorName);

if (delegator == null) {
synchronized (GenericDelegator.class) {
// must check if null again as one of the blocked threads can still enter
delegator = (GenericDelegator) delegatorCache.get(delegatorName);
if (delegator == null) {
try {
delegator = new GenericDelegator(delegatorName);
} catch (GenericEntityException e) {
Debug.logError(e, "Error creating delegator", module);
}
if (delegator != null) {
delegatorCache.put(delegatorName, delegator);
}
}
}
}
return delegator;
}
wd appreciate ur help/suggestions.. thanks again

Originally posted by kirtikumar patel:
hi! meera
you are using wrong attribute in usebean tag you have to use "class" instead of "type".
you can only use 'type" attribute when object of that class already exist and you want to use it.But if you want to create object you have to use "class" attribute .
if you want to more hepl,you can email me on this Id: [email protected]

Best Regards
kirti

 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
aarati,

A few things:

First, If you're using useBean to instanciate a class, the class needs to have a zero argument constructor. If you want to maintain a single instnace of the bean, (Singleton or otherwise) your best bet is to instanciate it in a context listener and bind it to context scope if necessary.

Second, If you are going to post more than a line or two of code, use the UBB Code tags. They will preserve your indenting which makes your code much easier to read (which usually results in more help).

Third, Please go back and re-read Bear's description of a proper display name. It needs to be a firstName followed by a space then a lastName.
 
aarati teacher
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi there,
firstly thank u for the suggestions..
thanks for pointing out the error in the display name.
i hv corrected the same now it is aarati<space>t okie..

Originally posted by Ben Souther:
aarati,

A few things:

First, If you're using useBean to instanciate a class, the class needs to have a zero argument constructor. If you want to maintain a single instnace of the bean, (Singleton or otherwise) your best bet is to instanciate it in a context listener and bind it to context scope if necessary.

Second, If you are going to post more than a line or two of code, use the UBB Code tags. They will preserve your indenting which makes your code much easier to read (which usually results in more help).

Third, Please go back and re-read Bear's description of a proper display name. It needs to be a firstName followed by a space then a lastName.

 
Bear Bibeault
Sheriff
Posts: 67756
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

i hv corrected the same now it is aarati<space>t okie..



Sorry, but it is not ok yet. As was stated in the numerous requests for you to modify your display name, it must be a first and a last name, not an initial.

Visit this page and adjust your display name as such prior to your next post.

Considering the number of times you have been asked, failure to comply at this point will result in the removal of your account.

bear
Forum bartender
[ July 01, 2005: Message edited by: Bear Bibeault ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic