Announcement Announcement Module
Collapse
No announcement yet.
I run -javaagent:spring-agent.jar but spring tell me this:Must start with Java agent Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • I run -javaagent:spring-agent.jar but spring tell me this:Must start with Java agent

    I start jetty6 by this:

    Code:
    # java -javaagent:spring-agent.jar -jar start.jar
    In contetext i have this:
    Code:
    <context:load-time-weaver weaver-class="org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver"/>
    But spring throw this exception:
    Code:
    008-02-20 15:51:57.763::WARN:  Failed startup of context org.mortbay.jetty.plugin.Jetty6PluginWebAppContext@2d2ce574{/webclient,/home/benzin/work/java/jhasevid/webclient/src/main/webapp}
    org.mortbay.util.MultiException[javax.servlet.ServletException: java.lang.IllegalStateException: Must start with Java agent to use InstrumentationLoadTimeWeaver. See Spring documentation., javax.servlet.ServletException: java.lang.IllegalStateException: Must start with Java agent to use InstrumentationLoadTimeWeaver. See Spring documentation.]
            at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:583)
            at org.mortbay.jetty.servlet.Context.startContext(Context.java:139)
            at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1220)
            at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:510)
            at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448)
            at org.mortbay.jetty.plugin.Jetty6PluginWebAppContext.doStart(Jetty6PluginWebAppContext.java:110)
            at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
            at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)
            at org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:156)
            at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
            at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)
            at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
            at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117)
            at org.mortbay.jetty.Server.doStart(Server.java:222)
            at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
            at org.mortbay.jetty.plugin.Jetty6PluginServer.start(Jetty6PluginServer.java:132)
            at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:357)
            at org.mortbay.jetty.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:293)
            at org.mortbay.jetty.plugin.AbstractJettyRunMojo.execute(AbstractJettyRunMojo.java:203)
            at org.mortbay.jetty.plugin.Jetty6RunMojo.execute(Jetty6RunMojo.java:182)
            at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:447)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:493)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:463)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
            at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:333)
            at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:126)
            at org.apache.maven.cli.MavenCli.main(MavenCli.java:282)
            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:597)
            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)
    javax.servlet.ServletException: java.lang.IllegalStateException: Must start with Java agent to use InstrumentationLoadTimeWeaver. See Spring documentation.
            at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:437)
            at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:256)
            at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
            at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:612)
            at org.mortbay.jetty.servlet.Context.startContext(Context.java:139)
            at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1220)
            at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:510)
            at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448)
            at org.mortbay.jetty.plugin.Jetty6PluginWebAppContext.doStart(Jetty6PluginWebAppContext.java:110)
            at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
            at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)
            at org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:156)
            at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
            at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)
            at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
            at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117)
            at org.mortbay.jetty.Server.doStart(Server.java:222)
            at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
            at org.mortbay.jetty.plugin.Jetty6PluginServer.start(Jetty6PluginServer.java:132)
            at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:357)
            at org.mortbay.jetty.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:293)
            at org.mortbay.jetty.plugin.AbstractJettyRunMojo.execute(AbstractJettyRunMojo.java:203)
            at org.mortbay.jetty.plugin.Jetty6RunMojo.execute(Jetty6RunMojo.java:182)
            at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:447)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:493)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:463)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
            at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:333)
            at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:126)
            at org.apache.maven.cli.MavenCli.main(MavenCli.java:282)
            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:597)
            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)
    Caused by: java.lang.IllegalStateException: Must start with Java agent to use InstrumentationLoadTimeWeaver. See Spring documentation.
            at org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver.getInstrumentation(InstrumentationLoadTimeWeaver.java:110)
            at org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver.addTransformer(InstrumentationLoadTimeWeaver.java:71)
            at org.springframework.context.weaving.AspectJWeavingEnabler.postProcessBeanFactory(AspectJWeavingEnabler.java:61)
            at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:542)
            at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:525)
            at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:348)
            at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:261)
            at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
            at org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:81)
            at javax.servlet.GenericServlet.init(GenericServlet.java:241)
            at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:433)
            ... 40 more

    But I start java with agent. Where is problem? I use jdk-1.6.

    Can it be blocked by security permision? Haw can I switch of this?
Working...
X