cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble with JVM 7 - atmosphere chat sample

richard_hirsch
Active Contributor
0 Kudos

I'm trying to deploy an app with JVM 7 but I'm having some trouble when I start it.

I'm trying to get the chat sample from atmosphere working but I keep getting errors when I start the app.

I haven't changed anything in the chat sample code. It is also working correctly locally with jetty.

I've deployed using the "--java-version 7" attribute from the console client.

When the application starts, I keep getting class loader errors:

java.io.IOException: Failed to access resource /WEB-INF/lib/logback-classic-0.9.30.jar

Here are some tips from the atmosphere team about deployment on different app servers.

Anyone have any ideas about the problem might be. I assume that it might be associate with the use of  <Loader delegate="false"/> in the context file.

Thanks,

Dick

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

So it works locally, but do you know if it uses java version 7 locally?

The actual error is IOException and not ClassNotFoundException, therefore it looks to me as:

1. Based on a condition (such as javaversion) atmosphere sets up its own classloader

2. The classloader is initialized by pointing to a set of .jar files. One of these doesn't exist in your project (logback)

3. The above call fails since the file is not present

Have you tried adding the logback-classic-0.9.30.jar file to the WEB-INF/lib folder and see what happens?

What's the complete stack trace of the error message?

Regards

Dagfinn

richard_hirsch
Active Contributor
0 Kudos

After removing the context.xml files (based on the fact that NW Cloud) already supports Servelt 3.0, atmosphere starts correctly.

After starting the application, however, I get a new exception:

2##atosbeta#websockets22#web#null#null#Servlet.service() for servlet [AtmosphereServlet] in context with path [/atmosphere-chat] threw exception [org/apache/coyote/http11/upgrade/UpgradeInbound] with root cause

java.lang.ClassNotFoundException: org.apache.coyote.http11.upgrade.UpgradeInbound

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.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)

at java.lang.ClassLoader.loadClass(ClassLoader.java:415)

at org.atmosphere.container.Tomcat7AsyncSupportWithWebSocket.service(Tomcat7AsyncSupportWithWebSocket.java:57)

at org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:1370)

at org.atmosphere.cpr.AtmosphereServlet.doPost(AtmosphereServlet.java:293)

at org.atmosphere.cpr.AtmosphereServlet.doGet(AtmosphereServlet.java:279)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:735)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:601)

at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:274)

at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:271)

at java.security.AccessController.doPrivileged(Native Method)

at javax.security.auth.Subject.doAsPrivileged(Subject.java:536)

at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:306)

at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:166)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:299)

at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:57)

at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:193)

at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:189)

at java.security.AccessController.doPrivileged(Native Method)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)

at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)

at com.sap.security.auth.service.webcontainer.internal.Authenticator.invoke(Authenticator.java:152)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)

at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)

at com.sap.core.tenant.valve.TenantValidationValve.invokeNextValve(TenantValidationValve.java:169)

at com.sap.core.tenant.valve.TenantValidationValve.invoke(TenantValidationValve.java:84)

at com.sap.core.js.monitoring.tomcat.valve.RequestTracingValve.invoke(RequestTracingValve.java:27)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)

at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)

at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)

at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

at java.lang.Thread.run(Thread.java:789)|

richard_hirsch
Active Contributor
0 Kudos

After asking on the Atmosphere Google Group list, I received this tip:

The problem is OSGi configuration.

You have to setup it such way that the OSGi bundle for Atmosphere has

a reference to the Tomcat one.

Consult with NetWeaver Cloud docs to see how to do that.

Can anyone help me here?

D.

richard_hirsch
Active Contributor
0 Kudos

I added the following line to MANIFEST.MF file to deal with the OSGI error:

Import-Package: org.apache.coyote.http11.upgrade,org.apache.catalina.connector

Answers (0)