Class not found Exception from Weblogic 9.2

南楼画角 提交于 2019-12-13 07:14:56

问题


In my JSF project workspace, I have a Java project A and a Weblogic EJB project B that uses the Java project.

On generating the EAR I can see that the jar for Project A and B are there in the EAR as well as that of other projects in the workspace.

However, on trying to access class from A in B i am getting a class not found exception.

The Ejb Project B has the managedbean/dao/ejb/delegate and at this point the EJB is not getting called at all. The managedbean is instantiated and from another action call I am calling the method(loadWorklist) from where the offending class is called.

Is there any specific setting I am missing?

Note this is deployed as EAR in weblogic 9.2 in UNIX server. All required jars are loaded from inside the EAR at runtime only the classes in project A is missing.

Stack trace from the error:

javax.faces.FacesException: Error calling action method of component with id worklistForm:_idJsp131
        at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:72)
        at javax.faces.component.UICommand.broadcast(UICommand.java:109)
        at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:97)
        at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:171)
        at org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:32)
        Truncated. see log file for complete stacktrace
javax.faces.el.EvaluationException: Exception while invoking expression #{worklistManagedBean.loadWorklist}
        at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:156)
        at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:61)
        at javax.faces.component.UICommand.broadcast(UICommand.java:109)
        at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:97)
        at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:171)
        Truncated. see log file for complete stacktrace
java.lang.NoClassDefFoundError: com/tcs/nextgen/workflow/util/WorkflowUtil
        at com.ultimatix.nextgen.worklist.managedbean.WorklistManagedBean.loadWorklist(WorklistManagedBean.java:36)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        Truncated. see log file for complete stacktrace

Ear structure:

EAR
|
|-META-INF
|-library1.jar
|-library2.jar
|-A.jar
|-B.jar

Since this is an existing legacy app, jars are not in APP-INF/lib.


回答1:


If module B uses classes from module A, then module A must be declared in the class path in the MANIFEST.MF of module B. The class path entries in this file is relative, so since the modules are at the same level, you can just specifiy A.jar. Other common libraries can be put in APP-INF/lib and will be automatically added to the class path. This however, is WebLogic specific behaviour.



来源:https://stackoverflow.com/questions/16234566/class-not-found-exception-from-weblogic-9-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!