Vaadin 7.2.0 + atmosphere + OSGI and more

Hello.

  1. Vaadin-shared is required wrong version of streamhtmlparser-jsilver
  2. Atmosphere cant find annotations

[code]
[#|2014-05-14T17:08:58.568+0400|INFO|glassfish3.1.2|org.atmosphere.cpr.AtmosphereFramework|_ThreadID=77;_ThreadName=Thread-2;|Installed AtmosphereHandler com.vaadin.server.communication.PushHandler$1 mapped to context-path: /*|#]

[#|2014-05-14T17:08:58.569+0400|INFO|glassfish3.1.2|org.atmosphere.cpr.AtmosphereFramework|_ThreadID=77;_ThreadName=Thread-2;|Installed the following AtmosphereInterceptor mapped to AtmosphereHandler com.vaadin.server.communication.PushHandler$1|#]

[#|2014-05-14T17:08:58.569+0400|WARNING|glassfish3.1.2|org.atmosphere.cpr.AtmosphereFramework|_ThreadID=77;_ThreadName=Thread-2;|SessionSupport error. Make sure you define org.atmosphere.cpr.SessionSupport as a listener in web.xml instead|#]

[#|2014-05-14T17:08:58.573+0400|INFO|glassfish3.1.2|org.atmosphere.cpr.AtmosphereFramework|_ThreadID=77;_ThreadName=Thread-2;|Atmosphere is using org.atmosphere.cpr.DefaultAnnotationProcessor for processing annotation|#]

[#|2014-05-14T17:08:58.573+0400|INFO|glassfish3.1.2|org.atmosphere.cpr.DefaultAnnotationProcessor|_ThreadID=77;_ThreadName=Thread-2;|AnnotationProcessor class org.atmosphere.cpr.DefaultAnnotationProcessor$BytecodeBasedAnnotationProcessor being used|#]

[#|2014-05-14T17:08:58.575+0400|SEVERE|glassfish3.1.2|org.atmosphere.cpr.AtmosphereFramework|_ThreadID=77;_ThreadName=Thread-2;|java.lang.AssertionError: Not a File: /org/atmosphere/annotation
at org.atmosphere.util.annotation.AnnotationDetector.detect(AnnotationDetector.java:352)
at org.atmosphere.cpr.DefaultAnnotationProcessor.scanForAnnotation(DefaultAnnotationProcessor.java:147)
at org.atmosphere.cpr.DefaultAnnotationProcessor.configure(DefaultAnnotationProcessor.java:133)
at org.atmosphere.cpr.AtmosphereFramework.autoConfigureService(AtmosphereFramework.java:2280)
at org.atmosphere.cpr.AtmosphereFramework.init(AtmosphereFramework.java:707)
at org.atmosphere.cpr.AtmosphereFramework.init(AtmosphereFramework.java:614)
at com.vaadin.server.communication.PushRequestHandler.(PushRequestHandler.java:120)
at com.vaadin.server.VaadinServletService.createRequestHandlers(VaadinServletService.java:92)
at com.vaadin.server.VaadinService.init(VaadinService.java:180)
at ru.aeinf.cas.ria.entrypoint.vaadin.ApplicationVaadinServlet.createServletService(ApplicationVaadinServlet.java:21)
at com.vaadin.server.VaadinServlet.init(VaadinServlet.java:96)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1453)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:1080)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:189)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.comet.CometEngine.executeServlet(CometEngine.java:459)
at com.sun.grizzly.comet.CometEngine.handle(CometEngine.java:316)
at com.sun.grizzly.comet.CometAsyncFilter.doFilter(CometAsyncFilter.java:87)
at com.sun.grizzly.arp.DefaultAsyncExecutor.invokeFilters(DefaultAsyncExecutor.java:171)
at com.sun.grizzly.arp.DefaultAsyncExecutor.interrupt(DefaultAsyncExecutor.java:143)
at com.sun.grizzly.arp.AsyncProcessorTask.doTask(AsyncProcessorTask.java:102)
at com.sun.grizzly.http.TaskBase.run(TaskBase.java:193)
at com.sun.grizzly.http.TaskBase.execute(TaskBase.java:175)
at com.sun.grizzly.arp.DefaultAsyncHandler.handle(DefaultAsyncHandler.java:145)
at com.sun.grizzly.arp.AsyncProtocolFilter.execute(AsyncProtocolFilter.java:210)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:722)
|#]
[/code]3. Getting this exception while push is enable, on any request. After exception page is refreshing -
RESOLVED - recompile widgetsets

#|2014-05-14T17:10:54.932+0400|SEVERE|glassfish3.1.2|com.vaadin.server.communication.PushHandler|_ThreadID=79;_ThreadName=Thread-2;|Error writing JSON to response org.json.JSONException: Value e2540039-97e7-48c8-85ad-ad51f4d308e0 of type java.lang.String cannot be converted to JSONObject at org.json.JSON.typeMismatch(JSON.java:111) at org.json.JSONObject.<init>(JSONObject.java:159) at org.json.JSONObject.<init>(JSONObject.java:172) at com.vaadin.server.communication.ServerRpcHandler$RpcRequest.<init>(ServerRpcHandler.java:79) at com.vaadin.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:160) at com.vaadin.server.communication.PushHandler$3.run(PushHandler.java:172) at com.vaadin.server.communication.PushHandler.callWithUi(PushHandler.java:242) at com.vaadin.server.communication.PushHandler.access$200(PushHandler.java:55) at com.vaadin.server.communication.PushHandler$1.onRequest(PushHandler.java:75) at org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:174) at org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:95) at org.atmosphere.container.GrizzlyServlet30WebSocketSupport.service(GrizzlyServlet30WebSocketSupport.java:73) at org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:1802) at org.atmosphere.websocket.DefaultWebSocketProcessor.dispatch(DefaultWebSocketProcessor.java:432) at org.atmosphere.websocket.DefaultWebSocketProcessor$2.run(DefaultWebSocketProcessor.java:285) at org.atmosphere.util.VoidExecutorService.execute(VoidExecutorService.java:101) at org.atmosphere.websocket.DefaultWebSocketProcessor.dispatch(DefaultWebSocketProcessor.java:280) at org.atmosphere.websocket.DefaultWebSocketProcessor.invokeWebSocketProtocol(DefaultWebSocketProcessor.java:303) at org.atmosphere.container.GlassFishWebSocketHandler.onMessage(GlassFishWebSocketHandler.java:161) at com.sun.grizzly.websockets.DefaultWebSocket.onMessage(DefaultWebSocket.java:164) at com.sun.grizzly.websockets.frametypes.TextFrameType.respond(TextFrameType.java:75) at com.sun.grizzly.websockets.DataFrame.respond(DataFrame.java:102) at com.sun.grizzly.websockets.ProtocolHandler.readFrame(ProtocolHandler.java:151) at com.sun.grizzly.websockets.WebSocketSelectionKeyAttachment.run(WebSocketSelectionKeyAttachment.java:88) at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532) at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513) at java.lang.Thread.run(Thread.java:722) |#] P.S. 3 - Resolved. I recompile widgetsets.
Seems all works fine. I don’t know is esception about annotation is critical.

Hi,

I got the same Error by simply upgrading from vaadin 7.1.12 to 7.2.1

(tomcat 7)

We are using apache shiro

… in our case it doesn’t seem to be related to the widgetsets compilation but rather in conjucntion with the shiro filter.

If we simply move back to Vaadin 7.1.12, everything works fine again.

PS: I p debugged ut a breakpoint on the JSONObject.java line where the exception occurs, and it looks, as far as I can understand, to contain “normal” Json Form data.

Any hints or similar problems ?

Tx
Fabio

ai 29, 2014 12:48:09 AM com.vaadin.server.communication.UidlRequestHandler synchronizedHandleRequest

SEVERE: Error writing JSON to response

org.json.JSONException: Value 661bb5c8-27ee-462c-9cd3-df83f804b3ff of type java.lang.String cannot be converted to JSONObject

at org.json.JSON.typeMismatch(JSON.java:111)

at org.json.JSONObject.<init>(JSONObject.java:159)

at org.json.JSONObject.<init>(JSONObject.java:172)

at com.vaadin.server.communication.ServerRpcHandler$RpcRequest.<init>(ServerRpcHandler.java:79)

at com.vaadin.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:160)

at com.vaadin.server.communication.UidlRequestHandler.synchronizedHandleRequest(UidlRequestHandler.java:93)

at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:41)

at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1405)

at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:237)

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

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

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

at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)

at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)

at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)

at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)

at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)

at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)

at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)

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

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

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 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)

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

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

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

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

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

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

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

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

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

at java.lang.Thread.run(Thread.java:724)

Hello. Are you use OSGI ? If yes i think u have wrong json library, if not try w/o shiro filter. And put your code from exception in CODE tag :wink:

Hi, ok… really sorry about the CODE :-)… I promise I won’t do it again…

I am not using OSGI and, after some further investigations, I found out that the error is issued independently from the usage (or not) of shiro so actually it doesn’t seem to be a shiro problem.

The message

“Value c2ee1383-f7d8-4b21-bf6f-5146264b77b8 of type java.lang.String cannot be converted to JSONObject”

is issued in the Vaadin RpcRequest class (at line 5 in the “CODE” … :slight_smile: … below.

 ....
   public static class RpcRequest implements Serializable {
  ....
        public RpcRequest(String jsonString) throws JSONException {
            json = new JSONObject(jsonString);
            csrfToken = json.getString(ApplicationConstants.CSRF_TOKEN);
            syncId = json.getInt(ApplicationConstants.SERVER_SYNC_ID);
            invocations = new JSONArray(
            json.getString(ApplicationConstants.RPC_INVOCATIONS));
}
....

The question is what could be a main difference between Vaadin 7.1.xx and 7.2.xx in relation with JSON that could be relevant for such an error since the only change I did was to upgrade the version.

PS: In order to switch from Vaadin 7.1.xx to 7.2.1 I simply changed the version in Ivy, recompiled the widgetsets and rebuild the full project. DId I miss here something relevant ? :slight_smile:

Regards
Fabio

I just wanted to add my two cents on this issue. I was having the same issue while using embedded Jetty. I am using Ivy for my dependency management and ended up having to clear my cache when changing the version from 7.1.15 to 7.2.1. It looks like the dependencies made it use the org.json.JSON library instead of the new Android JSON library.

Once the cache was cleared and resolved, I recompiled the widgetset and all was good.

Regards,
Eric

Eric,
well… by adding your “2 cents” you ended up to in delivering the 1 million answer :slight_smile:

That was it.

Actually, after clearing up the Ivy cache, I noticed that the widgetset build process was suddenly failing on the easyuploads add on compilation. I was using there an old version and after replacing it with the latest one (and recompile the widgeset), 7.2.1 works now like a charm.

Tx again,

Cheers
Fabio

Hi there!

I have similar problem changing from version 7.1.9 to 2.0. Im using OSGI with servletbridge in tomcat 6. Tring to enable push in 7.2. With 7.1.9 its working fine, but in 7.2 I got NoClassDefFoundError when vaadin is trying to reach Atmosphere, and simply skips initializing Pushandler. Atmosphere runtime bundle is active. Im not using maven or ivy for this platform. So I need to add bundles manually. Maybe I did not added some bundle correctly. I just changed vaadin jars, and json bundle. Here is my eclipse bundle config:

#Eclipse Runtime Configuration File osgi.bundles=org.eclipse.equinox.common@2:start,\ org.apache.felix.gogo.runtime@start,\ org.apache.felix.gogo.shell@start,\ org.apache.felix.gogo.command@start,\ com.vaadin.external.atmosphere.runtime@start,\ com.vaadin.external.atmosphere.atmosphere-compat-tomcat@start,\ org.apache.commons.jexl@start,\ org.apache.commons.logging@start,\ org.eclipse.osgi.services@start,\ org.eclipse.equinox.registry@start,\ org.eclipse.equinox.http.servlet@start,\ org.eclipse.equinox.http.servletbridge@start,\ org.eclipse.equinox.http.registry@start,\ org.eclipse.equinox.servletbridge.extensionbundle,\ org.eclipse.equinox.preferences@start,\ org.eclipse.equinox.ds@start,\ org.eclipse.equinox.cm@start,\ org.eclipse.equinox.util@start,\ org.eclipse.equinox.console@start,\ org.eclipse.equinox.servletbridge@start,\ com.vaadin.client@start,\ com.vaadin.external.org.slf4j@start,\ com.vaadin.server@start,\ com.vaadin.shared@start,\ com.vaadin.themes@start,\ com.vaadin.push@start,\ com.vaadin.client-compiled@start,\ org.lunifera.runtime.common@start,\ org.lunifera.runtime.component.configuration.manager@start,\ org.lunifera.runtime.component.logging.equinox.over.slf4j@start,\ org.lunifera.runtime.web.vaadin.osgi@start,\ org.lunifera.dependencies.fragment.jdk,\ logback.configuration,\ ch.qos.logback.classic@start,\ ch.qos.logback.core@start,\ jul.to.slf4j@start,\ org.apache.shiro.core@start,\ org.apache.shiro.web@start,\ org.apache.commmons.logging@start,\ org.jsoup@start,\ javax.servlet.jsp@start,\ javax.servlet@start,\ javax.el@start,\ slf4j.api@start,\ org.json@start,\ com.google.gwt.thirdparty.streamhtmlparser@start,\ org.w3c.flute@start,\ com.google.gwt.thirdparty.guava@start,\ org.lunifera.examples.runtime.web.vaadin.standalone@start osgi.bundles.defaultStartLevel=4 Sombody can take a look in it? Thanks

Did you ever get anywhere with number 2 (the atmosphere assertion error)?

This thread seems to be the only reference to that error in Vaadin that I can find.

Regarding 2)

I have the same issue on Vaadin 7.3.6. It seems that it’s fixed in newer version of atmosphere according to this
https://github.com/Atmosphere/atmosphere/issues/1539
.
I tried to use newer version of atmosphere, but I had to do edit MANIFEST.MF in vaadin-push - I changed:

Require-Bundle: com.vaadin.external.atmosphere.runtime;bundle-version=
"2.1.2.vaadin6";visibility:=reexport

to

Require-Bundle: org.atmosphere.runtime;bundle-version="2.2.3";visibili
ty:=reexport

but there are two new issues

  1. Vaadin displays warning on startup
Vaadin depends on Atmosphere 2.1.2.vaadin6 but version 2.2.3 was found.
This might cause compatibility problems if push is used.
  1. and atmosphere throws another error:
java.lang.ClassCastException: org.eclipse.osgi.framework.internal.core.BundleURLConnection cannot be cast to java.net.JarURLConnection
at org.atmosphere.util.annotation.AnnotationDetector.detect(AnnotationDetector.java:363) ~[atmosphere-runtime-2.2.3.jar:na]

at org.atmosphere.cpr.DefaultAnnotationProcessor.scanForAnnotation(DefaultAnnotationProcessor.java:153) ~[atmosphere-runtime-2.2.3.jar:na]

at org.atmosphere.cpr.DefaultAnnotationProcessor.configure(DefaultAnnotationProcessor.java:139) ~[atmosphere-runtime-2.2.3.jar:na]

at org.atmosphere.cpr.AtmosphereFramework.autoConfigureService(AtmosphereFramework.java:2596) [atmosphere-runtime-2.2.3.jar:na]

at org.atmosphere.cpr.AtmosphereFramework.init(AtmosphereFramework.java:875) [atmosphere-runtime-2.2.3.jar:na]

at org.atmosphere.cpr.AtmosphereFramework.init(AtmosphereFramework.java:779) [atmosphere-runtime-2.2.3.jar:na]

at com.vaadin.server.communication.PushRequestHandler.<init>(PushRequestHandler.java:121) [vaadin-server-7.3.6.jar:7.3.6]

at com.vaadin.server.VaadinServletService.createRequestHandlers(VaadinServletService.java:82) [vaadin-server-7.3.6.jar:7.3.6]