infomas-asl icon indicating copy to clipboard operation
infomas-asl copied to clipboard

Glassfish incompatibility URLHandlersBundleURLConnection

Open darmbrust opened this issue 9 years ago • 7 comments

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 avatar Feb 03 '16 17:02 darmbrust

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.

darmbrust avatar Feb 04 '16 03:02 darmbrust

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!

rmuller avatar Feb 04 '16 06:02 rmuller

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 avatar Feb 04 '16 13:02 darmbrust

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.

darmbrust avatar Feb 10 '16 02:02 darmbrust

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

Thanks anyway. Great addition!

rmuller avatar Feb 10 '16 07:02 rmuller

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.

rmuller avatar Feb 19 '16 09:02 rmuller

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.

darmbrust avatar Feb 20 '16 04:02 darmbrust