jakartaee / batch

The Jakarta Batch project produces the Batch Specification and API.
https://projects.eclipse.org/projects/ee4j.batch
Apache License 2.0
14 stars 18 forks source link

Fix jakarta.batch-api Bundle-Version format #30

Closed jGauravGupta closed 4 years ago

jGauravGupta commented 4 years ago

- hyphen is not supported in Bundle-Version which results in IllegalArgumentException on Glassfish Server startup.

arjantijms commented 4 years ago

The exception:

Failed to install file:/glassfish/bundles/glassfish6/glassfish/modules/jakarta.batch-api.jar.

Caused by: java.lang.NumberFormatException: For input string: "0-RC1"
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
    at java.lang.Integer.parseInt(Integer.java:580)
    at java.lang.Integer.parseInt(Integer.java:615)
    at org.osgi.framework.Version.parseInt(Version.java:167)
java.lang.IllegalArgumentException: invalid version "2.0.0-RC1": non-numeric "0-RC1"
    at org.osgi.framework.Version.parseInt(Version.java:169)
    at org.osgi.framework.Version.<init>(Version.java:134)
    at org.osgi.framework.Version.valueOf(Version.java:255)
    at org.osgi.framework.Version.parseVersion(Version.java:226)
    at org.apache.felix.framework.util.manifestparser.ManifestParser.<init>(ManifestParser.java:94)
    at org.apache.felix.framework.BundleRevisionImpl.<init>(BundleRevisionImpl.java:118)
    at org.apache.felix.framework.BundleImpl.createRevision(BundleImpl.java:1275)
    at org.apache.felix.framework.BundleImpl.<init>(BundleImpl.java:113)
    at org.apache.felix.framework.Felix.installBundle(Felix.java:3260)
org.osgi.framework.BundleException: Could not create bundle object.
    at org.apache.felix.framework.Felix.installBundle(Felix.java:3312)
    at org.apache.felix.framework.BundleContextImpl.installBundle(BundleContextImpl.java:147)
    at com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner.install(BundleProvisioner.java:420)
    at com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner.installBundles(BundleProvisioner.java:180)
    at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishRuntimeBuilder.build(OSGiGlassFishRuntimeBuilder.java:118)
    at org.glassfish.embeddable.GlassFishRuntime._bootstrap(GlassFishRuntime.java:133)
    at org.glassfish.embeddable.GlassFishRuntime.bootstrap(GlassFishRuntime.java:86)
    at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.launch(GlassFishMain.java:88)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:73)
    at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:30)
rmannibucau commented 4 years ago

+1, maybe time to move to bundle plugin to avoid this kind of issues?

side question: should Specification-Vendor be eclipse now?

scottkurz commented 4 years ago

Thx @jGauravGupta .. if you don't want to merge/update with my changes I can just open a new PR with that branch.

I can release an M2 after we sort this out.

arjantijms commented 4 years ago

@scottkurz thx! We absolutely don't mind about the exact number being used there, as long as it's legal so that GlassFish can startup it's fine ;)

Thx again!

scottkurz commented 4 years ago

@scottkurz thx! We absolutely don't mind about the exact number being used there, as long as it's legal so that GlassFish can startup it's fine ;)

I wonder why GlassFish isn't noticing issues with the com.ibm.jbatch.spi/container bundles (and maybe there are issues I'm not aware of)? Anyway, opened up https://github.com/WASdev/standards.jsr352.jbatch/issues/63 to update these as well.

jGauravGupta commented 4 years ago

Thanks @scottkurz for the suggestion, I updated the PR.

arjantijms commented 4 years ago

@scottkurz

I wonder why GlassFish isn't noticing issues with the com.ibm.jbatch.spi/container bundles

Maybe because the startup didn't get far enough yet to actually use that and/or for the OSGi runtime to validate those bundles.