I am having issue in deploying restlet application on tomcat webserver.
I am able to run the application directly from eclipse but when I deploy on tomcat I get issues like the following.
May 10, 2015 10:04:32 AM org.apache.catalina.loader.WebappClassLoader loadClass
INFO: Illegal access: this web application instance has been stopped already. Could not load org.simpleframework.transport.connect.Connection.
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.WebappClassLoader.loadClass(WebappClassLoader.java:1566)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.getConstructor(Unknown Source)
at org.restlet.engine.Engine.registerHelper(Engine.java:781)
at org.restlet.engine.Engine.registerHelpers(Engine.java:813)
at org.restlet.engine.Engine.registerHelpers(Engine.java:853)
at org.restlet.engine.Engine.discoverConnectors(Engine.java:544)
at org.restlet.engine.Engine.<init>(Engine.java:379)
at org.restlet.engine.Engine.register(Engine.java:301)
at org.restlet.engine.Engine.register(Engine.java:290)
at org.restlet.engine.Engine.getInstance(Engine.java:199)
at org.restlet.data.Method.<init>(Method.java:337)
at org.restlet.data.Method.<init>(Method.java:396)
at org.restlet.data.Method.<init>(Method.java:361)
at org.restlet.data.Method.<clinit>(Method.java:48)
at org.restlet.resource.ClientResource.<init>(ClientResource.java:396)
May 10, 2015 10:04:32 AM org.apache.catalina.loader.WebappClassLoader loadClass
INFO: Illegal access: this web application instance has been stopped already. Could not load org.simpleframework.transport.connect.Connection. 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.WebappClassLoader.loadClass(WebappClassLoader.java:1566)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.getConstructor(Unknown Source)
at org.restlet.engine.Engine.registerHelper(Engine.java:781)
at org.restlet.engine.Engine.registerHelpers(Engine.java:813)
at org.restlet.engine.Engine.registerHelpers(Engine.java:853)
at org.restlet.engine.Engine.discoverConnectors(Engine.java:544)
at org.restlet.engine.Engine.<init>(Engine.java:379)
at org.restlet.engine.Engine.register(Engine.java:301)
at org.restlet.engine.Engine.register(Engine.java:290)
at org.restlet.engine.Engine.getInstance(Engine.java:199)
at org.restlet.data.Method.<init>(Method.java:337)
at org.restlet.data.Method.<init>(Method.java:396)
at org.restlet.data.Method.<init>(Method.java:361)
at org.restlet.data.Method.<clinit>(Method.java:48)
at org.restlet.resource.ClientResource.<init>(ClientResource.java:396)
INFO: Illegal access: this web application instance has been stopped already. Could not load java.net.InetSocketAddress. 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.WebappClassLoader.loadClass(WebappClassLoader.java:1566)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.getConstructor(Unknown Source)
at org.restlet.engine.Engine.registerHelper(Engine.java:781)
at org.restlet.engine.Engine.registerHelpers(Engine.java:813)
at org.restlet.engine.Engine.registerHelpers(Engine.java:853)
at org.restlet.engine.Engine.discoverConnectors(Engine.java:544)
at org.restlet.engine.Engine.<init>(Engine.java:379)
at org.restlet.engine.Engine.register(Engine.java:301)
at org.restlet.engine.Engine.register(Engine.java:290)
at org.restlet.engine.Engine.getInstance(Engine.java:199)
at org.restlet.data.Method.<init>(Method.java:337)
at org.restlet.data.Method.<init>(Method.java:396)
at org.restlet.data.Method.<init>(Method.java:361)
at org.restlet.data.Method.<clinit>(Method.java:48)
at org.restlet.resource.ClientResource.<init>(ClientResource.java:396)
INFO: Illegal access: this web application instance has been stopped already. Could not load org.restlet.data.Protocol. 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.WebappClassLoader.loadClass(WebappClassLoader.java:1566)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at org.restlet.ext.simple.HttpServerHelper.<init>(HttpServerHelper.java:57)
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 org.restlet.engine.Engine.registerHelper(Engine.java:781)
at org.restlet.engine.Engine.registerHelpers(Engine.java:813)
at org.restlet.engine.Engine.registerHelpers(Engine.java:853)
at org.restlet.engine.Engine.discoverConnectors(Engine.java:544)
at org.restlet.engine.Engine.<init>(Engine.java:379)
at org.restlet.engine.Engine.register(Engine.java:301)
at org.restlet.engine.Engine.register(Engine.java:290)
at org.restlet.engine.Engine.getInstance(Engine.java:199)
at org.restlet.data.Method.<init>(Method.java:337)
at org.restlet.data.Method.<init>(Method.java:396)
at org.restlet.data.Method.<init>(Method.java:361)
at org.restlet.data.Method.<clinit>(Method.java:48)
at org.restlet.resource.ClientResource.<init>(ClientResource.java:396)
INFO: Illegal access: this web application instance has been stopped already. Could not load java.util.logging.Logger. 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.WebappClassLoader.loadClass(WebappClassLoader.java:1566)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at org.restlet.engine.log.LoggerFacade.getLogger(LoggerFacade.java:117)
at org.restlet.engine.Engine.getLogger(Engine.java:255)
at org.restlet.Context.getCurrentLogger(Context.java:81)
at org.restlet.engine.Engine.registerHelper(Engine.java:785)
at org.restlet.engine.Engine.registerHelpers(Engine.java:813)
at org.restlet.engine.Engine.registerHelpers(Engine.java:853)
at org.restlet.engine.Engine.discoverConnectors(Engine.java:544)
at org.restlet.engine.Engine.<init>(Engine.java:379)
at org.restlet.engine.Engine.register(Engine.java:301)
at org.restlet.engine.Engine.register(Engine.java:290)
at org.restlet.engine.Engine.getInstance(Engine.java:199)
at org.restlet.data.Method.<init>(Method.java:337)
at org.restlet.data.Method.<init>(Method.java:396)
at org.restlet.data.Method.<init>(Method.java:361)
at org.restlet.data.Method.<clinit>(Method.java:48)
at org.restlet.resource.ClientResource.<init>(ClientResource.java:396)
I checked and the simple.jar is part of the deployed war.
Can someone please suggest what this illegal access is and how I can solve it.
Thanks.
I guess that you mixed the standalone and the embedded approach of Restlet:
Do you make a try within Eclipse using the standalone approach or embedded one (with WTP for example)?
Here is a Maven file that allows you to create an embedded project:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.restlet</groupId>
<artifactId>restlet-war</artifactId>
<name>${project.artifactId}</name>
<packaging>war</packaging>
<version>1.0.0-snapshot</version>
<properties>
<java-version>1.7</java-version>
<restlet-version>2.3.1</restlet-version>
<wtp-version>2.0</wtp-version>
</properties>
<dependencies>
<dependency>
<groupId>org.restlet.jee</groupId>
<artifactId>org.restlet</artifactId>
<version>${restlet-version}</version>
</dependency>
<dependency>
<groupId>org.restlet.jee</groupId>
<artifactId>org.restlet.ext.servlet</artifactId>
<version>${restlet-version}</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>maven-restlet</id>
<name>Public online Restlet repository</name>
<url>http://maven.restlet.com</url>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${java-version}</source>
<target>${java-version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>install</id>
<phase>install</phase>
<goals>
<goal>sources</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<configuration>
<wtpapplicationxml>true</wtpapplicationxml>
<wtpversion>${wtp-version}</wtpversion>
</configuration>
</plugin>
</plugins>
</build>
</project>
Initializing the project for Eclipse can be done using the command mvn eclipse:eclipse
.
You can find a complete simple project at this address: https://github.com/templth/restlet-stackoverflow/tree/master/restlet/test-restlet-servlet.
Hope it will help you, Thierry