Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] web.xml and jsr 356 end points

Hello Joakim,

 

I found that out late nite yesterday, thanks so much. Will look into all those.

But I also have a exception when I start embeeded jetty with (from java class) from jettyxml using DeploymentManager (have just a web.xml with a hello servlet  The websocket endpoint is only in the code, not referred anywhere in the code.

Could you please provide some pointers from where I should start looking, don’t find anything on the web?

Thanks so much for all your help.

-          Anu

 

The exception I get is

 

 

330 [main] WARN org.eclipse.jetty.deploy.DeploymentManager - Unable to reach node goal: started

java.lang.IllegalStateException: Unknown configuration type: web-app in org.eclipse.jetty.deploy.providers.WebAppProvider$1@5e4a3789

     at org.eclipse.jetty.xml.XmlConfiguration.setConfig(XmlConfiguration.java:198)

     at org.eclipse.jetty.xml.XmlConfiguration.<init>(XmlConfiguration.java:138)

     at org.eclipse.jetty.deploy.providers.WebAppProvider$1.<init>(WebAppProvider.java:267)

     at org.eclipse.jetty.deploy.providers.WebAppProvider.createContextHandler(WebAppProvider.java:266)

     at org.eclipse.jetty.deploy.App.getContextHandler(App.java:101)

     at org.eclipse.jetty.deploy.bindings.StandardDeployer.processBinding(StandardDeployer.java:36)

     at org.eclipse.jetty.deploy.AppLifeCycle.runBindings(AppLifeCycle.java:186)

     at org.eclipse.jetty.deploy.DeploymentManager.requestAppGoal(DeploymentManager.java:498)

     at org.eclipse.jetty.deploy.DeploymentManager.addApp(DeploymentManager.java:146)

     at org.eclipse.jetty.deploy.providers.ScanningAppProvider.fileAdded(ScanningAppProvider.java:180)

     at org.eclipse.jetty.deploy.providers.ScanningAppProvider$1.fileAdded(ScanningAppProvider.java:64)

     at org.eclipse.jetty.util.Scanner.reportAddition(Scanner.java:609)

     at org.eclipse.jetty.util.Scanner.reportDifferences(Scanner.java:528)

     at org.eclipse.jetty.util.Scanner.scan(Scanner.java:391)

     at org.eclipse.jetty.util.Scanner.doStart(Scanner.java:313)

     at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)

     at org.eclipse.jetty.deploy.providers.ScanningAppProvider.doStart(ScanningAppProvider.java:150)

     at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)

     at org.eclipse.jetty.deploy.DeploymentManager.startAppProvider(DeploymentManager.java:560)

     at org.eclipse.jetty.deploy.DeploymentManager.doStart(DeploymentManager.java:235)

     at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)

     at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)

     at org.eclipse.jetty.server.Server.start(Server.java:380)

     at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)

     at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)

     at org.eclipse.jetty.server.Server.doStart(Server.java:347)

     at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)

     at com.example.minimal.JsrWithXmlStart.main(JsrWithXmlStart.java:45)

 

 

and my deployment manager is configured as

<Call name="addBean">

    <Arg>

      <New id="DeploymentManager" class="org.eclipse.jetty.deploy.DeploymentManager">

        <Set name="contexts">

          <Ref refid="Contexts" />

        </Set>

        <Call id="webappprovider" name="addAppProvider">

          <Arg>

            <New class="org.eclipse.jetty.deploy.providers.WebAppProvider">

              <Set name="monitoredDirName">/anu/jetty92</Set>

              <Set name="defaultsDescriptor">/anu/jetty92/webdefault.xml</Set>

              <Set name="scanInterval">1</Set>

              <Set name="extractWars">true</Set>

            </New>

          </Arg>

        </Call>

      </New>

    </Arg>

  </Call>

 

 

 

 

 

From: jetty-users-bounces@xxxxxxxxxxx [mailto:jetty-users-bounces@xxxxxxxxxxx] On Behalf Of Joakim Erdfelt
Sent: Wednesday, July 30, 2014 4:33 PM
To: JETTY user mailing list
Subject: Re: [jetty-users] web.xml and jsr 356 end points

 

JSR-356 does not support adding websocket endpoints via web.xml or via servlets.

 

Go read up on javax.websocket.server.ServerContainer (both the object and the ServletContext attribute)

 

You'll have a few choices:

 

* javax.websocket.server.ServerEndpoint Annotation scanning

* javax.servlet.ServletContextListener

* javax.websocket.server.ServerApplicationConfig

 


--

Joakim Erdfelt <joakim@xxxxxxxxxxx>

Expert advice, services and support from from the Jetty & CometD experts

 

On Wed, Jul 30, 2014 at 1:24 PM, Padki, Anuradha <anuradha.padki@xxxxxxxx> wrote:

Hello all,

 

I can get the jsr356 working by manually adding the endpoints to the servletContainer as

wscontainer = WebSocketServerContainerInitializer.configureContext(context); WebSocketServerContainerInitializer.configureContext(context);

wscontainer.addEndpoint(MySocket.class);

 

However, I already have a jetty project that uses jetty.xml and web.xml for all other servlets, so I am trying to figure out how to add the end points via web.xml

Any help is greatly appreciated.

Regards

Anu


_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users

 


Back to the top