Author |
Message
|
elvis_gn |
Posted: Mon May 02, 2005 11:08 pm Post subject: No class found error |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi,
i am getting this error in WAS for the code which had been deployed 3 weeks back.
When i restarted the server it is working properly but i would like to find out the reason for its occurance in the first place.
ERROR:
java.lang.NoClassDefFoundError: com/ibm/workflow/catalog/Properties
at com.ibm.workflow.api.Agent$LocLocator.locate(Agent.java:8
at com.ibm.workflow.api.Agent.setName(Agent.java:288)
Thanks. |
|
Back to top |
|
 |
vennela |
Posted: Tue May 03, 2005 8:22 am Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
Quote: |
Hi,
i am getting this error in WAS for the code which had been deployed 3 weeks back. |
What code? Application code or web client?
Did it work for 3 weeks? If it did, then that's a websphere app server problem and not workflows. |
|
Back to top |
|
 |
elvis_gn |
Posted: Thu May 05, 2005 9:36 pm Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
The web client code is integrated with the workflow code which logs in and get workitems list etc....
I get this error occasionally and on a restart it starts working again. But this cannot be a solution during production.
Is there a time limit to which a service object will remain connected to the workflow ???
I understand that the error is with the WAS, as it is not able to load the class file, but since it is happening with the workflow class file i have to take it as my headache
Has anyone faced a problem like this before ?? |
|
Back to top |
|
 |
jmac |
Posted: Fri May 06, 2005 5:51 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
elvis_gn wrote: |
Is there a time limit to which a service object will remain connected to the workflow ??? |
If you are asking if an ExecutionService object will time out the answer is yes. _________________ John McDonald
RETIRED |
|
Back to top |
|
 |
elvis_gn |
Posted: Tue May 10, 2005 12:28 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
yes jmac, that was the very question I was asking....
Currently i am using SessionMode.DEFAULT and absenceIndicator.RESET during the user logon and keeping him logged on forever....
This logon is being used for all workflow queries.
What I would like to know is when this ExecutionService logs off,, what is the error i'll be shown....
I guess it would be USER NOT LOGGED ON or something....
Is it possible that the class file itself fails to load when I attempt a query afetr the log off?? |
|
Back to top |
|
 |
jmac |
Posted: Tue May 10, 2005 5:25 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
There is an option on the Session Tab of the Domain object that allows you to specify session timeout, you can choose forever... however, I really don't think that is wise, you must bring MQWF down for runstats rebind periodically, So I think the better thing to do, or maybe in addition to setting the timeout forever, is to check the ES before you logon... there is a method to do this, I believe it is isLoggedOn() or some such. _________________ John McDonald
RETIRED |
|
Back to top |
|
 |
dputzeys |
Posted: Thu May 12, 2005 6:32 am Post subject: |
|
|
 Novice
Joined: 27 Oct 2004 Posts: 10
|
Hi,
I have same problem.
This is the error :
Quote: |
java.lang.NoClassDefFoundError
at com.ibm.workflow.api.Agent$LocLocator.locate(Agent.java:88 )
at com.ibm.workflow.api.Agent.setName(Agent.java:288)
|
And this is the corresponding code :
Code: |
String userid = "ADMIN";
String passwd = "whatever";
Agent agent = new Agent();
agent.setLocator(Agent.LOC_LOCATOR);
agent.setName("XYZ");
_service = agent.locate("", "");
if (_service.isLoggedOn()) {
System.out.println(_service.userID());
} else {
_service.logon2(userid, passwd, SessionMode.DEFAULT, AbsenceIndicator.LEAVE);
}
|
In this case, it as a separate java application which tries to log on, in order to suspend a certain process, so it is not related to the webclient nor the rich client. I have not tried to check whether restart of the application solves the problem, but as already indicated, this is a no-go for a production system anyway.
MQWF 3.5 by the way
rgds
dirkp |
|
Back to top |
|
 |
vennela |
Posted: Thu May 12, 2005 7:23 am Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
Did you set the CLASSPATH right?
java.lang.NoClassDefFoundError means the CLASSPATH is not right. |
|
Back to top |
|
 |
elvis_gn |
Posted: Thu May 12, 2005 9:44 pm Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
if the classpath is the problem the program would have failed to complile.
In my case this is not the issue as the jar file is definitely in the WAS web-inf path.
The error is in the Agent object....i found some related issue of classLoader.
the link to solve that is:
http://www-1.ibm.com/support/docview.wss?rs=795&context=SW920&uid=swg21107686
i think solving this will solve the class def. issue as the above will ask u to add the jar to the server path in WAS.
dputzeys i think this will not serve ur purpose as ur not using WAS.
But i have not faced this issue for my stand alone programs, so i think u can first check ur classpath.... |
|
Back to top |
|
 |
dputzeys |
Posted: Fri May 13, 2005 12:04 am Post subject: |
|
|
 Novice
Joined: 27 Oct 2004 Posts: 10
|
Hi,
thanks for the answers, but however, I already thought of that (as I am a Java developer for over 5 years now, such an error is indeed not "new" to me ).
As for the NoClassDefFoundError: the strange thing is that the class which is not found, is not mentioned in "my" the stacktrace, however in elvis_cn's stacktrace it is. I suppose, since in both stacktraces the error lies in Agent.java:88 (resulting from the call in Agent.java:288), that the it is about the same class.
Now, some checks revealed this:
com.ibm.workflow.api.Agent, com.ibm.workflow.api.ExecutionService are part of the fmcojapi.jar, which is of course in the classpath because we had no classdefnotfound exception before.
The NoClassDefFoundError error is on com.ibm.workflow.catalog.Properties and this class is (guess what ...) also in fmcojapi.jar
Hence : it is not a classpath problem.
As the a lot of classes (included the Agent class and the Agent$LocLocator class) are JNI classes, I think the problem is more related to that.
(which is in fact more or less confirmed by the link posted by elvis_gn).
just my 50cents
rgds
dirkp |
|
Back to top |
|
 |
elvis_gn |
Posted: Fri May 13, 2005 1:45 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi dputzeys,
R u using the service object and keeping the user logged in forever ??
What i mean in other words is, do u have the service object as static in ur program and r u logging in once for all instances of the java program ?? |
|
Back to top |
|
 |
dputzeys |
Posted: Mon May 16, 2005 11:16 pm Post subject: |
|
|
 Novice
Joined: 27 Oct 2004 Posts: 10
|
This is the complete code more or less:
Code: |
private ExecutionService _service;
public MQWorkflowClient() {
super();
_service = null;
}
public void logon(String userName, String password) {
final String userid = userName;
final String passwd = password;
_log.debug("logon");
Agent agent = new Agent();
try {
agent.setLocator(Agent.LOC_LOCATOR);
agent.setName("XYZ");
_service = agent.locate("", "");
if (_service.isLoggedOn()) {
_log.debug(_service.userID());
} else {
_service.logon2(
userid,
passwd,
SessionMode.DEFAULT,
AbsenceIndicator.LEAVE);
}
} catch (PropertyVetoException e) {
e.printStackTrace();
} catch (FmcException e) {
e.printStackTrace();
}
}
public void logoff() {
_log.debug("logoff");
try {
_service.logoff();
} catch (FmcException e) {
e.printStackTrace();
}
}
|
The logon and logoff function are called whenever access is needed to the MQWF (eg.to consult a workitem for instance). |
|
Back to top |
|
 |
|