views:

27

answers:

2

Hi, All

I have made a jsf 1.1 portlet in weblogic 10.3, but in one scenario I need tomahawk library help. I just dropped the jar file and supporting ones in lib folder in WEB-INF in my portal application, but when I hit the url it gives me error of NoClassdef..... exception for classes in tomahawk jar and jsp compilation fails.

I am new to weblogic, I'll really appreciate if someoe can suggest what I might be doing wrong.

The setup is that whole application goes as ear. Ear contains app-inf and weblogic specific xml files, main portal web application goes as war inside this ear. I am using workshop that ships with weblogic portal 10.3. Well this project was migrated from weblogic portal 9.3.

Note: I dont want to but this jar in domain/lib, when I did so I dont know why it loaded my application and all the class defined in servlet startup with load-on-startups got fired well before time and none of the classes were found by server.

Jsf libraries currently used are in shared mode.

+1  A: 

java.lang.NoClassDefFoundError means the runtime version of the class in the classpath is not the same as that at compile time.

Note: it's not a ClassNotFoundException.

Your problem is in fact multiple versions of the class being found.

Also, JSF 1.2 libraries are bundled with Weblogic server, so it can cause this exception if one of those classes is again added into the WEB-INF/lib. Which is the exact class on which the error is thrown, do you have multiple versions of Tomahawk lying around in WEB-INF and domain/lib?

Remove the extras and keep one in WEB-INF/lib only.

Update:

The docs state that Separate JSF 1.2 and JSTL 1.2 JAR files and implementation JAR files are also provided in the WL_HOME/server/lib/api.jar file.

Check for that class javax/faces/webapp/UIComponentELTag in this jar.

I still think you should use the weblogic.xml setting to force the WEB-INF/lib class to get loaded in preference to that in server/lib with

<container-descriptor>
    <prefer-web-inf-classes>true</prefer-web-inf-classes>
  </container-descriptor>
JoseK
Exception occurred while processing 'xxxx.jsp'java.lang.NoClassDefFoundError: org/apache/myfaces/shared_tomahawk/taglib/core/ParamTag : javax/faces/webapp/UIComponentELTag at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:621) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at weblogic.utils.classloaders.GenericClassLoader.defineClass(GenericClassLoader.java:344) at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:301)
I have only one jar of tomahawk in web-inf. And the only tag from this library I am using is <t:saveState value="#{xxxx}"/>. I am using eclipse for weblogic 10.3.2 for development. jsf library is from sun and in shared mode. I have checked the jar this class is present in the jar.
@user458248: UIComponentELTag is JSF 1.2, not 1.1. And the class it is complaining about is javax/faces/webapp/UIComponentELTag. This class is found in these jars. http://www.jarfinder.com/index.php/java/info/javax.faces.webapp.UIComponentELTag. I'm not sure if one is shipped within weblogic as well. Do you have any multiple copies of these jars in the WEB-INF? Try the prefer-web-inf-classes setting that I wrote in the original answer.
JoseK
@JoseK thanks for help and time, it was helpful :)
A: 

Being new to weblogic and infrastructure I messed up with different versions. Figured out it was just because of incompatible jars.