WebLogic Toplink (its xml parser?) configuration issue - java

I have a web application (war packaged) with toplink.jar and xmlparserv2.jar files under WEB-INF\lib. The problem is that I get
]] Root cause of ServletException.
java.lang.NoClassDefFoundError: oracle/xml/parser/schema/XSDElement
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
at java.lang.Class.getConstructor0(Class.java:2699)
at java.lang.Class.newInstance0(Class.java:326)
at java.lang.Class.newInstance(Class.java:308)
at oracle.toplink.internal.security.PrivilegedAccessHelper.newInstanceFromClass(PrivilegedAccessHelper.java:335)
at oracle.toplink.platform.xml.XMLPlatformFactory.getXMLPlatform(XMLPlatformFactory.java:95)
I don't understand it because xmlparserv2.jar contains oracle.xml.parser.schema.XSDElement class - so it should be on classpath.
My WebLogic version is 10.3.2.0, any help would be appreciated.

Add below line in Arguments in Server Start tab in WebLogic admin console
-Dtoplink.xml.platform=oracle.toplink.platform.xml.jaxp.JAXPPlatform
Source: https://community.oracle.com/message/2988932?tstart=44

Related

"ClassNotFoundException: org.objectweb.asm.ClassVisitor" on WebLogic Version 12.2.1.1 and Later (Doc ID 2526226.1)

I am trying to deploy my legacy application in web-logic 12c but problem is every time its showing exception like > "ClassNotFoundException: org.objectweb.asm.ClassVisitor,Basically this issue comes if application not have asm.jar but in my application asm.jar is there and moreover my application successfully deployed in web-logic 11
After lot of research i found below document in that they are saying WebLogic 12.2.1 infra to WebLogic 12.2.1.3 infra, the class org.objectweb.asm.ClassVisitorbelow can NOT be found when starting the server with customer's application deployed. Please some one guide me how can i resolve this issue
Document
https://support.oracle.com/knowledge/Middleware/2526226_1.html#FIX
Deployment issue
<Dec 6, 2019 5:58:46,064 AM GMT> <Error> <HTTP> <WL-101216> <Servlet: "JerseyRESTService" failed to preload on startup in Web application: "CDMWeb.war".
A MultiException has 1 exceptions. They are:
1. java.lang.NoClassDefFoundError: org/objectweb/asm/ClassVisitor
at org.jvnet.hk2.internal.Utilities.justCreate(Utilities.java:1085)
at org.jvnet.hk2.internal.ServiceLocatorImpl.create(ServiceLocatorImpl.java:978)
at org.jvnet.hk2.internal.ServiceLocatorImpl.createAndInitialize(ServiceLocatorImpl.java:1082)
at org.jvnet.hk2.internal.ServiceLocatorImpl.createAndInitialize(ServiceLocatorImpl.java:1074)
at org.glassfish.jersey.server.ApplicationHandler.createApplication(ApplicationHandler.java:385)
Truncated. see log file for complete stacktrace
Caused By: java.lang.NoClassDefFoundError: org/objectweb/asm/ClassVisitor
at com.sun.jersey.api.core.ScanningResourceConfig.init(ScanningResourceConfig.java:79)
at com.sun.jersey.api.core.PackagesResourceConfig.init(PackagesResourceConfig.java:104)
at com.sun.jersey.api.core.PackagesResourceConfig.<init>(PackagesResourceConfig.java:78)
at com.verizon.application.Application.<init>(Application.java:12)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
Truncated. see log file for complete stacktrace
Caused By: java.lang.ClassNotFoundException: org.objectweb.asm.ClassVisitor
at com.oracle.classloader.PolicyClassLoader.findClass(PolicyClassLoader.java:398)
at com.oracle.classloader.PolicyClassLoader.loadClass(PolicyClassLoader.java:371)
at com.oracle.classloader.weblogic.LaunchClassLoader.loadClass(LaunchClassLoader.java:55)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at com.sun.jersey.api.core.ScanningResourceConfig.init(ScanningResourceConfig.java:79)
Truncated. see log file for complete stacktrace
>
You can try adding the asm.jar to your Applications's WEB-INF/lib directory. From the error it's clear that JVM not able to locate the class, hence java.lang.ClassNotFoundException

Exception while re-deploying my webapp on tomcat 6

All,
I am having problems redeploying my java webapp packaged as war using maven 3.0 (mvn package) on tomcat 6.0
However if I restart my server completely i donot get this exception and the whole app runs perfectly fine.
Here is the details of catalina log:
WARNING: Error while removing context []
java.lang.NoClassDefFoundError: org/apache/struts2/util/ObjectFactoryDestroyable
at org.apache.struts2.dispatcher.Dispatcher.cleanup(Dispatcher.java:263)
at org.apache.struts2.dispatcher.FilterDispatcher.destroy(FilterDispatcher.java:238)
at org.apache.catalina.core.ApplicationFilterConfig.release(ApplicationFilterConfig.java:332)
at org.apache.catalina.core.StandardContext.filterStop(StandardContext.java:3731)
at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4493)
at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:924)
at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1035)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1203)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(Containe rBase.java:1601)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassNotFoundException: org.apache.struts2.util.ObjectFactoryDestroyable
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
... 15 more
Pls help..!

Getting java.lang.NoClassDefFoundError: javax/net/SocketFactory while sending email using mail.jar

My jsf web application using mail.jar and activation.jar to send email both of these and other dependent jars are in CLASSPATH, (the application is running in tomcat)
But I get following Exception
java.lang.NoClassDefFoundError: javax/net/SocketFactory
java.lang.ClassLoader.findBootstrapClass(Native Method)
java.lang.ClassLoader.findBootstrapClass0(ClassLoader.java:892)
java.lang.ClassLoader.loadClass(ClassLoader.java:302)
java.lang.ClassLoader.loadClass(ClassLoader.java:300)
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
java.lang.ClassLoader.loadClass(ClassLoader.java:252)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1302)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1900)
com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:638)
javax.mail.Service.connect(Service.java:317)
javax.mail.Service.connect(Service.java:176)
javax.mail.Service.connect(Service.java:125)
I added required jsse.jar (which is the Java`s standard jar) to my application libs as well, but still the issue persists. I doubt now that the jsse.jar in jre is corrupt which is causing this issue. I am using jre 1.6.0_13.
Can someone help me solving this error?
That class in particular is a standard class provided by the JVM. Check that the JVM installation isn't corrupted, missing files, etc.

Error on Stripes

I got this page:
HTTP Status 404 -
type Status report
message
description The requested resource () is not available.
Apache Tomcat/7.0.11
This is what appeared on console:
SEVERE: Exception starting filter StripesFilter
I followed this diligently, what could I have forgot? http://www.stripesframework.org/display/stripes/Quick+Start+Guide
I'm using Tomcat 7.0, Java 1.6.0_24, using Dynamic Web Project under Eclipse, this is my Eclipse version:
Eclipse Java EE IDE for Web Developers.
Version: Helios Service Release 1
Build id: 20100917-0705
If it has a bearing, I'm using Mac OS X
Detailed error message:
SEVERE: Exception starting filter StripesFilter
java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at net.sourceforge.stripes.util.Log.getInstance(Log.java:43)
at net.sourceforge.stripes.controller.StripesFilter.<clinit>(StripesFilter.java:57)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:119)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:252)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:372)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:98)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4542)
at org.apache.catalina.core.StandardContext$2.call(StandardContext.java:5220)
at org.apache.catalina.core.StandardContext$2.call(StandardContext.java:5215)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)
Copy commons-logging.jar to your /WEB-INF/lib dir
Regarding to your link:
For deploying and running Stripes you
will also need to copy the following
library files supplied with Stripes
into your classpath:
* commons-logging.jar (1.1)
Usually issues like this are caused by either an incorrect web.xml file, or by a required JAR file not being on the classpath.
If you check Tomcat's log directory (should be under CATALINA_HOME/logs) you should find some log files named '<hostname>.<date>.log' (for instance, "localhost.2011-03-18.log"). In the current log file you will likely be able to find a stacktrace that will provide a lot more detail about the exact cause of the error.

Webapp couldn't find jars located in WEB-INF/lib folder

On production Tomcat server my webapp couldn't find jars located in WEB-INF/lib folder. In development eviorment all works fine.
Stack Trace
javax.servlet.ServletException: Could not initialize class util.HibernateUtil
web.Engine.service(Engine.java:58)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:244)
java.security.AccessController.doPrivileged(Native Method)
javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:276)
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)
root cause
java.lang.NoClassDefFoundError: Could not initialize class util.HibernateUtil
web.Engine.service(Engine.java:31)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:244)
java.security.AccessController.doPrivileged(Native Method)
javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:276)
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5 logs.
Development Config
Tomcat 5.5
OS X 10.6
Eclipse
Production Config
Tomcat 5.5
Linux Debian
Thanks for your answer!
By default, the Tomcat that ships with Debian distros has a very restrictive Java security manager. My guess is that you're using the packaged version and that it is forbidding something. The "something" is very likely available in the logs as mentioned in the last line of the trace you posted:
note The full stack trace of the root cause is available in the Apache Tomcat/5.5 logs.
You'll have to ease the restrictions (check /etc/tomcat5.5/policy.d) or to turn it off. Talk with your administrator.
I have seen something very similar with a jar requiring a class from another jar and that jar was not on the classpath.
Have a look at the root cause of the stack trace in the Tomcat log. That will most likely reveal what is wrong.

Categories