[GLASSFISH-21058] Websocket create new live threads and never kill it Created: 02/May/14  Updated: 04/Jun/14

Status: Open
Project: glassfish
Component/s: web_socket
Affects Version/s: 4.0
Fix Version/s: None

Type: Bug Priority: Critical
Reporter: dungld Assignee: Pavel Bucek
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Ubuntu 12.04 LTS 64 bit server
RAM: 10GB
CPU: 8 cores


Tags: 4_0_1-approved, websocket

 Description   

I tested 1000 concurrent websocket requests and Glassfish created 1000 new live threads and so on.

I used VisualVM to check and saw new threads always increase.

If I test with 30000 concurrent websocket request, server got trouble and notice:
"Exception in thread "main" java.lang.OutOfMemoryError: unable to create new native thread."

I updated Tyrus 1.5 to Glassfish 4 but not success because of EJB revoking.

When I use Glassfish 4.0.1 b3 with Tyrus 1.5, everything ok, no new live thread apprear but sometimes, I got exception like that:

2014-05-03T00:49:04.690+0700|SEVERE: java.io.IOException: Broken pipe
at sun.nio.ch.FileDispatcherImpl.write0(Native Method)
at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47)
at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)
at sun.nio.ch.IOUtil.write(IOUtil.java:51)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:487)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.flushByteBuffer(TCPNIOTransport.java:1251)
at org.glassfish.grizzly.nio.transport.TCPNIOAsyncQueueWriter.write0(TCPNIOAsyncQueueWriter.java:107)
at org.glassfish.grizzly.nio.AbstractNIOAsyncQueueWriter.write(AbstractNIOAsyncQueueWriter.java:273)
at org.glassfish.grizzly.nio.AbstractNIOAsyncQueueWriter.write(AbstractNIOAsyncQueueWriter.java:180)
at org.glassfish.grizzly.nio.AbstractNIOAsyncQueueWriter.write(AbstractNIOAsyncQueueWriter.java:70)
at org.glassfish.grizzly.nio.transport.TCPNIOTransportFilter.handleWrite(TCPNIOTransportFilter.java:128)
at org.glassfish.grizzly.filterchain.TransportFilter.handleWrite(TransportFilter.java:191)
at org.glassfish.grizzly.filterchain.ExecutorResolver$8.execute(ExecutorResolver.java:111)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.filterchain.FilterChainContext.write(FilterChainContext.java:853)
at org.glassfish.grizzly.filterchain.FilterChainContext.write(FilterChainContext.java:822)
at org.glassfish.grizzly.http.io.OutputBuffer.flushBuffer(OutputBuffer.java:1011)
at org.glassfish.grizzly.http.io.OutputBuffer.flushBinaryBuffers(OutputBuffer.java:996)
at org.glassfish.grizzly.http.io.OutputBuffer.flushAllBuffers(OutputBuffer.java:967)
at org.glassfish.grizzly.http.io.OutputBuffer.flush(OutputBuffer.java:732)
at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:291)
at org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:275)
at org.apache.catalina.connector.CoyoteOutputStream.flush(CoyoteOutputStream.java:175)
at org.glassfish.tyrus.servlet.TyrusServletWriter._write(TyrusServletWriter.java:165)
at org.glassfish.tyrus.servlet.TyrusServletWriter.write(TyrusServletWriter.java:144)
at org.glassfish.tyrus.core.ProtocolHandler.write(ProtocolHandler.java:278)
at org.glassfish.tyrus.core.ProtocolHandler.send(ProtocolHandler.java:179)
at org.glassfish.tyrus.core.ProtocolHandler.send(ProtocolHandler.java:174)
at org.glassfish.tyrus.core.ProtocolHandler.send(ProtocolHandler.java:206)
at org.glassfish.tyrus.core.TyrusWebSocket.sendText(TyrusWebSocket.java:283)
at org.glassfish.tyrus.core.TyrusRemoteEndpoint$Basic.sendText(TyrusRemoteEndpoint.java:94)
at com.gbsofts.gbpriceboard.service.web.BoardDataService.onMessage(BoardDataService.java:119)
at sun.reflect.GeneratedMethodAccessor225.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1081)
at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1153)
at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:4696)
at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:630)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:582)
at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:55)
at sun.reflect.GeneratedMethodAccessor106.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:883)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:582)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doCall(SystemInterceptorProxy.java:163)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy.java:140)
at sun.reflect.GeneratedMethodAccessor95.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:883)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:369)
at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:4668)
at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:4656)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:212)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:88)
at com.sun.proxy.$Proxy398.onMessage(Unknown Source)
at com.gbsofts.gbpriceboard.service.web._EJB31_GeneratedBoardDataServiceIntf__Bean_.onMessage(Unknown Source)
at sun.reflect.GeneratedMethodAccessor225.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.glassfish.tyrus.core.AnnotatedEndpoint.callMethod(AnnotatedEndpoint.java:438)
at org.glassfish.tyrus.core.AnnotatedEndpoint.access$100(AnnotatedEndpoint.java:86)
at org.glassfish.tyrus.core.AnnotatedEndpoint$WholeHandler$1.onMessage(AnnotatedEndpoint.java:533)
at org.glassfish.tyrus.core.TyrusSession.notifyMessageHandlers(TyrusSession.java:430)
at org.glassfish.tyrus.core.TyrusEndpointWrapper.onMessage(TyrusEndpointWrapper.java:652)
at org.glassfish.tyrus.core.TyrusWebSocket.onMessage(TyrusWebSocket.java:194)
at org.glassfish.tyrus.core.frame.TextFrame.respond(TextFrame.java:134)
at org.glassfish.tyrus.core.ProtocolHandler.process(ProtocolHandler.java:568)
at org.glassfish.tyrus.core.TyrusWebSocketEngine$TyrusReadHandler.handle(TyrusWebSocketEngine.java:260)
at org.glassfish.tyrus.servlet.TyrusHttpUpgradeHandler.onDataAvailable(TyrusHttpUpgradeHandler.java:164)
at org.apache.catalina.connector.InputBuffer$ReadHandlerImpl.processDataAvailable(InputBuffer.java:488)
at org.apache.catalina.connector.InputBuffer$ReadHandlerImpl.onDataAvailable(InputBuffer.java:453)
at org.glassfish.grizzly.http.io.InputBuffer.append(InputBuffer.java:855)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:220)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:837)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
at org.glassfish.grizzly.strategies.WorkerThreadI
2014-05-03T00:49:04.690+0700|SEVERE: OStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
at java.lang.Thread.run(Thread.java:744)






[GLASSFISH-18482] WEB9031: WebappClassLoader unable to load resource Created: 08/Mar/12  Updated: 10/Jul/12

Status: Reopened
Project: glassfish
Component/s: jax-rs
Affects Version/s: 3.1.2
Fix Version/s: None

Type: Bug Priority: Major
Reporter: cowwoc Assignee: Pavel Bucek
Resolution: Unresolved Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Netbeans 7.1.1, Glassfish 3.1.2, JDK7 update 2


Attachments: Zip Archive HomesForHumans.zip    

 Description   

I don't know if this is related to GLASSFISH-14416 but every time I deploy my webapp on a fresh Glassfish instance I get this error:

INFO: Scanning for root resource and provider classes in the packages:
  com.homesforhumans.resource
INFO: Root resource classes found:
  class com.homesforhumans.resource.PostalCodesResource
INFO: No provider classes found.
INFO: Initiating Jersey application, version 'Jersey: 1.12 02/15/2012 04:51 PM'
INFO: WEB0671: Loading application [com.homesforhumans_HomesForHumans_war_1.0-SNAPSHOT] at [/context]
INFO: com.homesforhumans_HomesForHumans_war_1.0-SNAPSHOT was successfully deployed in 2,238 milliseconds.
INFO: WEB0169: Created HTTP listener [http-listener-2] on host/port [0.0.0.0:8181]
INFO: Grizzly Framework 1.9.46 started in: 3ms - bound to [0.0.0.0:8181]
SEVERE: The RuntimeException could not be mapped to a response, re-throwing to the HTTP container
java.lang.IllegalStateException: WEB9031: WebappClassLoader unable to load resource [javax.ws.rs.core.Response$Status], because it has not yet been started, or was already stopped
	at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1401)
	at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1359)
	at com.sun.jersey.core.spi.factory.ResponseBuilderImpl.<init>(ResponseBuilderImpl.java:67)
	at com.sun.jersey.core.spi.factory.AbstractRuntimeDelegate.createResponseBuilder(AbstractRuntimeDelegate.java:99)
	at javax.ws.rs.core.Response$ResponseBuilder.newInstance(Response.java:356)
	at javax.ws.rs.core.Response.status(Response.java:104)
	at com.sun.jersey.api.Responses.status(Responses.java:127)
	at com.sun.jersey.api.Responses.notFound(Responses.java:103)
	at com.sun.jersey.api.NotFoundException.<init>(NotFoundException.java:68)
	at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1484)
	at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1414)
	at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1363)
	at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1353)
	at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:414)
	at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537)
	at com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:895)
	at com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:843)
	at com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:804)
	at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
	at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118)
	at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113)

I'm attaching my project file for your review.



 Comments   
Comment by Shing Wai Chan [ 28/Mar/12 ]

I notice the following incorrect elements in glassfish-web.xml
9a10,13
> <sun-web-app error-url="">
> <context-root>/context</context-root>
> <class-loader delegate="false"/>
> </sun-web-app>
10a15,18
> <sun-web-app error-url="">
> <context-root>/context</context-root>
> <class-loader delegate="false"/>
> </sun-web-app>

I have fixed the app in my local env.
It is deployed in 3.1.2 without error in server.log. But the app cannot be accessed.

When it is deployed in the 4.0 trunk, I saw the following in server.log:
[#|2012-03-28T14:06:42.492-0700|SEVERE|44.0|com.sun.jersey.core.spi.component.ProviderFactory|_ThreadID=72;_ThreadName=Thread-2;|The provider class, class com.sun.jersey.moxy.MoxyMessageBodyWorker, could not be instantiated. Processing will continue but the class will not be utilized
java.lang.NullPointerException
at com.sun.jersey.moxy.MoxyMessageBodyWorker.<init>(MoxyMessageBodyWorker.java:84)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at com.sun.jersey.core.spi.component.ComponentConstructor._getInstance(ComponentConstructor.java:209)
at com.sun.jersey.core.spi.component.ComponentConstructor.getInstance(ComponentConstructor.java:179)
at com.sun.jersey.core.spi.component.ProviderFactory.__getComponentProvider(ProviderFactory.java:166)
at com.sun.jersey.core.spi.component.ProviderFactory.getComponentProvider(ProviderFactory.java:137)
at com.sun.jersey.core.spi.component.ProviderServices.getComponent(ProviderServices.java:256)
at com.sun.jersey.core.spi.component.ProviderServices.getServices(ProviderServices.java:160)
at com.sun.jersey.core.spi.factory.MessageBodyFactory.initReaders(MessageBodyFactory.java:176)
at com.sun.jersey.core.spi.factory.MessageBodyFactory.init(MessageBodyFactory.java:162)
at com.sun.jersey.server.impl.application.WebApplicationImpl._initiate(WebApplicationImpl.java:1287)
at com.sun.jersey.server.impl.application.WebApplicationImpl.access$700(WebApplicationImpl.java:171)
at com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:777)
at com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:773)
at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:193)
at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:773)
at com.sun.jersey.guice.spi.container.servlet.GuiceContainer.initiate(GuiceContainer.java:121)
at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:318)
at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:607)
at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:208)
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:373)
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:719)
at com.google.inject.servlet.FilterDefinition.init(FilterDefinition.java:114)
at com.google.inject.servlet.ManagedFilterPipeline.initPipeline(ManagedFilterPipeline.java:98)
at com.google.inject.servlet.GuiceFilter.init(GuiceFilter.java:172)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:264)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:120)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4857)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5549)
at com.sun.enterprise.web.WebModule.start(WebModule.java:499)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:936)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:920)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:733)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2010)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1660)
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:107)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:301)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:512)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:262)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:414)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:351)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:366)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1075)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:98)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1308)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1276)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:479)
at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:223)
at org.glassfish.grizzly.http.server.StaticHttpHandler.service(StaticHttpHandler.java:293)
at com.sun.enterprise.v3.server.HK2Dispatcher.dispatch(HK2Dispatcher.java:113)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:236)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:163)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:164)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:265)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:134)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:78)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:816)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:567)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:547)
at java.lang.Thread.run(Thread.java:722)

#]

[#|2012-03-28T14:06:42.495-0700|SEVERE|44.0|com.sun.jersey.core.spi.component.ProviderFactory|_ThreadID=72;_ThreadName=Thread-2;|The provider class, class com.sun.jersey.moxy.MoxyListMessageBodyWorker, could not be instantiated. Processing will continue but the class will not be utilized
java.lang.NullPointerException
at com.sun.jersey.moxy.MoxyMessageBodyWorker.<init>(MoxyMessageBodyWorker.java:84)
at com.sun.jersey.moxy.MoxyListMessageBodyWorker.<init>(MoxyListMessageBodyWorker.java:72)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at com.sun.jersey.core.spi.component.ComponentConstructor._getInstance(ComponentConstructor.java:209)
at com.sun.jersey.core.spi.component.ComponentConstructor.getInstance(ComponentConstructor.java:179)
at com.sun.jersey.core.spi.component.ProviderFactory.__getComponentProvider(ProviderFactory.java:166)
at com.sun.jersey.core.spi.component.ProviderFactory.getComponentProvider(ProviderFactory.java:137)
at com.sun.jersey.core.spi.component.ProviderServices.getComponent(ProviderServices.java:256)
at com.sun.jersey.core.spi.component.ProviderServices.getServices(ProviderServices.java:160)
at com.sun.jersey.core.spi.factory.MessageBodyFactory.initReaders(MessageBodyFactory.java:176)
at com.sun.jersey.core.spi.factory.MessageBodyFactory.init(MessageBodyFactory.java:162)
at com.sun.jersey.server.impl.application.WebApplicationImpl._initiate(WebApplicationImpl.java:1287)
at com.sun.jersey.server.impl.application.WebApplicationImpl.access$700(WebApplicationImpl.java:171)
at com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:777)
at com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:773)
at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:193)
at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:773)
at com.sun.jersey.guice.spi.container.servlet.GuiceContainer.initiate(GuiceContainer.java:121)
at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:318)
at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:607)
at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:208)
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:373)
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:719)
at com.google.inject.servlet.FilterDefinition.init(FilterDefinition.java:114)
at com.google.inject.servlet.ManagedFilterPipeline.initPipeline(ManagedFilterPipeline.java:98)
at com.google.inject.servlet.GuiceFilter.init(GuiceFilter.java:172)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:264)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:120)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4857)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5549)
at com.sun.enterprise.web.WebModule.start(WebModule.java:499)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:936)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:920)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:733)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2010)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1660)
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:107)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:301)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:512)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:262)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:414)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:351)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:366)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1075)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:98)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1308)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1276)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:479)
at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:223)
at org.glassfish.grizzly.http.server.StaticHttpHandler.service(StaticHttpHandler.java:293)
at com.sun.enterprise.v3.server.HK2Dispatcher.dispatch(HK2Dispatcher.java:113)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:236)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:163)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:164)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:265)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:134)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:78)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:816)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:567)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:547)
at java.lang.Thread.run(Thread.java:722)

#]

[#|2012-03-28T14:06:42.501-0700|SEVERE|44.0|com.sun.jersey.core.spi.component.ProviderFactory|_ThreadID=72;_ThreadName=Thread-2;|The provider class, class com.sun.jersey.multipart.impl.MultiPartReaderServerSide, could not be instantiated. Processing will continue but the class will not be utilized
java.lang.IllegalArgumentException: The MultiPartConfig instance we expected is not present. Have you registered the MultiPartConfigProvider class?
at com.sun.jersey.multipart.impl.MultiPartReaderClientSide.<init>(MultiPartReaderClientSide.java:102)
at com.sun.jersey.multipart.impl.MultiPartReaderServerSide.<init>(MultiPartReaderServerSide.java:71)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at com.sun.jersey.core.spi.component.ComponentConstructor._getInstance(ComponentConstructor.java:209)
at com.sun.jersey.core.spi.component.ComponentConstructor.getInstance(ComponentConstructor.java:179)
at com.sun.jersey.core.spi.component.ProviderFactory.__getComponentProvider(ProviderFactory.java:166)
at com.sun.jersey.core.spi.component.ProviderFactory.getComponentProvider(ProviderFactory.java:137)
at com.sun.jersey.core.spi.component.ProviderServices.getComponent(ProviderServices.java:256)
at com.sun.jersey.core.spi.component.ProviderServices.getServices(ProviderServices.java:160)
at com.sun.jersey.core.spi.factory.MessageBodyFactory.initReaders(MessageBodyFactory.java:176)
at com.sun.jersey.core.spi.factory.MessageBodyFactory.init(MessageBodyFactory.java:162)
at com.sun.jersey.server.impl.application.WebApplicationImpl._initiate(WebApplicationImpl.java:1287)
at com.sun.jersey.server.impl.application.WebApplicationImpl.access$700(WebApplicationImpl.java:171)
at com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:777)
at com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:773)
at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:193)
at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:773)
at com.sun.jersey.guice.spi.container.servlet.GuiceContainer.initiate(GuiceContainer.java:121)
at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:318)
at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:607)
at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:208)
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:373)
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:719)
at com.google.inject.servlet.FilterDefinition.init(FilterDefinition.java:114)
at com.google.inject.servlet.ManagedFilterPipeline.initPipeline(ManagedFilterPipeline.java:98)
at com.google.inject.servlet.GuiceFilter.init(GuiceFilter.java:172)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:264)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:120)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4857)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5549)
at com.sun.enterprise.web.WebModule.start(WebModule.java:499)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:936)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:920)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:733)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2010)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1660)
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:107)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:301)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:512)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:262)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:414)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:351)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:366)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1075)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:98)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1308)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1276)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:479)
at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:223)
at org.glassfish.grizzly.http.server.StaticHttpHandler.service(StaticHttpHandler.java:293)
at com.sun.enterprise.v3.server.HK2Dispatcher.dispatch(HK2Dispatcher.java:113)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:236)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:163)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:164)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:265)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:134)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:78)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:816)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:567)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:547)
at java.lang.Thread.run(Thread.java:722)

#]
Comment by cowwoc [ 14/Jun/12 ]

This error only seems to occur when overriding the built-in version of Glassfish by setting:

<class-loader delegate="false"/>
Comment by cowwoc [ 14/Jun/12 ]

Shing Wai Chan,

I don't understand your last post. What are the incorrect elements in glassfish.xml? It looks right to me.

Comment by cowwoc [ 14/Jun/12 ]

Good news! It looks like this issue is caused by setting:

<class-loader delegate="false"/>

in glassfish.xml but neglecting to set:

-Dcom.sun.enterprise.overrideablejavaxpackages=javax.ws.rs,javax.ws.rs.core,javax.ws.rs.ext

in domain.xml. The full instructions can be found here: http://jersey.java.net/nonav/documentation/latest/glassfish.html#d4e1903

In light of this discovery, is there a way to get Glassfish to throw a less misleading error message?

Also, can anyone reproduce this error in spite of following the above steps?

Comment by Pavel Bucek [ 15/Jun/12 ]

not about jersey anymore, user requests change in error reporting.

btw see http://java.net/jira/browse/GLASSFISH-13134 for full context.

Comment by Shing Wai Chan [ 09/Jul/12 ]

In Java EE 6, we cannot override the javax.* packages even with delegate flag.
We will mark this as a duplicate of the improvement task has been filed http://java.net/jira/browse/GLASSFISH-13134 .

Comment by cowwoc [ 10/Jul/12 ]

Shing,

Regardless of when GLASSFISH-13134 is implemented, we need to improve the error message. GLASSFISH-13134 does not cover this. Can we reopen this issue?

Comment by Shing Wai Chan [ 10/Jul/12 ]

Per request, we will reopen the bug for a better error message.





[GLASSFISH-21252] Jaxrs Json encoding default Created: 12/Nov/14  Updated: 18/Nov/14

Status: Open
Project: glassfish
Component/s: jax-rs, json
Affects Version/s: 4.1
Fix Version/s: None

Type: Improvement Priority: Major
Reporter: Puls Assignee: Pavel Bucek
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Hi,
We are currently working on an application which needs to be deployed on multiple Servers. So far the gf4.1 experience has been pleasant.

The one area where we are encountering problems is the json encoding default of jaxrs in gf. Our gwt frontend cannot work with the encodings of maps and enums cause trouble as root entities.

Jackson encoding is the de-facto Standard. It would simplify things a lot if moxy produced the same Output or if switching to jackson was made easier without introducing API dependencies in a project (e.G. Descriptor).






[GLASSFISH-21115] Websocket unknown bug Created: 04/Jul/14  Updated: 07/Jul/14

Status: Open
Project: glassfish
Component/s: web_socket
Affects Version/s: 4.0
Fix Version/s: None

Type: Bug Priority: Major
Reporter: dungld Assignee: Pavel Bucek
Resolution: Unresolved Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Ubuntu 12.04, java 7



 Description   

I got exception from log when run service using web socket feature, it will generate about 2MB log every 5 minute.

This log content repeat as following:

[2014-07-04T08:21:33.905+0700] [glassfish 4.0] [WARNING] [] [org.glassfish.tyrus.servlet.TyrusHttpUpgradeHandler] [tid: _ThreadID=1112 _ThreadName=http-listener-1(1086)] [timeMillis: 1404436893905] [levelValue: 900] [[
Already set read listener
java.lang.IllegalStateException: Already set read listener
at org.apache.catalina.connector.InputBuffer.setReadListener(InputBuffer.java:303)
at org.apache.catalina.connector.CoyoteInputStream.setReadListener(CoyoteInputStream.java:312)
at org.glassfish.tyrus.servlet.TyrusHttpUpgradeHandler.init(TyrusHttpUpgradeHandler.java:106)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:777)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
at com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:147)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:412)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:282)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
at java.lang.Thread.run(Thread.java:744)
]]



 Comments   
Comment by dungld [ 04/Jul/14 ]

This bug occurs when I add redirect record on Virtual Server option of Glassfish

Steps:

Configurations / server-config / Virtual Servers / server / Add Property

Name= redirect_1
Value = from=/contextsource url-prefix=/contextdestination/subcontext





[GLASSFISH-21089] Websocket unknow bug Created: 16/Jun/14  Updated: 10/Dec/14

Status: Open
Project: glassfish
Component/s: web_socket
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: dungld Assignee: Pavel Bucek
Resolution: Unresolved Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Ubuntu 12.04 LTS 64bit, glassfish 4.0.1 b6


Tags: websocket

 Description   

I use websocket for pushing data from server to client, sometimes I got exceptions from glassfish log:

[2014-06-16T09:10:39.007+0700] [glassfish 4.0] [SEVERE] [] [] [tid: _ThreadID=1768 _ThreadName=Thread-9] [timeMillis: 1402884639007] [levelValue: 1000] [[
java.io.IOException: Connection reset by peer
at sun.nio.ch.FileDispatcherImpl.write0(Native Method)
at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47)
at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)
at sun.nio.ch.IOUtil.write(IOUtil.java:51)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:487)
at org.glassfish.grizzly.nio.transport.TCPNIOUtils.flushByteBuffer(TCPNIOUtils.java:149)
at org.glassfish.grizzly.nio.transport.TCPNIOUtils.writeSimpleBuffer(TCPNIOUtils.java:133)
at org.glassfish.grizzly.nio.transport.TCPNIOAsyncQueueWriter.write0(TCPNIOAsyncQueueWriter.java:109)
at org.glassfish.grizzly.nio.transport.TCPNIOAsyncQueueWriter.write0(TCPNIOAsyncQueueWriter.java:91)
at org.glassfish.grizzly.nio.AbstractNIOAsyncQueueWriter.write(AbstractNIOAsyncQueueWriter.java:261)
at org.glassfish.grizzly.nio.AbstractNIOAsyncQueueWriter.write(AbstractNIOAsyncQueueWriter.java:170)
at org.glassfish.grizzly.nio.AbstractNIOAsyncQueueWriter.write(AbstractNIOAsyncQueueWriter.java:70)
at org.glassfish.grizzly.nio.transport.TCPNIOTransportFilter.handleWrite(TCPNIOTransportFilter.java:126)
at org.glassfish.grizzly.filterchain.TransportFilter.handleWrite(TransportFilter.java:191)
at org.glassfish.grizzly.filterchain.ExecutorResolver$8.execute(ExecutorResolver.java:111)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.filterchain.FilterChainContext.write(FilterChainContext.java:848)
at org.glassfish.grizzly.filterchain.FilterChainContext.write(FilterChainContext.java:817)
at org.glassfish.grizzly.http.io.OutputBuffer.flushBuffer(OutputBuffer.java:1024)
at org.glassfish.grizzly.http.io.OutputBuffer.flushBinaryBuffers(OutputBuffer.java:1011)
at org.glassfish.grizzly.http.io.OutputBuffer.flushAllBuffers(OutputBuffer.java:982)
at org.glassfish.grizzly.http.io.OutputBuffer.flush(OutputBuffer.java:737)
at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:291)
at org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:275)
at org.apache.catalina.connector.CoyoteOutputStream.flush(CoyoteOutputStream.java:175)
at org.glassfish.tyrus.servlet.TyrusServletWriter._write(TyrusServletWriter.java:158)
at org.glassfish.tyrus.servlet.TyrusServletWriter.write(TyrusServletWriter.java:133)
at org.glassfish.tyrus.core.ProtocolHandler.write(ProtocolHandler.java:289)
at org.glassfish.tyrus.core.ProtocolHandler.send(ProtocolHandler.java:190)
at org.glassfish.tyrus.core.ProtocolHandler.send(ProtocolHandler.java:185)
at org.glassfish.tyrus.core.ProtocolHandler.send(ProtocolHandler.java:217)
at org.glassfish.tyrus.core.TyrusWebSocket.sendText(TyrusWebSocket.java:292)
at org.glassfish.tyrus.core.TyrusRemoteEndpoint$Basic.sendText(TyrusRemoteEndpoint.java:94)
at com.gbsofts.gbpriceboard.service.web.BoardDataService.onMessage(BoardDataService.java:124)
at sun.reflect.GeneratedMethodAccessor595.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1081)
at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1153)
at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:4786)
at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:656)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:608)
at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:55)
at org.jboss.weld.ejb.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:52)
at sun.reflect.GeneratedMethodAccessor311.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:883)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:608)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doCall(SystemInterceptorProxy.java:163)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy.java:140)
at sun.reflect.GeneratedMethodAccessor84.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:883)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:369)
at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:4758)
at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:4746)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:212)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:88)
at com.sun.proxy.$Proxy426.onMessage(Unknown Source)
at com.gbsofts.gbpriceboard.service.web._EJB31_GeneratedBoardDataServiceIntf__Bean_.onMessage(Unknown Source)
at sun.reflect.GeneratedMethodAccessor595.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.glassfish.tyrus.core.AnnotatedEndpoint.callMethod(AnnotatedEndpoint.java:446)
at org.glassfish.tyrus.core.AnnotatedEndpoint.access$100(AnnotatedEndpoint.java:86)
at org.glassfish.tyrus.core.AnnotatedEndpoint$WholeHandler$1.onMessage(AnnotatedEndpoint.java:541)
at org.glassfish.tyrus.core.TyrusSession.notifyMessageHandlers(TyrusSession.java:521)
at org.glassfish.tyrus.core.TyrusEndpointWrapper.onMessage(TyrusEndpointWrapper.java:690)
at org.glassfish.tyrus.core.TyrusWebSocket.onMessage(TyrusWebSocket.java:200)
at org.glassfish.tyrus.core.frame.TextFrame.respond(TextFrame.java:135)
at org.glassfish.tyrus.core.ProtocolHandler.process(ProtocolHandler.java:580)
at org.glassfish.tyrus.core.TyrusWebSocketEngine$TyrusReadHandler.handle(TyrusWebSocketEngine.java:297)
at org.glassfish.tyrus.servlet.TyrusHttpUpgradeHandler.onDataAvailable(TyrusHttpUpgradeHandler.java:164)
at org.apache.catalina.connector.InputBuffer$ReadHandlerImpl.processDataAvailable(InputBuffer.java:488)
at org.apache.catalina.connector.InputBuffer$ReadHandlerImpl.onDataAvailable(InputBuffer.java:453)
at org.glassfish.grizzly.http.io.InputBuffer.invokeHandler(InputBuffer.java:1101)
at org.glassfish.grizzly.http.io.InputBuffer.invokeHandlerOnProperThread(InputBuffer.java:1092)
at org.glassfish.grizzly.http.io.InputBuffer.append(InputBuffer.java:975)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:271)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
at org.glassfish.grizzly.ProcessorExecutor.execute]]

[2014-06-16T09:10:39.007+0700] [glassfish 4.0] [SEVERE] [] [] [tid: _ThreadID=1768 _ThreadName=Thread-9] [timeMillis: 1402884639007] [levelValue: 1000] [[
(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
at java.lang.Thread.run(Thread.java:744)]]

It repeats many time in my glassfish log and I don't know what cause these bugs.



 Comments   
Comment by toto2 [ 10/Dec/14 ]

I get the same bug with glassfish 4.1.





[GLASSFISH-21059] Http Compression when use websocket Created: 02/May/14  Updated: 04/Jun/14

Status: Open
Project: glassfish
Component/s: web_socket
Affects Version/s: 4.0
Fix Version/s: None

Type: Improvement Priority: Major
Reporter: dungld Assignee: Pavel Bucek
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Ubuntu Linux Server 64 bit


Tags: 4_0_1-approved, http, websocket

 Description   

When I use Glassfish 4.0 with Tyrus 1.0, I can enable http compression feature on Glassfish.

But when I use Glassfish 4.0.1 b3 with Tyrus 1.5, I can not enable http compression feature because when I tick compression checkbox, my webpage cannot display (included javascript, css...)

I think compression feature is very important when loading page initial. I hope Glassfish team improve it for next release.

Thank you.






[GLASSFISH-20916] Terminating Browser Leaves Open/Lingering WebSockets Created: 05/Dec/13  Updated: 23/Apr/14

Status: Open
Project: glassfish
Component/s: web_socket
Affects Version/s: 4.0
Fix Version/s: None

Type: Bug Priority: Major
Reporter: kag0782 Assignee: Pavel Bucek
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows 32bit


Tags: websockets

 Description   

If a browser that has opened a websocket is killed (not closed, but terminated abruptly), the websocket connection on the server is still considered "open" (i.e. onClose is not called on the endpoint), and still allows data to be written to the session without exceptions being thrown.

Example:

@ServerEndpoint("/test")
@WebServlet(urlPatterns={"/connections"})
public class Test extends HttpServlet {

    private static final HashSet<Session> sessions = new HashSet<Session>();

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        resp.getWriter().print(sessions.size());
    }

    @OnOpen
    public void onOpen(Session session, EndpointConfig config) {
        sessions.add(session);
    }
    
    @OnClose
    public void onClose(Session session, CloseReason reason) {
        sessions.remove(session);
    }
    
}

Establishing a websocket connection to /test above will cause the /connections servlet to respond with "1". If the browser is terminated, /connections will still return "1". If another websocket connection to /test is made, then /connections will show "2". This is leading to a memory leak.



 Comments   
Comment by Pavel Bucek [ 06/Dec/13 ]

are you sure that @OnClose is not ever called? (It probably might take some time, since it looks that underlying TCP connection is not properly closed - it will need to hit some idle timeout).

There is not much we can do in Tyrus (WebSocket RI) to improve this - we do rely on Servlet's mechanism to report us that connection has been closed and if that don't happens, the connection is considered to be open. Furthermore, the fact that you are able to write the data to the session means that the TCP connection is still open.

You can try to reproduce jt by using just plain Servlet API (HttpUpgradeHandler#destroy should be called when client disconects) and then maybe file a bug against it..

Comment by kag0782 [ 07/Dec/13 ]

Thank you. Destroy is apparently only ever called when the WebConnection object is closed; which means that the web socket must be closed through the handshake method. That is not good.

Comment by kag0782 [ 07/Dec/13 ]

I reproduced the issue using the plain servlet API as you said. The servlet does indeed instruct the handler that the connection was closed; however, it is not done through the destroy method, but rather through the ServletInputStream of the WebConnection object as given to the HttpUpgradeHandler. When the socket is closed, the ReadListener's onDataAvailable method is called indicating some data has arrived. When the input stream is then read from it throws a EOFException. This should instruct the web socket implementation to forcibly close the connection by calling close on the WebConnection (and incidentally the @OnClose method of the endpoint). This in turn calls the destroy method on the HttpUpgradeHandler.

Here is my example:

@WebServlet(urlPatterns={"/test5"})
public class UpgradeTest extends HttpServlet implements HttpUpgradeHandler {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        try {
            MessageDigest cipher = MessageDigest.getInstance("SHA-1");
            cipher.reset();
            cipher.update((req.getHeader("sec-websocket-key") + "258EAFA5-E914-47DA-95CA-C5AB0DC85B11").getBytes());
            resp.setHeader("Sec-Websocket-Accept", new BASE64Encoder().encode(cipher.digest()));
            resp.setHeader("Upgrade", "websocket");
            resp.setHeader("Connection", "Upgrade");
            resp.setStatus(101);
            resp.flushBuffer();
            req.upgrade(UpgradeTest.class);
        } catch (Exception e) {
        }
    }
    
    public void destroy() {
        System.err.println("Destroyed");
    }
    
    public void init(final WebConnection wc) {
        System.err.println("Initialized");
        try {
            R r = new R(wc.getInputStream());
            wc.getInputStream().setReadListener(r);
            wc.getOutputStream().setWriteListener(r);
        } catch (IOException e) {
        }
    }
    
    public static class R implements ReadListener, WriteListener {
        private final ServletInputStream i;
        
        public R(ServletInputStream i) {
            this.i = i;
        }
        
        public void onAllDataRead() {
            System.err.println("All data read");
        }

        public void onDataAvailable() {
            System.err.println("Data available");
            try {
                System.err.println(i.readLine(new byte[1000], 0, 1000));
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

        public void onError(Throwable t) {
            t.printStackTrace();
        }

        public void onWritePossible() {
            System.err.println("Write possible");
        }
    }
    
}
Comment by Pavel Bucek [ 09/Dec/13 ]

I cannot reproduce it on my Mac. I guess this might be platform related issue.

.. anyway, this is not related to Tyrus, it is more Servlet issue from my point of view. Reassigning to Servlet group for further evaluation.





Generated at Mon Apr 24 11:22:19 UTC 2017 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.