`
huangxx
  • 浏览: 321743 次
  • 来自: ...
社区版块
存档分类
最新评论

java.lang.IllegalStateException: No resource at cxf

阅读更多

I've put together a simple web service using cxf. I'm using Maven with the
jetty-maven-plugin to run the app.
When I start up, I get this stack trace
every time (see below). However, the web service runs fine even with all
this noise. For the life of me I can't figure out what is causing it. Any
ideas?

Lorg/apache/cxf/Bus;
2009-12-18 20:48:51.807:WARN::EXCEPTION
java.lang.IllegalStateException: No resource at
org.apache.cxf.jaxws.context.WebServiceContextResourceResolver/bus
at
org.eclipse.jetty.annotations.ResourceAnnotationHandler.handleField(ResourceAnnotationHandler.java:166)
at
org.eclipse.jetty.annotations.AnnotationParser$MyClassVisitor$3$1.visitEnd(AnnotationParser.java:375)
at org.objectweb.asm.ClassReader.a(Unknown Source)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
at
org.eclipse.jetty.annotations.AnnotationParser.scanClass(AnnotationParser.java:596)
at
org.eclipse.jetty.annotations.AnnotationParser.access$000(AnnotationParser.java:43)
at
org.eclipse.jetty.annotations.AnnotationParser$2.processEntry(AnnotationParser.java:576)
at org.eclipse.jetty.webapp.JarScanner.matched(JarScanner.java:152)
at
org.eclipse.jetty.util.PatternMatcher.matchPatterns(PatternMatcher.java:82)
at org.eclipse.jetty.util.PatternMatcher.match(PatternMatcher.java:64)
at org.eclipse.jetty.webapp.JarScanner.scan(JarScanner.java:75)
at
org.eclipse.jetty.annotations.AnnotationParser.parse(AnnotationParser.java:588)
at
org.eclipse.jetty.annotations.AbstractConfiguration.parseWebInfLib(AbstractConfiguration.java:107)
at
org.eclipse.jetty.annotations.AnnotationConfiguration.configure(AnnotationConfiguration.java:68)
at
org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:975)
at
org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:586)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:349)
at
org.mortbay.jetty.plugin.JettyWebAppContext.doStart(JettyWebAppContext.java:102)
at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
at
org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:165)
at
org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:162)
at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
at
org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:165)
at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
at
org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:92)
at org.eclipse.jetty.server.Server.doStart(Server.java:228)
at org.mortbay.jetty.plugin.JettyServer.doStart(JettyServer.java:69)
at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
at
org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:433)
at
org.mortbay.jetty.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:377)
at org.mortbay.jetty.plugin.JettyRunMojo.execute(JettyRunMojo.java:546)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:512)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:482)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
2009-12-18 20:48:52.026:WARN::EXCEPTION
java.lang.IllegalStateException: No resource at cxf

 

 

http://mail-archives.apache.org/mod_mbox/cxf-users/200912.mbox/%3C26855937.post@talk.nabble.com%3E

 

Answered my own question. Here's the solution for anyone else who might run
into this.  This has to do with Jetty's Annotation processor and the 2.5
servlet spec.


You need to tell Jetty not to scan the application and process annotations
by adding the metadata-complete attribute to the web-app element of your
web.xml, as in:

<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
metadata-complete="true" version="2.5">


Without this attribute or if it's set to false, Jetty will attempt to
process annotations and it will cause a lot of noise in your logs (unless of
course you need it). Note that this does not apply or occur in servlet spec
2.4.

More info at http://docs.codehaus.org/display/JETTY/Annotations
--
View this message in context: http://old.nabble.com/java.lang.IllegalStateException%3A-No-resource-at-cxf-tp26852074p26855937.html
Sent from the cxf-user mailing list archive at Nabble.com.

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics