jersey and java web start

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

jersey and java web start

Benoit DECHERF-2
Hi,

I'm trying to start a jersey server localy using javaws.
It works correctly if i use a javax.ws.rs.Application to define my classes.
BUT if I use the package scanner
(com.sun.jersey.config.property.packages), It works only if I work
online.

In the offline mode, I get this error:
com.sun.jersey.core.spi.scanning.ScannerException: IO error when
scanning jar jar:http://myhost.fr/desktop-0.1.1-SNAPSHOT.jar!/fr/mypackage
        at com.sun.jersey.core.spi.scanning.uri.JarZipSchemeScanner.scan(JarZipSchemeScanner.java:75)
[jersey-core-1.1.5.jar:1.1.5]
        at com.sun.jersey.core.spi.scanning.PackageNamesScanner.scan(PackageNamesScanner.java:135)
[jersey-core-1.1.5.jar:1.1.5]
        at com.sun.jersey.core.spi.scanning.PackageNamesScanner.scan(PackageNamesScanner.java:121)
[jersey-core-1.1.5.jar:1.1.5]
        at com.sun.jersey.api.core.ScanningResourceConfig.init(ScanningResourceConfig.java:69)
[jersey-server-1.1.5.jar:1.1.5]
        at com.sun.jersey.api.core.PackagesResourceConfig.init(PackagesResourceConfig.java:110)
[jersey-server-1.1.5.jar:1.1.5]
        at com.sun.jersey.api.core.PackagesResourceConfig.<init>(PackagesResourceConfig.java:76)
[jersey-server-1.1.5.jar:1.1.5]
        at com.sun.jersey.api.core.PackagesResourceConfig.<init>(PackagesResourceConfig.java:87)
[jersey-server-1.1.5.jar:1.1.5]
        at com.sun.jersey.spi.container.servlet.WebComponent.createResourceConfig(WebComponent.java:641)
[jersey-server-1.1.5.jar:1.1.5]
        at com.sun.jersey.spi.container.servlet.WebComponent.createResourceConfig(WebComponent.java:619)
[jersey-server-1.1.5.jar:1.1.5]
        at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:199)
[jersey-server-1.1.5.jar:1.1.5]
        at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:307)
[jersey-server-1.1.5.jar:1.1.5]
        at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:470)
[jersey-server-1.1.5.jar:1.1.5]
        at javax.servlet.GenericServlet.init(GenericServlet.java:241)
[grizzly-servlet-webserver-1.9.18-i.jar:1.9.18-i]
        at com.sun.grizzly.http.servlet.ServletAdapter.loadServlet(ServletAdapter.java:428)
[grizzly-servlet-webserver-1.9.18-i.jar:1.9.18-i]
        at com.sun.grizzly.http.servlet.ServletAdapter.doService(ServletAdapter.java:367)
[grizzly-servlet-webserver-1.9.18-i.jar:1.9.18-i]
        at com.sun.grizzly.http.servlet.ServletAdapter.service(ServletAdapter.java:324)
[grizzly-servlet-webserver-1.9.18-i.jar:1.9.18-i]
        at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166)
[grizzly-servlet-webserver-1.9.18-i.jar:1.9.18-i]
        at com.sun.grizzly.tcp.http11.GrizzlyAdapterChain.service(GrizzlyAdapterChain.java:180)
[grizzly-servlet-webserver-1.9.18-i.jar:1.9.18-i]
        at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166)
[grizzly-servlet-webserver-1.9.18-i.jar:1.9.18-i]
        at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
[grizzly-servlet-webserver-1.9.18-i.jar:1.9.18-i]
        at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
[grizzly-servlet-webserver-1.9.18-i.jar:1.9.18-i]
        at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
[grizzly-servlet-webserver-1.9.18-i.jar:1.9.18-i]
        at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
[grizzly-servlet-webserver-1.9.18-i.jar:1.9.18-i]
        at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
[grizzly-servlet-webserver-1.9.18-i.jar:1.9.18-i]
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
[grizzly-servlet-webserver-1.9.18-i.jar:1.9.18-i]
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
[grizzly-servlet-webserver-1.9.18-i.jar:1.9.18-i]
        at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
[grizzly-servlet-webserver-1.9.18-i.jar:1.9.18-i]
        at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
[grizzly-servlet-webserver-1.9.18-i.jar:1.9.18-i]
        at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
[grizzly-servlet-webserver-1.9.18-i.jar:1.9.18-i]
        at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
[grizzly-servlet-webserver-1.9.18-i.jar:1.9.18-i]
        at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
[grizzly-servlet-webserver-1.9.18-i.jar:1.9.18-i]
        at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
[grizzly-servlet-webserver-1.9.18-i.jar:1.9.18-i]
        at java.lang.Thread.run(Thread.java:619) [na:1.6.0_15]
Caused by: java.net.UnknownHostException: myhost.fr
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
[na:1.6.0_15]
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
[na:1.6.0_15]

Is there any workaround ? I don't find any issue on this ?

Benoit

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: jersey and java web start

Paul Sandoz
Administrator
Hi Benoit,

I am not sure what can be done in this respect other than explicitly  
declare the root resource and provider classes, or perhaps trying the  
web-based scanning configuration in WEB-INF/lib and WEB-INF/classes.  
For full detail see here:

   https://jersey.dev.java.net/nonav/apidocs/latest/jersey/com/sun/jersey/spi/container/servlet/ServletContainer.html

The package scanning technique does some tricks to decompose well  
known URIs to find class files. It has to do this because there is no  
way to explicitly ask the JVM what class files are available to be  
loaded.

Paul.


On Feb 3, 2010, at 11:50 AM, Benoit DECHERF wrote:

> Hi,
>
> I'm trying to start a jersey server localy using javaws.
> It works correctly if i use a javax.ws.rs.Application to define my  
> classes.
> BUT if I use the package scanner
> (com.sun.jersey.config.property.packages), It works only if I work
> online.
>
> In the offline mode, I get this error:
> com.sun.jersey.core.spi.scanning.ScannerException: IO error when
> scanning jar jar:http://myhost.fr/desktop-0.1.1-SNAPSHOT.jar!/fr/mypackage
>        at  
> com
> .sun
> .jersey
> .core
> .spi.scanning.uri.JarZipSchemeScanner.scan(JarZipSchemeScanner.java:
> 75)
> [jersey-core-1.1.5.jar:1.1.5]
>        at  
> com
> .sun
> .jersey
> .core.spi.scanning.PackageNamesScanner.scan(PackageNamesScanner.java:
> 135)
> [jersey-core-1.1.5.jar:1.1.5]
>        at  
> com
> .sun
> .jersey
> .core.spi.scanning.PackageNamesScanner.scan(PackageNamesScanner.java:
> 121)
> [jersey-core-1.1.5.jar:1.1.5]
>        at  
> com
> .sun
> .jersey
> .api.core.ScanningResourceConfig.init(ScanningResourceConfig.java:69)
> [jersey-server-1.1.5.jar:1.1.5]
>        at  
> com
> .sun
> .jersey
> .api.core.PackagesResourceConfig.init(PackagesResourceConfig.java:110)
> [jersey-server-1.1.5.jar:1.1.5]
>        at  
> com
> .sun
> .jersey
> .api.core.PackagesResourceConfig.<init>(PackagesResourceConfig.java:
> 76)
> [jersey-server-1.1.5.jar:1.1.5]
>        at  
> com
> .sun
> .jersey
> .api.core.PackagesResourceConfig.<init>(PackagesResourceConfig.java:
> 87)
> [jersey-server-1.1.5.jar:1.1.5]
>        at  
> com
> .sun
> .jersey
> .spi
> .container
> .servlet.WebComponent.createResourceConfig(WebComponent.java:641)
> [jersey-server-1.1.5.jar:1.1.5]
>        at  
> com
> .sun
> .jersey
> .spi
> .container
> .servlet.WebComponent.createResourceConfig(WebComponent.java:619)
> [jersey-server-1.1.5.jar:1.1.5]
>        at  
> com
> .sun
> .jersey.spi.container.servlet.WebComponent.init(WebComponent.java:199)
> [jersey-server-1.1.5.jar:1.1.5]
>        at  
> com
> .sun
> .jersey
> .spi.container.servlet.ServletContainer.init(ServletContainer.java:
> 307)
> [jersey-server-1.1.5.jar:1.1.5]
>        at  
> com
> .sun
> .jersey
> .spi.container.servlet.ServletContainer.init(ServletContainer.java:
> 470)
> [jersey-server-1.1.5.jar:1.1.5]
>        at javax.servlet.GenericServlet.init(GenericServlet.java:241)
> [grizzly-servlet-webserver-1.9.18-i.jar:1.9.18-i]
>        at  
> com
> .sun
> .grizzly.http.servlet.ServletAdapter.loadServlet(ServletAdapter.java:
> 428)
> [grizzly-servlet-webserver-1.9.18-i.jar:1.9.18-i]
>        at  
> com
> .sun
> .grizzly.http.servlet.ServletAdapter.doService(ServletAdapter.java:
> 367)
> [grizzly-servlet-webserver-1.9.18-i.jar:1.9.18-i]
>        at  
> com
> .sun.grizzly.http.servlet.ServletAdapter.service(ServletAdapter.java:
> 324)
> [grizzly-servlet-webserver-1.9.18-i.jar:1.9.18-i]
>        at  
> com
> .sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:
> 166)
> [grizzly-servlet-webserver-1.9.18-i.jar:1.9.18-i]
>        at  
> com
> .sun
> .grizzly
> .tcp.http11.GrizzlyAdapterChain.service(GrizzlyAdapterChain.java:180)
> [grizzly-servlet-webserver-1.9.18-i.jar:1.9.18-i]
>        at  
> com
> .sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:
> 166)
> [grizzly-servlet-webserver-1.9.18-i.jar:1.9.18-i]
>        at  
> com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:
> 791)
> [grizzly-servlet-webserver-1.9.18-i.jar:1.9.18-i]
>        at  
> com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
> [grizzly-servlet-webserver-1.9.18-i.jar:1.9.18-i]
>        at  
> com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
> [grizzly-servlet-webserver-1.9.18-i.jar:1.9.18-i]
>        at  
> com
> .sun
> .grizzly
> .http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
> [grizzly-servlet-webserver-1.9.18-i.jar:1.9.18-i]
>        at  
> com
> .sun
> .grizzly
> .DefaultProtocolChain
> .executeProtocolFilter(DefaultProtocolChain.java:135)
> [grizzly-servlet-webserver-1.9.18-i.jar:1.9.18-i]
>        at  
> com
> .sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:
> 102)
> [grizzly-servlet-webserver-1.9.18-i.jar:1.9.18-i]
>        at  
> com
> .sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:
> 88)
> [grizzly-servlet-webserver-1.9.18-i.jar:1.9.18-i]
>        at  
> com
> .sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
> [grizzly-servlet-webserver-1.9.18-i.jar:1.9.18-i]
>        at  
> com
> .sun
> .grizzly
> .ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
> [grizzly-servlet-webserver-1.9.18-i.jar:1.9.18-i]
>        at  
> com
> .sun
> .grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
> [grizzly-servlet-webserver-1.9.18-i.jar:1.9.18-i]
>        at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
> [grizzly-servlet-webserver-1.9.18-i.jar:1.9.18-i]
>        at com.sun.grizzly.util.AbstractThreadPool
> $Worker.doWork(AbstractThreadPool.java:330)
> [grizzly-servlet-webserver-1.9.18-i.jar:1.9.18-i]
>        at com.sun.grizzly.util.AbstractThreadPool
> $Worker.run(AbstractThreadPool.java:309)
> [grizzly-servlet-webserver-1.9.18-i.jar:1.9.18-i]
>        at java.lang.Thread.run(Thread.java:619) [na:1.6.0_15]
> Caused by: java.net.UnknownHostException: myhost.fr
>        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
> [na:1.6.0_15]
>        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
> [na:1.6.0_15]
>
> Is there any workaround ? I don't find any issue on this ?
>
> Benoit
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]