Illegal access- this web application instance has been stopped already. - java

I am getting following error , even after deleteing every thing from webapps folder and catalina.out file is automatically refreshing with this error.
I am using tomcat7 and java 1.7 open jdk.
Aug 05, 2016 12:54:11 PM org.apache.catalina.loader.WebappClassLoaderBase loadClass
INFO: Illegal access: this web application instance has been stopped already. Could not load com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1743)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1701)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at com.mysql.jdbc.Util.getInstance(Util.java:381)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:984)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1095)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2031)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:718)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:46)
at sun.reflect.GeneratedConstructorAccessor125.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:302)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:282)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:135)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
What might be the problem?

I had a similar issue. In my case, it was the library jar which I added to the lib directory of apache Tomcat.
This issue occurred when I referred to the classes from the jar in the lib directory. When I added the jar as a dependency on my war and removed it from the lib directory, it resolved my issue.
In your case, I think the MySQL driver jar that you must have added to the lib is causing this issue. Try adding it as a maven dependency or as a dependency from your resource directory and remove it from your lib directory of the tomcat. It should help with this issue.

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

HBase not starting after adding the jar file with Mapper/Reducer

I am trying to write a Mapper/Reducer for hbase and I added the jar. However after adding the jar file in lib directory, I cannot start hbase. I want to debug what is going wrong? How can I change the log level? Will it help?
Following is the exception:
java.lang.RuntimeException: Failed construction of Master: class org.apache.hadoop.hbase.master.HMasterCommandLine$LocalHMaster
at org.apache.hadoop.hbase.util.JVMClusterUtil.createMasterThread(JVMClusterUtil.java:143)
at org.apache.hadoop.hbase.LocalHBaseCluster.addMaster(LocalHBaseCluster.java:217)
at org.apache.hadoop.hbase.LocalHBaseCluster.(LocalHBaseCluster.java:153)
at org.apache.hadoop.hbase.master.HMasterCommandLine.startMaster(HMasterCommandLine.java:224)
at org.apache.hadoop.hbase.master.HMasterCommandLine.run(HMasterCommandLine.java:139)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
at org.apache.hadoop.hbase.util.ServerCommandLine.doMain(ServerCommandLine.java:126)
at org.apache.hadoop.hbase.master.HMaster.main(HMaster.java:2290)
Caused by: java.lang.NoSuchMethodError: org.apache.hadoop.ipc.RPC.getProtocolProxy(Ljava/lang/Class;JLjava/net/InetSocketAddress;Lorg/apache/hadoop/security/UserGroupInformation;Lorg/apache/hadoop/conf/Configuration;Ljavax/net/SocketFactory;ILorg/apache/hadoop/io/retry/RetryPolicy;Ljava/util/concurrent/atomic/AtomicBoolean;)Lorg/apache/hadoop/ipc/ProtocolProxy;
at org.apache.hadoop.hdfs.NameNodeProxies.createNNProxyWithClientProtocol(NameNodeProxies.java:420)
at org.apache.hadoop.hdfs.NameNodeProxies.createNonHAProxy(NameNodeProxies.java:316)
at org.apache.hadoop.hdfs.NameNodeProxies.createProxy(NameNodeProxies.java:178)
at org.apache.hadoop.hdfs.DFSClient.(DFSClient.java:665)
at org.apache.hadoop.hdfs.DFSClient.(DFSClient.java:601)
at org.apache.hadoop.hdfs.DistributedFileSystem.initialize(DistributedFileSystem.java:148)
at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:2591)
at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:89)
at org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:2625)
at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:2607)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:368)
at org.apache.hadoop.fs.Path.getFileSystem(Path.java:296)
at org.apache.hadoop.hbase.util.FSUtils.getRootDir(FSUtils.java:1004)
at org.apache.hadoop.hbase.regionserver.HRegionServer.(HRegionServer.java:562)
at org.apache.hadoop.hbase.master.HMaster.(HMaster.java:364)
at org.apache.hadoop.hbase.master.HMasterCommandLine$LocalHMaster.(HMasterCommandLine.java:307)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
at org.apache.hadoop.hbase.util.JVMClusterUtil.createMasterThread(JVMClusterUtil.java:139)
... 7 more
So it seems the error was due to mismatch of hadoop libraries in the lib directory of HBase(which was hadoop--2.5.1) against my actual Hadoop installation(hadoop--2.6.0). My jar was looking for classes which it was not finding in the older version of the hadoop libraries due to which it was failing. this answer made me realize the issue. After I copied all the hadoop-*-2.6.0 jars in the lib directory, HBase started as expected. The same is also mentioned in HBase-Hadoop compatibility documentation.

GWT not starting by not finding appengine-web.xml

I'm dealing with a problem that I know where the problem is, but I don't know how to fix it. When I try to run the development server using Run As -> Web Application, I get the following error on the console:
Initializing App Engine server
Feb 07, 2014 8:39:07 AM com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml
SEVERE: Received exception processing C:\Users\JOSR\Last Hope\WEB-INF/appengine-web.xml
com.google.apphosting.utils.config.AppEngineConfigException: Could not locate C:\Users\JOSR\Last Hope\WEB-INF\appengine-web.xml
at com.google.apphosting.utils.config.AppEngineWebXmlReader.getInputStream(AppEngineWebXmlReader.java:140)
at com.google.apphosting.utils.config.AppEngineWebXmlReader.readAppEngineWebXml(AppEngineWebXmlReader.java:75)
at com.google.apphosting.utils.config.EarHelper.readWebModule(EarHelper.java:166)
at com.google.appengine.tools.development.ApplicationConfigurationManager$WarModuleConfigurationHandle.readConfiguration(ApplicationConfigurationManager.java:399)
at com.google.appengine.tools.development.ApplicationConfigurationManager.<init>(ApplicationConfigurationManager.java:146)
at com.google.appengine.tools.development.ApplicationConfigurationManager.newWarConfigurationManager(ApplicationConfigurationManager.java:88)
at com.google.appengine.tools.development.DevAppServerImpl.<init>(DevAppServerImpl.java:139)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.google.appengine.tools.development.DevAppServerFactory.doCreateDevAppServer(DevAppServerFactory.java:258)
at com.google.appengine.tools.development.DevAppServerFactory.access$000(DevAppServerFactory.java:36)
at com.google.appengine.tools.development.DevAppServerFactory$1.run(DevAppServerFactory.java:226)
at com.google.appengine.tools.development.DevAppServerFactory$1.run(DevAppServerFactory.java:224)
at java.security.AccessController.doPrivileged(Native Method)
at com.google.appengine.tools.development.DevAppServerFactory.createDevAppServer(DevAppServerFactory.java:224)
at com.google.appengine.tools.development.DevAppServerFactory.createDevAppServer(DevAppServerFactory.java:76)
at com.google.appengine.tools.development.DevAppServerFactory.createDevAppServer(DevAppServerFactory.java:60)
at com.google.appengine.tools.development.gwt.AppEngineLauncher.start(AppEngineLauncher.java:84)
at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:509)
at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1093)
at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:836)
at com.google.gwt.dev.DevMode.main(DevMode.java:311)
Caused by: java.io.FileNotFoundException: C:\Users\JOSR\Last Hope\WEB-INF\appengine-web.xml (The system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at com.google.apphosting.utils.config.AppEngineWebXmlReader.getInputStream(AppEngineWebXmlReader.java:137)
... 23 more
I know that the path "C:\Users\JOSR\Last Hope\WEB-INF/appengine-web.xml" is wrong, should be "C:\Users\JOSR\Last Hope\war/WEB-INF/appengine-web.xml", but I don't know where to change it or how to force GWT to use the proper war path. Any ideas?
Thanks for reading!
from context-menu
Run As/Run Configuration and select your html ,choose Arguments tab
-war option is that.
I faced the same problem when I started using Maven in a GWT-GAE project.
In my case this problem happened because the eclipse launch file tries to load the appengine-web.xml from target/myproject/WEB-INF/appengine-web.xml but the files are in src/main/webapp/WEB-INF.
The solution is to uncheck the option "Launch and deploy from this directory (disabled because this is a Maven project)" from your project properties in Eclipse, even if this is really a maven project, like in the picture the option "WAR directory:" should point src/main/webapp
Important! Keep in mind, you have to build the project using maven before running the launch file, otherwise the folder target/myproject/WEB-INF/ will be empty.

WebLogic Toplink (its xml parser?) configuration issue

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

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.

Categories