The problem in Weblogic are the URLs, with "zip" protocol (instead of
jar), you can fixed ResourceClassScanner to allows ZIP protocol (also
you can change URL protocol from "zip" to "jar")
private void index(URL u, String filePackageName) {
String protocol = u.getProtocol();
if (protocol.equals("file")) {
indexDir(new File(u.getPath()), false);
} else if (
protocol.equals("jar")
|| protocol.equals("zip")) {
URI jarUri = URI.create(u.getPath());
String jarFile = jarUri.getPath();
jarFile = jarFile.substring(0,
jarFile.indexOf('!'));
indexJar(new File(jarFile), filePackageName);
} else {
LOGGER.warning("URL, " +
u +
", is ignored, it not a file or a jar
file");
}
}
I asume that same error force the search of resource classes across
PackagesResourceConfig...
Paul, why not add weblogic support in jersey-0.6?
you can download an evaluation version of weblogic to resolve this.
Thank you
Paul Sandoz wrote:
Hi Arturo,
It appears that WebLogic is behaving differently to Tomcat, Glassfish
and Jetty (see end of email for an issue with Jetty and a possibly
solution to your problem).
Has any one tried WebSphere or the JBoss application server?
By default the servlet (see JavaDoc of
com.sun.ws.rest.spi.container.servlet.ServletContainer) searches the
following paths returned from calling:
context.getRealPath("/WEB-INF/lib"),
context.getRealPath("/WEB-INF/classes")
I am assuming, from the error, that WebLogic is returning null. We may
well be relying on non-standard behaviour in web containers :-( grr
very frustrating...
In my blog [1] i describe another way to configure a servlet by
specifying the package names to search for root resource classes. This
was developed in response an issue Richard was having when deploying
using Jetty in a mode that does not assemble a war file (maybe WebLogic
is doing the same?).
Hope this helps,
Paul.
[1] http://blogs.sun.com/sandoz/entry/jersey_0_5_is_released
Arturo wrote:
Hi:
I am trying to deploy a Jersey example in WebLogic 10. But it seems
that
I need new properties with version 0.5.
Now I get the following error:
<18-ene-2008 17H33' CET> <Error> <Deployer>
<BEA-149265> <Failure
occurred in the execution of deployment request with ID '1200674019181'
for task '0'. Error is: 'weblogic.application.ModuleException:
[HTTP:101216]Servlet: "RESTServlet" failed to preload on startup in Web
application: "rest.war".
java.lang.IllegalArgumentException:
com.sun.ws.rest.config.property.classpath contains no paths
at
com.sun.ws.rest.api.core.ClasspathResourceConfig.getPaths(ClasspathResourceConfig.java:124)
at
com.sun.ws.rest.api.core.ClasspathResourceConfig.<init>(ClasspathResourceConfig.java:81)
at
com.sun.ws.rest.spi.container.servlet.ServletContainer.createResourceConfig(ServletContainer.java:153)
at
com.sun.ws.rest.spi.container.servlet.ServletContainer.init(ServletContainer.java:104)
at weblogic.servlet.internal.StubSecurityHelper
$ServletInitAction.run(StubSecurityHelper.java:282)
at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at
weblogic.security.service.SecurityManager.runAs(Lweblogic.security.acl.internal.AuthenticatedSubject;Lweblogic.security.acl.internal.AuthenticatedSubject;Ljava.security.PrivilegedAction;)Ljava.lang.Object;(Unknown
Source)
at
weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:63)
at
weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:58)
at
weblogic.servlet.internal.StubLifecycleHelper.<init>(StubLifecycleHelper.java:48)
at
weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:504)
at
weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:1830)
at
weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup(WebAppServletContext.java:1807)
at
weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1727)
at
weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:2890)
at
weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:948)
at
weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:353)
at weblogic.application.internal.flow.ModuleStateDriver
$3.next(ModuleStateDriver.java:204)
at
weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
at
weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
at
weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
at
weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:117)
at weblogic.application.internal.flow.ModuleStateDriver
$3.next(ModuleStateDriver.java:204)
at
weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
at
weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
at
weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:26)
at weblogic.application.internal.BaseDeployment
$2.next(BaseDeployment.java:635)
at
weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
at
weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:212)
at
weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:154)
at
weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:80)
at
weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:566)
My web.xml is as follows:
<servlet>
<servlet-name>RESTServlet</servlet-name>
<servlet-class>com.sun.ws.rest.impl.container.servlet.ServletAdaptor</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
In Tomcat 6, it works perfectly.
I have tried with previous versions in WebLogic and I have always got a
"NullPointerException" error deploying Jersey.
weblogic.application.ModuleException: [HTTP:101216]Servlet:
"RESTServlet" failed to preload on startup in Web application:
"rest.war".
java.lang.NullPointerException
at
com.sun.ws.rest.api.core.DynamicResourceConfig.getPaths(DynamicResourceConfig.java:116)
at
com.sun.ws.rest.api.core.DynamicResourceConfig.getPaths(DynamicResourceConfig.java:107)
at
com.sun.ws.rest.api.core.DynamicResourceConfig.getPaths(DynamicResourceConfig.java:97)
at
com.sun.ws.rest.api.core.DynamicResourceConfig.<init>(DynamicResourceConfig.java:63)
at
com.sun.ws.rest.spi.container.servlet.ServletContainer.createResourceConfig(ServletContainer.java:163)
at
com.sun.ws.rest.spi.container.servlet.ServletContainer.init(ServletContainer.java:99)
at weblogic.servlet.internal.StubSecurityHelper
$ServletInitAction.run(StubSecurityHelper.java:282)
at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at
weblogic.security.service.SecurityManager.runAs(Lweblogic.security.acl.internal.AuthenticatedSubject;Lweblogic.security.acl.internal.AuthenticatedSubject;Ljava.security.PrivilegedAction;)Ljava.lang.Object;(Unknown
Source)
at
weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:63)
at
weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:58)
at
weblogic.servlet.internal.StubLifecycleHelper.<init>(StubLifecycleHelper.java:48)
at
weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:504)
at
weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:1830)
at
weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup(WebAppServletContext.java:1807)
at
weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1727)
at
weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:2890)
at
weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:948)
at
weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:353)
at weblogic.application.internal.flow.ModuleStateDriver
$3.next(ModuleStateDriver.java:204)
at
weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
at
weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
at
weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
at
weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:117)
at weblogic.application.internal.flow.ModuleStateDriver
$3.next(ModuleStateDriver.java:204)
at
weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
at
weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
at
weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:26)
at weblogic.application.internal.BaseDeployment
$2.next(BaseDeployment.java:635)
at
weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
at
weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:212)
at
weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:154)
at
weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:950)
at
weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:353)
at weblogic.application.internal.flow.ModuleStateDriver
$3.next(ModuleStateDriver.java:204)
at
weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
at
weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
Truncated. see log file for complete stacktrace
In Tomcat 6 it works.
I would appreciate any help.....
Thanks in advance.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@jersey.dev.java.net
For additional commands, e-mail: users-help@jersey.dev.java.net