-
-
Notifications
You must be signed in to change notification settings - Fork 751
AtmosphereHandler not being found, when using NetBeans IDE
nepa edited this page Oct 20, 2012
·
1 revision
This article might be helpful, if you use:
- NetBeans IDE (version before 7.0.1?)
- GlassFish 3.1.2.2
- Atmosphere with WebSockets only
- Java server and JavaScript client
Problem:
You might run into these exceptions right after start-up:
Schwerwiegend: 1421 [http-thread-pool-8080(1)] WARN org.atmosphere.container.GlassFishWebSocketSupport - failed to connect to web socket
Schwerwiegend: org.atmosphere.cpr.AtmosphereMappingException: No AtmosphereHandler maps request for /WebSocketTest/
And after sending a WebSocket request:
Schwerwiegend: 21718 [http-thread-pool-8080(1)] ERROR org.atmosphere.cpr.AsynchronousProcessor - No AtmosphereHandler found. Make sure you define it inside WEB-INF/atmosphere.xml or annotate using @AtmosphereHandlerService
Schwerwiegend: 21720 [http-thread-pool-8080(1)] WARN org.atmosphere.websocket.DefaultWebSocketProcessor - Failed invoking AtmosphereFramework.doCometSupport()
Schwerwiegend: org.atmosphere.cpr.AtmosphereMappingException: No AtmosphereHandler found. Make sure you define it inside WEB-INF/atmosphere.xml or annotate using @AtmosphereHandlerService
In case you are having troubles with AtmosphereHandler not being found, check the file sun-web.xml (or sometimes glassfish-web.xml). Older versions of NetBeans add a "context-root" element to the file automatically. It's value will be equal to the Maven artifactId (most likely your project name).
Solution: Remove the "context-root" element or set it's value to "/".
Warning: Older NetBeans versions will recreate/refresh the element, each time you deploy your project.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD GlassFish Application Server 3.0 Servlet 3.0//EN" "http://www.sun.com/software/appserver/dtds/sun-web-app_3_0-0.dtd">
<sun-web-app error-url="">
<!-- Remove the context-root element or set it to "/" -->
<!-- <context-root>/WebSocketTest</context-root> -->
<class-loader delegate="true"/>
<jsp-config>
<property name="keepgenerated" value="true">
<description>Keep a copy of the generated servlet class' java code.</description>
</property>
</jsp-config>-
</sun-web-app>
Also check out this issue in the NetBeans bugtracker: Netbeans regenerates glassfish-web.xml every deploy
- Understanding Atmosphere
- Understanding @ManagedService
- Using javax.inject.Inject and javax.inject.PostConstruct annotation
- Understanding Atmosphere's Annotation
- Understanding AtmosphereResource
- Understanding AtmosphereHandler
- Understanding WebSocketHandler
- Understanding Broadcaster
- Understanding BroadcasterCache
- Understanding Meteor
- Understanding BroadcastFilter
- Understanding Atmosphere's Events Listeners
- Understanding AtmosphereInterceptor
- Configuring Atmosphere for Performance
- Understanding JavaScript functions
- Understanding AtmosphereResourceSession
- Improving Performance by using the PoolableBroadcasterFactory
- Using Atmosphere Jersey API
- Using Meteor API
- Using AtmosphereHandler API
- Using Socket.IO
- Using GWT
- Writing HTML5 Server-Sent Events
- Using STOMP protocol
- Streaming WebSocket messages
- Configuring Atmosphere's Classes Creation and Injection
- Using AtmosphereInterceptor to customize Atmosphere Framework
- Writing WebSocket sub protocol
- Configuring Atmosphere for the Cloud
- Injecting Atmosphere's Components in Jersey
- Sharing connection between Browser's windows and tabs
- Understanding AtmosphereResourceSession
- Manage installed services
- Server Side: javadoc API
- Server Side: atmosphere.xml and web.xml configuration
- Client Side: atmosphere.js API