How can i solve a NoClassDefFoundError?

和自甴很熟 提交于 2019-12-01 10:35:11

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

Your problem could be multiple versions of the class being found when the server is deploying. I notice the class org.apache.myfaces.trinidadinternal.convert.ColorConverter is found in trinidad-impl.jar

Can you search for how many such jars are found in the run time server environment plus your own webapp libraries?

On windows, the Jdev inbuilt server runs in this folder

C:\Users\<...>\AppData\Roaming\JDeveloper\system11.1.1.4.37.59.23 or something similar

you need this in your webapp/WEB-INF/lib and not in the other areas.

On my local I find the Jar under C:\Users\<...>\AppData\Roaming\JDeveloper\system11.1.1.4.37.59.23\o.j2ee.wlLibs\jsp\Trinidad-Components1.2.war

I think you could 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> 

This happens when you try to load a class that is trying to load another class which is not on the classpath. Find out which classes are needed by ColorConverter and make sure you have them in your classpath.

First of all: What are you deploying to the server? An ADF jar or a WAR file. In your case - given that you don't have any dependent jars installed on the application server. You should deploy a WAR file.

On your view project - right click and select Project Properties. Then go to Deployment and edit the deployment profile (if none are there create one). Make sure that the checkbox "Include Libraries from other projects" is checked. (IT's in the Library Dependencies tab).

Also: you might find some useful information in here.

Hope this helps. Michael

Using StackTrace you can find out classes those are missing .I think you are missing some jar and that should be in your classpath.

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