When i deploy .ear file on weblogic 12c, it is giving following error.
java.lang.ClassNotFoundException: com.abc.util.CustomUtility
at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:335)
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:302)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:180)
<Administration Console encountered the following error: weblogic.application.WrappedDeploymentException: com.abc.util.CustomUtility
at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:335)
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:302)
As soon as I deploy .ear file, it is giving the above error. It's complaining about ClassNotFoundException which is a user-defined class in the project.
I see all .classes are part of .ear file. Still why this issue comes up ?
Please help me on this.
I've seen this problem when I have utility classes defined on several projects. The .class are in the .ear, but the app doesn't find it.
In my case the problem was solved adding the missing class project to the manifest file.
The accepted answer didn't solve our problem. We solved it by adding the packages (of the missing classes) to the prefer-application-packages section in the weblogic-application.xml
<!-- to load classes of the packages from application context first and not from server context. -->
<prefer-application-packages>
<package-name>antlr.*</package-name>
<package-name>org.apache.*</package-name>
<package-name>org.hibernate.*</package-name>
<package-name>org.springframework.*</package-name>
<package-name>org.aopalliance.*</package-name>
<package-name>org.objectweb.*</package-name>
<package-name>net.sf.cglib.*</package-name>
...
</prefer-application-packages>
</weblogic-application>
Related
I am deploying my application to Wildfly 9 and I am getting a strange error that resembles class loading problems. The same war file deploys successfully to Tomcat so I am guessing Wildfly is bundling com.google classes and somehow it is interfering with the bundled libraries in the war file.
First, the error looks like this:
Caused by: java.lang.IllegalAccessError: tried to access method com.google.common.collect.MapMaker.makeComputingMap(Lcom/google/common/base/Function;)Ljava/util/concurrent/ConcurrentMap; from class com.google.inject.internal.Annotations$AnnotationChecker
at com.google.inject.internal.Annotations$AnnotationChecker.<init>(Annotations.java:104)
at com.google.inject.internal.Annotations.<clinit>(Annotations.java:122)
at com.google.inject.Key.ensureRetainedAtRuntime(Key.java:362)
at com.google.inject.Key.strategyFor(Key.java:354)
at com.google.inject.Key.get(Key.java:222)
at org.eclipse.sisu.wire.ParameterKeys.<clinit>(ParameterKeys.java:28)
at org.eclipse.sisu.wire.DependencyAnalyzer.<init>(DependencyAnalyzer.java:92)
at org.eclipse.sisu.wire.ElementAnalyzer.<init>(ElementAnalyzer.java:87)
at org.eclipse.sisu.wire.WireModule.configure(WireModule.java:74)
at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:229)
at com.google.inject.spi.Elements.getElements(Elements.java:103)
at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:136)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:104)
at com.google.inject.Guice.createInjector(Guice.java:94)
at com.google.inject.Guice.createInjector(Guice.java:71)
at com.google.inject.Guice.createInjector(Guice.java:61)
and I have both guava-16.0.1.jar and sisu-guice-3.1.0-no_aop.jar inside my war file's lib folder.
so I basically need to solve this issue, whether it is a class loading issue or not.
I have built and deployed a war file in websphere 8.5 server. All axis 1.4 related jars are placed in WEB-INF/lib folder. However when I run the application and try to access the code that calls the webservice I get below error. Same war file works fine in TOMCAT 7 server. I do see that axis.jar exist and contains axisfault.class. Please help.
Caused by: java.lang.NoClassDefFoundError: org.apache.axis.AxisFault
at java.lang.J9VMInternals.verifyImpl(Native Method)
at java.lang.J9VMInternals.verify(J9VMInternals.java:93)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:170)
at java.lang.Class.forNameImpl(Native Method)
at java.lang.Class.forName(Class.java:179)
at org.uddi4j.transport.TransportFactory.getTransport(TransportFactory.java:61)
at org.uddi4j.client.UDDIProxy.send(UDDIProxy.java:1940)
at org.uddi4j.client.UDDIProxy.find_service(UDDIProxy.java:888)
at bofasecurity.UDDIHelper.getEndPoint(UDDIHelper.java:70)
at bofasecurity.xxxxSecurityWrapper.buildBofASecurityWrapper(BofASecurityWrapper.java:273)
at bofasecurity.xxxxSecurityWrapper.<init>(BofASecurityWrapper.java:212)
at bofasecurity.xxxxSecurityWrapper$Builder.build(BofASecurityWrapper.java:179)
at com.ml.grci.service.impl.SearchACCLServiceImpl.buildSecWrapper(SearchACCLServiceImpl.java:721)
at com.ml.grci.service.impl.SearchACCLServiceImpl.searchACCL(SearchACCLServiceImpl.java:160)
at com.ml.grci.webapp.action.ACCLSearchAction.execute(ACCLSearchAction.java:233)
... 83 more
Caused by: java.lang.ClassNotFoundException: org.apache.axis.AxisFault
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:506)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(ClassLoader.java:650)
This is likely due to a classloader issue. WebSphere 8.5 loads axis.jar (see /deploytool/itp/plugins/org.apache.axis_1.4.0.v201005080400/lib). Would recommend either removing the conflicting jar or changing the class loader policy (PARENT LAST). See how to set java class loader PARENT_LAST
Also not sure if this would help, but if you're trying to do web services using a third party framework there's a very good article on how to do this: http://www.ibm.com/developerworks/websphere/library/techarticles/1001_thaker/1001_thaker.html
I got a sample project, copied from somewhere else, when I am trying to run it in netbeans I am getting some error/exceptions in tomcat's console window.
java.lang.ClassNotFoundException: javax.persistence.Entity
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1711)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1556)
at org.springframework.core.type.classreading.RecursiveAnnotationAttributesVisitor.visitEnd(AnnotationAttributesReadingVisitor.java:167)
at org.springframework.asm.ClassReader.a(Unknown Source)
at org.springframework.asm.ClassReader.accept(Unknown Source)
at org.springframework.asm.ClassReader.accept(Unknown Source)
javax.persistence is already added to my project. I even removed and re-added in netbeans but still same error. This error is when running the web applictation not when compiling.
You need to add following Jar Files to your Build Path: -
javax.persistence_2.0.3.v201010191057.jar
org.eclipse.persistence.jpa_2.3.0.v20110604-r9504.jar
org.eclipse.persistence.jpa.equinox_2.3.1.v20111018-r10243.jar
org.eclipse.persistence.antlr_2.3.0.v20110604-r9504.jar
org.eclipse.persistence.asm_2.3.0.v20110604-r9504.jar
Preferably adding the first one will work, as javax.persistence.Entity is found in that Jar only.
But you may also need to add the later ones, for working with JPA
Google them with the name of JPA Jars. You will get them.
The javax.persistence.Entity is a class inside the Java EE SDK library “javaee.jar“, you are missing this jar file in your project classpath.
refer this http://www.mkyong.com/hibernate/java-lang-classnotfoundexception-javax-persistence-entity/
I am trying to create a simple JSF web application using MyFaces v 2.1 with WebSphere Application Server Community Edition v3.0.0.1 and Eclipse Juno but when I try to run the application the following error is returned
java.lang.ClassNotFoundException: com.sun.faces.config.ConfigureListener
org.apache.geronimo.common.DeploymentException: java.lang.ClassNotFoundException: com.sun.faces.config.ConfigureListener
at org.apache.geronimo.web25.deployment.AbstractWebModuleBuilder.createWebAppClassFinder(AbstractWebModuleBuilder.java:665)
at org.apache.geronimo.web25.deployment.AbstractWebModuleBuilder.configureBasicWebModuleAttributes(AbstractWebModuleBuilder.java:698)
at org.apache.geronimo.tomcat.deployment.TomcatModuleBuilder.addGBeans(TomcatModuleBuilder.java:469)
at org.apache.geronimo.j2ee.deployment.SwitchingModuleBuilder.addGBeans(SwitchingModuleBuilder.java:174)
at org.apache.geronimo.j2ee.deployment.EARConfigBuilder.buildConfiguration(EARConfigBuilder.java:764)
at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:255)
at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:140)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:131)
at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:883)
at org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:245)
at org.apache.geronimo.kernel.KernelGBean.invoke(KernelGBean.java:344)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:131)
at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:883)
at org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:245)
at org.apache.geronimo.system.jmx.MBeanGBeanBridge.invoke(MBeanGBeanBridge.java:172)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:848)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:773)
at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1438)
at javax.management.remote.rmi.RMIConnectionImpl.access$200(RMIConnectionImpl.java:83)
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1276)
at java.security.AccessController.doPrivileged(AccessController.java:284)
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1378)
at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:799)
at sun.reflect.GeneratedMethodAccessor73.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)
at sun.rmi.transport.Transport$1.run(Transport.java:171)
at java.security.AccessController.doPrivileged(AccessController.java:284)
at sun.rmi.transport.Transport.serviceCall(Transport.java:167)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:547)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:802)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:661)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:897)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:919)
at java.lang.Thread.run(Thread.java:736)
Caused by: java.lang.ClassNotFoundException: com.sun.faces.config.ConfigureListener
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
at org.apache.geronimo.hook.equinox.GeronimoClassLoader.loadClass(GeronimoClassLoader.java:85)
at java.lang.ClassLoader.loadClass(ClassLoader.java:626)
at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)
at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1207)
at org.apache.geronimo.web25.deployment.AbstractWebModuleBuilder.addClass(AbstractWebModuleBuilder.java:670)
at org.apache.geronimo.web25.deployment.AbstractWebModuleBuilder.createWebAppClassFinder(AbstractWebModuleBuilder.java:661)
... 45 more
Presumably the error is occurring because the MyFaces jar files are not in the class path however I cannot figure out where I’m going wrong as the build path in Eclipse contains the required jars. I’ve also tried copying the jar files into the WEB-INF/lib directory but to no avail.
The screenshot below shows the project structure along with the libraries.
Is there something specific I need to do either in Eclipse or WASCE to include the jar files or does the problem lie elsewhere?
Caused by: java.lang.ClassNotFoundException: com.sun.faces.config.ConfigureListener
The missing class is part of Mojarra, which is actually the competitor of MyFaces.
You shouldn't need that class at all when using MyFaces. This exception can have the following possible causes:
There's a manually definied <listener> entry in webapp's web.xml or the web-fragment.xml of any of the deployed JARs in /WEB-INF/lib which references this Mojarra-specific listener class.
There's somewhere a loose Mojarra .tld file in the classpath (very unlikely, who would ever extract a JAR file and put its loose contents in the classpath?). TLD files get autoinitialized and can contain a <listener> entry which can trigger autoregistration of a ServletContextListener implementation (such as the Mojarra ConfigureListener).
Those conflicts can be fixed by just removing it.
I deployed an web application with Myfaces in a Jetty server and it was necessary to use a listener and an additional init parameter to use facelets:
<context-param>
<param-name>org.apache.myfaces.FACES_INITIALIZER </param-name>
<param-value>org.apache.myfaces.webapp.FaceletsInitilializer</param-value>
</context-param>
<listener>
<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
</listener>
I was using mojarra implementation for compilation and was relying on apache tomcat for runtime. But tomcat uses myfaces implementation. So had to include mojarra impl jar in the WEB-INF/lib to resolve the issue
I was with the same problem. When I tried to run a .html file with Eclipse using Tomcat7 as the local server I received the 404 error on the Browser. And in Eclipse's console was showing the error "ClassNotFoundException: com.sun.faces.config.ConfigureListener".
The problem was the Mojarra library (.jar) I was using in my Dynamic Web project. I was using the javax.faces-2.3.0-m04.jar.
-> Solution:
Download an older version on Mojarra's repositories https://maven.java.net/content/repositories/releases/org/glassfish/javax.faces/ . In my case, I downloaded the 2.2.7 version (javax.faces-2.2.7.jar).
Then I created a new Dynamic Web project in Eclipse using JSF v2.0 and assigned with the javax.faces-2.2.7.jar file in the library section.
I have modified an EAR for Weblogic 10 ( BEA 10 )which is already running on BEA 8..
I am getting the following error while deploying the EAR..
[HTTP:101163]Could not load user defined listener: com.xxx.xxxx.jmx.LifecycleListener java.lang.NoClassDefFoundError: com/tibco/sdk/MException at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Class.java:2357) at java.lang.Class.getConstructor0(Class.java:2671) at java.lang.Class.newInstance0(Class.java:321) at java.lang.Class.newInstance(Class.java:303) at weblogic.servlet.internal.WebComponentContributor.getNewInstance(WebComponentContributor.java:187) at weblogic.servlet.internal.WebComponentContributor.createListenerInstance
Have you faced this error ?Please help me...
From the Exception it seems that some library is missing from your ear file. Make sure that com.xxx.xxxx.jmx.LifecycleListener is a valid package and included correctly in your ear.
If you are developing and building the ear with JDeveloper make sure you add this lib in your application resources. If you do this manualy make sure that this lib exists in your WEB-INF/lib folder