rmuller / infomas-asl

Open sourced code of the INFOMAS PIM Application Suite
Apache License 2.0
121 stars 37 forks source link

Glassfish incompatibility URLHandlersBundleURLConnection #31

Open darmbrust opened 8 years ago

darmbrust commented 8 years ago

Hi - I ran into this, when trying to use the annotation scanner from within GlassFish 4.1.1.

java.lang.ClassCastException: org.apache.felix.framework.URLHandlersBundleURLConnection cannot be cast to java.net.JarURLConnection at eu.infomas.annotation.AnnotationDetector.detect(AnnotationDetector.java:287)

I'm going to see if I can come up with a patch - unless you have already noticed this / have a patch pending release.

darmbrust commented 8 years ago

FYI, I believe I have a fix for this. I've run into some other issues deploying on GlassFish, however, and want to ensure that my patch isn't related to the issues I'm still tracking down before send a pull request.

rmuller commented 8 years ago

Hi Dan, thanks for reporting.

I just checked my sample web app for testing the annotation detector with GlassFish 4.1.1 and everything works fine here. So can you please give some more information about this issue. I see you are using OSGi? Also see #29 and #30.

BTW Which version are you using? (I checked with 3.0.5 from maven central)

Thanks in advance, your patch is more than welcome!

darmbrust commented 8 years ago

That is interesting.... I'm not using any osgi - but maybe there is a setting somewhere I can change to get it to operate the way it is in your sample app?
Interestingly enough, I'm running into some sort of classloading bug within GlassFish that could also be related to OSGI.

darmbrust commented 8 years ago

Anything I can do to fix the checkstyle issue? I don't understand why it is complaining or the value of the rule that is being violated. Other than that, the patch (comprised of two commits https://github.com/rmuller/infomas-asl/pull/32 ) should be ready / safe to apply.

rmuller commented 8 years ago

No, I will commit the fix asap. However, i am extremely busy so give me a few days.

Thanks anyway. Great addition!

rmuller commented 8 years ago

Integrated your pull request. Thanks again. Also added a simple test webapp. I am not able to reproduce your issue. Also checked with GF 4.1.1 Full Profile. I start the app from within Netbeans. Please check the changes.

darmbrust commented 8 years ago

Thanks. Will do. I had the issue when I was deploying my app from within a war file, just using the GlassFish GUI. Not sure when/why/what config will make glassfish nest the jar files inside that URLHandlersBundleURLConnection.