I think the problem is in the:
at
com.sun.jersey.api.wadl.config.WadlGeneratorLoader.setProperty(WadlGener
atorLoader.java:176)
specifically, the javadocs for WadlGenerator indicate:
The WadlGenerator property is of type File and the provided
property value is a String:
the provided property value can contain the prefix classpath: to
denote, that the path to the file is relative to the classpath. In this
case, the property value is stripped by the prefix classpath: and the
File is created via
new File( generator.getClass().getResource( strippedFilename
).toURI() )
Notice that the filename is loaded from the classpath in this
case, e.g. classpath:test.xml refers to a file in the package of the
class (WadlGeneratorDescription.getGeneratorClass()
<file:///C:/dev/tools/Jersey/jersey-archive-1.0.3/apidocs/jersey/com/sun
/jersey/api/wadl/config/WadlGeneratorDescription.html#getGeneratorClass%
28%29> ). The file reference classpath:/test.xml refers to a file that
is in the root of the classpath.
The stacktrace has a problem in the java.io.File constructor:
at java.io.File.<init>(File.java:335)
Any ideas?
-mark
_______________________________________________
Mark A. Rabick - Software Engineer
Em: mark.rabick_at_ngc.com
________________________________
From: Rabick, Mark A (IS) [mailto:Mark.Rabick_at_ngc.com]
Sent: Monday, May 11, 2009 11:14 AM
To: users_at_jersey.dev.java.net
Subject: [Jersey] Error deploying WAR w/ Jersey app on Weblogic
10.1
I've been working in Eclipse 3.4 and have been deploying my
jersey app to a server using the embedded weblogic server tools. I
generated a WAR file by using the Export -> Java -> War menu option in
eclipse and the exported war file application does not deploy, whereas
the eclipse "Run on Server" works. I'm getting an exception when the
app deploys:
It appears to be in the WADL generation. Here is my
CnodbRestWadlGeneratorConfig.java
/**
* This class is used to define extensions to the
default WADL generator
* by defining properties in a wadl generation
configuration class.
* The following wadl enhancements are incorporated:
* <ul>
* <li>An introductory paragraph for the application
using a {_at_link WadlGeneratorApplicationDoc}
* generator with a reference to the
<i>application-doc.xml</i> file.</li>
* <li>An XSD schema from a {_at_link
WadlGeneratorGrammarsSupport} generator stored in the file
* <i>application-grammars.xml</i>
file.</li>
* <li>Incorporate javadoc elements in a generated
<i>resourcedoc.xml</i> file
* using a {_at_link
WadlGeneratorResourceDocSuport} generator. The file must
* be generated before packaging the
application. The file is generated using
* javadoc defined in the build file.
* </ul>
*/
public class CnodbRestWadlGeneratorConfig extends
WadlGeneratorConfig {
@Override
public List<WadlGeneratorDescription>
configure() {
return super.generator(
WadlGeneratorApplicationDoc.class )
.prop( "applicationDocsFile",
"classpath:/application-doc.xml" )
.generator(
WadlGeneratorGrammarsSupport.class )
.prop( "grammarsFile",
"classpath:/application-grammars.xml" )
.generator(
WadlGeneratorResourceDocSupport.class )
.prop( "resourceDocFile",
"classpath:/resourcedoc.xml" )
.descriptions();
}
}
The exception is below:
<May 11, 2009 11:09:25 AM CDT> <Warning> <Deployer> <BEA-149078>
<Stack trace for message 149004
weblogic.application.ModuleException: [HTTP:101216]Servlet:
"CNODB Web Application" failed to preload on startup in Web application:
"cdal-web-service
java.lang.RuntimeException: Could not load
WadlGeneratorConfiguration, check the configuration of
com.sun.jersey.config.property.WadlGeneratorConfig
at
com.sun.jersey.api.wadl.config.WadlGeneratorConfigLoader.loadWadlGenerat
orsFromConfig(WadlGeneratorConfigLoader.java:100)
at
com.sun.jersey.server.impl.wadl.WadlFactory.<init>(WadlFactory.java:73)
at
com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebAp
plicationImpl.java:587)
at
com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebAp
plicationImpl.java:383)
at
com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletCo
ntainer.java:377)
at
com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebCompone
nt.initiate(ServletContainer.java:242)
at
com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java
:449)
at
com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java
:169)
at
com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContai
ner.java:281)
at
com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContai
ner.java:442)
at
javax.servlet.GenericServlet.init(GenericServlet.java:241)
at
weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubS
ecurityHelper.java:282)
at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSu
bject.java:321)
at
weblogic.security.service.SecurityManager.runAs(Unknown Source)
at
weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityH
elper.java:63)
at
weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLife
cycleHelper.java:58)
at
weblogic.servlet.internal.StubLifecycleHelper.<init>(StubLifecycleHelper
.java:48)
at
weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl
.java:507)
at
weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServ
letContext.java:1853)
at
weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup(Web
AppServletContext.java:1830)
at
weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppSe
rvletContext.java:1750)
at
weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContex
t.java:2909)
at
weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:9
73)
at
weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:361)
at
weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateD
river.java:204)
at
weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriv
er.java:26)
at
weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDr
iver.java:60)
at
weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModule
Driver.java:200)
at
weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleLis
tenerInvoker.java:117)
at
weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateD
river.java:204)
at
weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriv
er.java:26)
at
weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDr
iver.java:60)
at
weblogic.application.internal.flow.StartModulesFlow.activate(StartModule
sFlow.java:26)
at
weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:
635)
at
weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriv
er.java:26)
at
weblogic.application.internal.BaseDeployment.activate(BaseDeployment.jav
a:212)
at
weblogic.application.internal.DeploymentStateChecker.activate(Deployment
StateChecker.java:154)
at
weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppCo
ntainerInvoker.java:80)
at
weblogic.deploy.internal.targetserver.operations.AbstractOperation.activ
ate(AbstractOperation.java:566)
at
weblogic.deploy.internal.targetserver.operations.ActivateOperation.activ
ateDeployment(ActivateOperation.java:136)
at
weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCom
mit(ActivateOperation.java:104)
at
weblogic.deploy.internal.targetserver.operations.StartOperation.doCommit
(StartOperation.java:139)
at
weblogic.deploy.internal.targetserver.operations.AbstractOperation.commi
t(AbstractOperation.java:320)
at
weblogic.deploy.internal.targetserver.DeploymentManager.handleDeployment
Commit(DeploymentManager.java:816)
at
weblogic.deploy.internal.targetserver.DeploymentManager.activateDeployme
ntList(DeploymentManager.java:1223)
at
weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(Dep
loymentManager.java:434)
at
weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit
(DeploymentServiceDispatcher.java:161)
at
weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallback
Deliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java
at
weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallback
Deliverer.access$100(DeploymentReceiverCallbackDeliverer.java:12)
at
weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallback
Deliverer$2.run(DeploymentReceiverCallbackDeliverer.java:67)
at
weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWo
rkManagerImpl.java:464)
at
weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)
at
weblogic.work.ExecuteThread.run(ExecuteThread.java:172)
Caused by: java.lang.RuntimeException: Could not load wadl
generators from wadlGeneratorDescriptions.
at
com.sun.jersey.api.wadl.config.WadlGeneratorConfig.getWadlGenerator(Wadl
GeneratorConfig.java:155)
at
com.sun.jersey.api.wadl.config.WadlGeneratorConfigLoader.loadWadlGenerat
orsFromConfig(WadlGeneratorConfigLoader.java:97)
... 52 more
Caused by: java.lang.IllegalArgumentException: URI is not
hierarchical
at java.io.File.<init>(File.java:335)
at
com.sun.jersey.api.wadl.config.WadlGeneratorLoader.setProperty(WadlGener
atorLoader.java:176)
at
com.sun.jersey.api.wadl.config.WadlGeneratorLoader.loadWadlGenerator(Wad
lGeneratorLoader.java:135)
at
com.sun.jersey.api.wadl.config.WadlGeneratorLoader.loadWadlGeneratorDesc
riptions(WadlGeneratorLoader.java:110)
at
com.sun.jersey.api.wadl.config.WadlGeneratorConfig.getWadlGenerator(Wadl
GeneratorConfig.java:153)
... 53 more
at
weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:9
75)
at
weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:361)
at
weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateD
river.java:204)
at
weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriv
er.java:26)
at
weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDr
iver.java:60)
Truncated. see log file for complete stacktrace
java.lang.IllegalArgumentException: URI is not hierarchical
at java.io.File.<init>(File.java:335)
at
com.sun.jersey.api.wadl.config.WadlGeneratorLoader.setProperty(WadlGener
atorLoader.java:176)
at
com.sun.jersey.api.wadl.config.WadlGeneratorLoader.loadWadlGenerator(Wad
lGeneratorLoader.java:135)
at
com.sun.jersey.api.wadl.config.WadlGeneratorLoader.loadWadlGeneratorDesc
riptions(WadlGeneratorLoader.java:110)
at
com.sun.jersey.api.wadl.config.WadlGeneratorConfig.getWadlGenerator(Wadl
GeneratorConfig.java:153)
Truncated. see log file for complete stacktrace
>
_______________________________________________
Mark A. Rabick
Software Engineer
Northrop Grumman - Integrated Mission Systems (IS/DSD/IMS)
3200 Samson Way
Bellevue, NE 68123
Ph: (402) 293-7091
Em: mark.rabick_at_ngc.com
Remember PFC Ross A. McGinnis...
http://www.army.mil/medalofhonor/McGinnis/index.html
<
http://www.army.mil/medalofhonor/McGinnis/index.html>
... MA2 Michael A. Monsoor, Lt. Michael P. Murphy, Cpl. Jason
Dunham, SFC Paul Ray Smith and the rest...
http://www.cmohs.org/recipients/most_recent.htm
<
http://www.cmohs.org/recipients/most_recent.htm>