evgeny-goldin / maven-plugins

Maven plugins
http://evgeny-goldin.com/wiki/Maven_Plugins
Other
52 stars 62 forks source link

NullPointerException in 0.2.3.5 works in 0.2.3.4 #3

Closed sgunapu closed 12 years ago

sgunapu commented 12 years ago

ERROR

java.lang.NullPointerException at com.sun.beans.TypeResolver.resolve(TypeResolver.java:321) at com.sun.beans.TypeResolver.resolve(TypeResolver.java:303) at com.sun.beans.TypeResolver.resolve(TypeResolver.java:351) at com.sun.beans.TypeResolver.resolve(TypeResolver.java:172) at com.sun.beans.TypeResolver.resolveInClass(TypeResolver.java:93) at java.beans.FeatureDescriptor.getParameterTypes(FeatureDescriptor.java:387) at java.beans.MethodDescriptor.setMethod(MethodDescriptor.java:114) at java.beans.MethodDescriptor.(MethodDescriptor.java:72) at java.beans.MethodDescriptor.(MethodDescriptor.java:56) at java.beans.Introspector.getTargetMethodInfo(Introspector.java:1150) at java.beans.Introspector.getBeanInfo(Introspector.java:433) at java.beans.Introspector.getBeanInfo(Introspector.java:174) at groovy.lang.MetaClassImpl$14.run(MetaClassImpl.java:2927) at java.security.AccessController.doPrivileged(Native Method) at groovy.lang.MetaClassImpl.addProperties(MetaClassImpl.java:2925) at groovy.lang.MetaClassImpl.initialize(MetaClassImpl.java:2908) at org.codehaus.groovy.reflection.ClassInfo.getMetaClassUnderLock(ClassInfo.java:166) at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:182) at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.getMetaClass(MetaClassRegistryImpl.java:242) at org.codehaus.groovy.runtime.InvokerHelper.getMetaClass(InvokerHelper.java:751) at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallStaticSite(CallSiteArray.java:59) at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallSite(CallSiteArray.java:146) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120) at com.goldin.gcommons.beans.GeneralBean.array(GeneralBean.groovy:134) at com.goldin.gcommons.beans.GeneralBean$array.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124) at com.goldin.plugins.copy.CopyMojo.resources(CopyMojo.groovy:117) at com.goldin.plugins.copy.CopyMojo.execute(CopyMojo.groovy:181)

PLUGIN CONF

com.goldin.plugins maven-copy-plugin 0.2.3.5-SNAPSHOT create-archive package copy ``` ${targetDir}/package/${finalName}.war ${targetDir}/${finalName}.war target/${finalName}.zip ${targetDir}/package true true
evgeny-goldin commented 12 years ago

Does it happen if you use version "0.2.3.5-beta-5" ? That's a "0.2.3.5" RC.

I don't trust snapshots - it's hard to know for sure you have the latest one unless you say local Maven repo was explicitly cleaned up and snapshot was re-downloaded. Also, what does "about" file of this snapshot say? It's located at "maven-copy-plugin-0.2.3.5-SNAPSHOT.jar/META-INF/about~com.goldin.plugins~maven-copy-plugin~0.2.3.5-SNAPSHOT.txt". Thanks!

sgunapu commented 12 years ago

yes..happens on all .5 versions. just tried 0.2.3.5-beta-5 using jdk 1.6x32 & 1.7x64 with same results. If i go back to 0.2.3.4, it works ok.

evgeny-goldin commented 12 years ago

Hmm .. that looks like a Groovy issue to me - last line in my code according to the stack trace is this one and it's a simple "if ( array != null )" that didn't change for ages.

I think I'll need your help to troubleshoot this. Could you, please, try the following:

I wonder what Groovy version will be downloaded, it should be "org.codehaus.groovy:groovy-all:1.8.2". Also, will you be able to reproduce this error with a sample POM and attach it to the issue as well? (specifying your OS, Maven and Java versions). I'm almost sure it is something about your environment, hope we'll be able to find it out.

evgeny-goldin commented 12 years ago

Also, what happens if you clone this project and try to run it with Maven 3? That's plugins tests suite and it works with Java 6 x86, Maven 2 / Maven 3 on Mac, Linux and Windows. You can also run it with Maven 2 but then you need to specify "-Dmaven-version=2" on the command line to override the default.

sgunapu commented 12 years ago

https://gist.github.com/1347181 It does get groovy 1.8.2. same error with maven 3.0.3 and the unit tests as well.

sgunapu commented 12 years ago

related issue? http://jira.codehaus.org/browse/GROOVY-5034

evgeny-goldin commented 12 years ago

Aha, that may be the case. Are you on OpenJDK? I can't switch to Groovy 1.8.3 yet - GContracts I rely on heavily doesn't work with it. May be that means for you to stay with "0.2.3.4" and I'll find a solution for GContracts and switch to Groovy 1.8.3 for "0.3", that'll be the next plugins version. Probably, it will only support Maven 3.

evgeny-goldin commented 12 years ago

Just for the test, can you try out the following versions?

If one of them works you can get at least part of "0.2.3.5" fixes.

sgunapu commented 12 years ago

0.2.3.4-about-fix works..all .5's fail.

given the following resource config, since failIfNotFound is false, i expect no errors if the source file is not found. With .4 version, i get "C:\data\cvs\biztier\test\src\main\db\environments\user] does not exist". Is this fixed in .5 ?

<resource> <<failIfNotFound>false</failIfNotFound> <targetPath>${targetDir}/package/db/environments</targetPath> <file>src/main/db/environments/user/user.properties</file> <filtering>true</filtering> </resource>

evgeny-goldin commented 12 years ago

Good catch! Initially, <failIfNotFound> was supposed to take care of situations when there are no files matching include/exclude pattern. Like when one says ".txt" but there are no ".txt" files. It was failing if directory specified didn't exist either, as in your case which is now fixed and here's the test.

evgeny-goldin commented 12 years ago

Opened http://evgeny-goldin.org/youtrack/issue/pl-565 for original issue.

evgeny-goldin commented 12 years ago

Can you try "0.2.3.8-SNAPSHOT" ?

evgeny-goldin commented 12 years ago

Fixed in version "0.2.3.8-beta-5".