Java Mailing List Archive

http://www.gg3721.com/

Home » user.groovy »

[groovy-user] MalformedParameterizedTypeException when no modifier on instance variable

ttop123

2008-08-19


Author LoginPost Reply
Ok, I have more information about what was causing the failure I mention below. The three independent projects had very similar refactorings on the same day, so ignore the fact that it happened to multiple projects.

Basically GMaven is puking when I have an instance variable in my class that doesn't have a modifier. Here's an excerpt of one class that's causing the failure:

class TestBaseSpring extends AssertionContextGroovyTestCase {
 protected final static Logger logger = Logger.getLogger(TestBaseSpring.class)
 private final static String HARNESS_BEAN_FILE = "spring-config.xml";
 private final static String LOCAL_BEANS_FILE_DEFAULT = "test-spring-config.xml";
 private final static String ENV_SYSTEM_PROP = "local.beans.filename";


 public static ConfigObject testConfig
 public static ApplicationContext spring

  ManagedDataServiceTestClient<Media> client // this causes the failure

(... etc)

If I give client a modifier, e.g. public/private/protected, it all compiles fine. Why would this be?




-------------- Original message ----------------------
From: ttop123@(protected)
> I have three independent groovy maven-based projects that are failing with the same error. Not really sure why this is happening, there
> is a GMaven build error with the ever-helpful message "null".
>
> If I mvn -e clean package, I get the following stack trace, which doesn't help
> me too much more. Does anyone have any ideas where to go with this?
>
> [INFO] [compiler:testCompile]
> [INFO] Compiling 7 source files to
> /Volumes/ext/depot/myProject/target/test-classes
> [INFO] [groovy:testCompile {execution: default}]
> [INFO] ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] null
>
> [INFO] ------------------------------------------------------------------------
> [INFO] Trace
> org.apache.maven.lifecycle.LifecycleExecutionException
>      at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycl
> eExecutor.java:564)
>      at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(Def
> aultLifecycleExecutor.java:480)
>      at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycle
> Executor.java:459)
>      at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures
> (DefaultLifecycleExecutor.java:311)
>      at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultL
> ifecycleExecutor.java:278)
>      at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExec
> utor.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.jav
> a: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)
> Caused by: org.apache.maven.plugin.MojoExecutionException
>      at
> org.codehaus.groovy.maven.plugin.MojoSupport.execute(MojoSupport.java:85)
>      at
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.ja
> va:447)
>      at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycl
> eExecutor.java:539)
>      ... 16 more
> Caused by: java.lang.reflect.MalformedParameterizedTypeException
>      at
> sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.validateConstructor
> Arguments(ParameterizedTypeImpl.java:42)
>      at
> sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.<init>(Parameterize
> dTypeImpl.java:35)
>      at
> sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.make(ParameterizedT
> ypeImpl.java:77)
>      at
> sun.reflect.generics.factory.CoreReflectionFactory.makeParameterizedType(CoreRef
> lectionFactory.java:86)
>      at
> sun.reflect.generics.visitor.Reifier.visitClassTypeSignature (Reifier.java:122)
>      at
> sun.reflect.generics.tree.ClassTypeSignature.accept (ClassTypeSignature.java:31)
>      at
> sun.reflect.generics.repository.MethodRepository.getReturnType(MethodRepository.
> java:50)
>      at java.lang.reflect.Method.getGenericReturnType (Method.java:231)
>      at
> org.codehaus.groovy.vmplugin.v5.Java5.configureClassNode (Java5.java:161)
>      at org.codehaus.groovy.ast.ClassNode.lazyClassInit (ClassNode.java:209)
>      at
> org.codehaus.groovy.ast.ClassNode.getUnresolvedSuperClass (ClassNode.java:744)
>      at
> org.codehaus.groovy.ast.ClassNode.getUnresolvedSuperClass (ClassNode.java:738)
>      at org.codehaus.groovy.ast.ClassNode.getSuperClass (ClassNode.java:732)
>      at
> org.codehaus.groovy.control.CompilationUnit.sortClasses (CompilationUnit.java:480
> )
>      at
> org.codehaus.groovy.control.CompilationUnit.compile (CompilationUnit.java:453)
>      at
> org.codehaus.groovy.control.CompilationUnit.compile (CompilationUnit.java:417)
>      at
> org.codehaus.groovy.maven.runtime.v15.ClassCompilerFeature$ClassCompilerImpl.com
> pile(ClassCompilerFeature.java:158)
>      at
> org.codehaus.groovy.maven.plugin.compile.AbstractCompileMojo.compile(AbstractCom
> pileMojo.java:200)
>      at
> org.codehaus.groovy.maven.plugin.compile.AbstractCompileMojo.process(AbstractCom
> pileMojo.java:164)
>      at
> org.codehaus.groovy.maven.plugin.ComponentMojoSupport.doExecute(ComponentMojoSup
> port.java:68)
>      at
> org.codehaus.groovy.maven.plugin.compile.TestCompileMojo.doExecute(TestCompileMo
> jo.java:90)
>      at
> org.codehaus.groovy.maven.plugin.MojoSupport.execute(MojoSupport.java:69)
>      ... 18 more
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 7 seconds
> [INFO] Finished at: Mon Aug 18 09:30:35 PDT 2008
> [INFO] Final Memory: 20M/40M
> [INFO] ------------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>   http://xircles.codehaus.org/manage_email
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email


©2008 gg3721.com - Jax Systems, LLC, U.S.A.