Uploaded image for project: 'TomEE'
  1. TomEE
  2. TOMEE-2584 Java 11 compliancy
  3. TOMEE-2619

Eliminate "Can not attach to current VM" exception

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 8.0.0-Final
    • None
    • None

    Description

      Several examples experience issues getting the openejb-javaagent installed.  To reproduce run the example

      • examples/application-composer/

      The example will pass, but it does print out the following output which is not acceptable for a Final release.  If there is a known issue, we need a clearer error message and some documentation.

       

       

      INFO - Assembling app: /Users/dblevins/work/apache/tomee/examples/application-composer/MoviesTest
      java.lang.IllegalStateException: Unable to initialize agent
       at org.apache.openejb.javaagent.Agent.checkInitialization(Agent.java:104)
       at org.apache.openejb.javaagent.Agent.getInstrumentation(Agent.java:94)
       at org.apache.openejb.assembler.classic.Assembler$PersistenceClassLoaderHandlerImpl.addTransformer(Assembler.java:3782)
       at org.apache.openejb.persistence.PersistenceUnitInfoImpl.addTransformer(PersistenceUnitInfoImpl.java:337)
       at org.apache.openjpa.persistence.PersistenceProviderImpl.createContainerEntityManagerFactory(PersistenceProviderImpl.java:172)
       at org.apache.openjpa.persistence.PersistenceProviderImpl.createContainerEntityManagerFactory(PersistenceProviderImpl.java:63)
       at org.apache.openejb.assembler.classic.EntityManagerFactoryCallable.call(EntityManagerFactoryCallable.java:112)
       at org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createDelegate(ReloadableEntityManagerFactory.java:134)
       at org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.<init>(ReloadableEntityManagerFactory.java:105)
       at org.apache.openejb.assembler.classic.PersistenceBuilder.createEntityManagerFactory(PersistenceBuilder.java:157)
       at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:918)
       at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:758)
       at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:754)
       at org.apache.openejb.testing.ApplicationComposers.deployApp(ApplicationComposers.java:724)
       at org.apache.openejb.testing.ApplicationComposers.before(ApplicationComposers.java:386)
       at org.apache.openejb.testing.ApplicationComposers.evaluate(ApplicationComposers.java:1068)
       at org.apache.openejb.junit.DeployApplication.evaluate(DeployApplication.java:40)
       at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
       at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
       at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
       at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
       at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
       at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
       at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
       at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
       at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
       at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
       at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
       at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
       at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
       at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.base/java.lang.reflect.Method.invoke(Method.java:566)
       at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
       at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
       at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
       at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
       at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
      Caused by: java.lang.reflect.InvocationTargetException
       at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
       at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.base/java.lang.reflect.Method.invoke(Method.java:566)
       at org.apache.openejb.javaagent.Agent.dynamicLoadAgent(Agent.java:151)
       at org.apache.openejb.javaagent.Agent.checkInitialization(Agent.java:102)
       ... 37 more
      Caused by: java.io.IOException: Can not attach to current VM
       at jdk.attach/sun.tools.attach.HotSpotVirtualMachine.<init>(HotSpotVirtualMachine.java:75)
       at jdk.attach/sun.tools.attach.VirtualMachineImpl.<init>(VirtualMachineImpl.java:56)
       at jdk.attach/sun.tools.attach.AttachProviderImpl.attachVirtualMachine(AttachProviderImpl.java:58)
       at jdk.attach/com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:207)
       ... 43 more
      INFO - JAVA AGENT NOT INSTALLED. The JPA Persistence Provider requested installation of a ClassFileTransformer which requires a JavaAgent.  See http://tomee.apache.org/javaagent.html
      

       

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            dblevins David Blevins
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: