Announcement Announcement Module
Collapse
No announcement yet.
Maven-2 JAXB-2.x Plugin causes Roo InvocationTargetException Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Maven-2 JAXB-2.x Plugin causes Roo InvocationTargetException

    After adding the following plug-in to my Roo 1.2 project, roo crashes and becomes unresponsive. The error that shows up is:

    InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(NativeMethod).

    Here is the XML that is put into the POM. Any ideas?

    Code:
    <plugin>
       <groupId>org.jvnet.jaxb2.maven2</groupId>
       <artifactId>maven-jaxb2-plugin</artifactId>
       <executions>
          <execution>
             <goals>
                <goal>generate</goal>
             </goals>
          </execution>
       </executions>
       <configuration>
          <extension>true</extension>
          <schemaDirectory>${basedir}/src/schema</schemaDirectory>               
          <generateDirectory>${basedir}/src/main/jaxb</generateDirectory>
          <generatePackage>com.kaplansoftware.digitalguides.model</generatePackage>
          <removeOldOutput>true</removeOldOutput>            
       </configuration>
    </plugin>

  • #2
    Add &lt;version&gt; element to the &lt;plugin&gt;

    I encountered the same problem, it was resolved by adding the <version> element to the <plugin>.

    If you launch roo with -DdevelopmentMode=true (edited roo.cmd/roo.sh), you will get a full stack trace which identified the cause of the problem:

    Code:
    java.lang.reflect.InvocationTargetException
                             at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
                             at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
                             at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
                             at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
                             at org.springframework.roo.project.maven.PomFactoryImpl.parseElements(PomFactoryImpl.java:100)
                             at org.springframework.roo.project.maven.PomFactoryImpl.getInstance(PomFactoryImpl.java:68)
                             at org.springframework.roo.project.PomManagementServiceImpl.parseUnparsedPoms(PomManagementServiceImpl.java:166)
                             at org.springframework.roo.project.PomManagementServiceImpl.updatePomCache(PomManagementServiceImpl.java:140)
                             at org.springframework.roo.project.PomManagementServiceImpl.getModuleForFileIdentifier(PomManagementServiceImpl.java:68)
                             at org.springframework.roo.project.AbstractProjectOperations.getModuleForFileIdentifier(AbstractProjectOperations.java:854)
                             at org.springframework.roo.classpath.TypeLocationServiceImpl.getProposedJavaType(TypeLocationServiceImpl.java:442)
                             at org.springframework.roo.classpath.TypeLocationServiceImpl.doesPathIndicateJavaType(TypeLocationServiceImpl.java:405)
                             at org.springframework.roo.classpath.TypeLocationServiceImpl.getPhysicalTypeIdentifier(TypeLocationServiceImpl.java:150)
                             at org.springframework.roo.classpath.DefaultPhysicalTypeMetadataProvider.onFileEvent(DefaultPhysicalTypeMetadataProvider.java:91)
                             at org.springframework.roo.file.monitor.polling.PollingFileMonitorService.publish(PollingFileMonitorService.java:350)
                             at org.springframework.roo.file.monitor.polling.PollingFileMonitorService.scanAll(PollingFileMonitorService.java:323)
                             at org.springframework.roo.process.manager.internal.MonitoringRequestCommand.callback(MonitoringRequestCommand.java:36)
                             at org.springframework.roo.process.manager.internal.MonitoringRequestCommand.callback(MonitoringRequestCommand.java:14)
                             at org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(DefaultProcessManager.java:183)
                             at org.springframework.roo.process.manager.internal.DefaultProcessManager.completeStartup(DefaultProcessManager.java:105)
                             at org.springframework.roo.process.manager.internal.DefaultProcessManager.access$100(DefaultProcessManager.java:35)
                             at org.springframework.roo.process.manager.internal.DefaultProcessManager$1.frameworkEvent(DefaultProcessManager.java:58)
                             at org.apache.felix.framework.util.EventDispatcher.invokeFrameworkListenerCallback(EventDispatcher.java:774)
                             at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:725)
                             at org.apache.felix.framework.util.EventDispatcher.run(EventDispatcher.java:949)
                             at org.apache.felix.framework.util.EventDispatcher.access$000(EventDispatcher.java:54)
                             at org.apache.felix.framework.util.EventDispatcher$1.run(EventDispatcher.java:106)
                             at java.lang.Thread.run(Thread.java:662)
                         Caused by: java.lang.IllegalArgumentException: Version is required
                             at org.springframework.roo.support.util.Assert.hasText(Assert.java:162)
                             at org.springframework.roo.project.GAV.<init>(GAV.java:47)
                             at org.springframework.roo.project.Plugin.<init>(Plugin.java:187)
                             at org.springframework.roo.project.Plugin.<init>(Plugin.java:159)
                             ... 28 more

    Comment

    Working...
    X