Thanks Rick! That's working a treat for me now. Jon
On Mon, Aug 30, 2010 at 3:43 PM, Rick McGuire <[email protected]> wrote: > On 8/30/2010 9:18 AM, Jonathan Gallimore wrote: > >> I committed the patch to fix the first error below (r990794). I managed to >> get past the second error by changing the packaging in the openejb-osgi >> module pom to 'jar' from 'bundle'. However, although the generate >> META-INF/MANIFEST.MF looks ok to me, I don't really understand exactly >> what's going on here, or what the potential impact would be so I don't >> want >> to just commit this change. >> >> Does anyone with any knowledge on the Maven BND stuff have any thoughts on >> what's going on here? >> > > I just committed to changes to fix this build problem. I removed all of > the Required-Bundle stuff and allowed bnd to figure out what the required > imports are. > > Rick > > > > Is there a good test for the OSGi stuff (taking some of our artifacts and >> deploying them in Felix perhaps) - I think I recall Jacek putting some >> information on the list a while back, I'll have to fish out my notes. >> >> Jon >> >> On Mon, Aug 30, 2010 at 1:10 PM, Jonathan Gallimore< >> [email protected]> wrote: >> >> Hi All, >>> >>> I'm getting a couple of build errors around the Spring and OSGi stuff. >>> I'm >>> building a clean checkout without any changes. I'll have a look at this >>> and >>> see if I can fix it, but the OSGi stuff usually leaves my brain hurting, >>> so >>> I'd be grateful for any pointers! >>> >>> [INFO] >>> ------------------------------------------------------------------------ >>> [INFO] Building OpenEJB :: Container :: Spring >>> [INFO] task-segment: [clean, install] >>> [INFO] >>> ------------------------------------------------------------------------ >>> [INFO] [clean:clean {execution: default-clean}] >>> [INFO] Deleting file set: >>> /Users/jon/dev/openejb-svn/openejb3/container/openejb-spring/target >>> (included: [**], excluded: []) >>> [INFO] [remote-resources:process {execution: default}] >>> [WARNING] org.apache.velocity.runtime.exception.ReferenceException: >>> reference : template = META-INF/DEPENDENCIES.vm [line 40,column 14] : $ >>> license.name is not a valid reference. >>> [WARNING] org.apache.velocity.runtime.exception.ReferenceException: >>> reference : template = META-INF/DEPENDENCIES.vm [line 40,column 14] : $ >>> license.name is not a valid reference. >>> [INFO] [resources:resources {execution: default-resources}] >>> [INFO] Using 'UTF-8' encoding to copy filtered resources. >>> [INFO] Copying 0 resource >>> [INFO] Copying 3 resources >>> [INFO] [dependency:copy {execution: copy}] >>> [INFO] Configured Artifact: >>> org.apache.openejb:openejb-javaagent:3.2-SNAPSHOT:jar >>> [INFO] Copying openejb-javaagent-3.2-SNAPSHOT.jar to >>> >>> /Users/jon/dev/openejb-svn/openejb3/container/openejb-spring/target/openejb-javaagent-3.2-SNAPSHOT.jar >>> [INFO] [compiler:compile {execution: default-compile}] >>> [INFO] Compiling 24 source files to >>> >>> /Users/jon/dev/openejb-svn/openejb3/container/openejb-spring/target/classes >>> [INFO] >>> ------------------------------------------------------------------------ >>> [ERROR] BUILD FAILURE >>> [INFO] >>> ------------------------------------------------------------------------ >>> [INFO] Compilation failure >>> >>> /Users/jon/dev/openejb-svn/openejb3/container/openejb-spring/src/main/java/org/apache/openejb/spring/AbstractApplication.java:[112,78] >>> incompatible types >>> found : org.apache.openejb.core.AppContext >>> required: java.util.List<org.apache.openejb.DeploymentInfo> >>> >>> >>> and if I fix this with this patch: >>> >>> Index: >>> >>> container/openejb-spring/src/main/java/org/apache/openejb/spring/AbstractApplication.java >>> =================================================================== >>> --- >>> container/openejb-spring/src/main/java/org/apache/openejb/spring/AbstractApplication.java >>> (revision >>> 990666) >>> +++ >>> container/openejb-spring/src/main/java/org/apache/openejb/spring/AbstractApplication.java >>> (working >>> copy) >>> @@ -29,6 +29,7 @@ >>> >>> import org.apache.openejb.DeploymentInfo; >>> import org.apache.openejb.OpenEJBException; >>> +import org.apache.openejb.core.AppContext; >>> import org.apache.openejb.core.CoreDeploymentInfo; >>> import org.apache.openejb.assembler.classic.AppInfo; >>> import org.apache.openejb.assembler.classic.Assembler; >>> @@ -109,7 +110,8 @@ >>> Assembler assembler = getAssembler(); >>> for (AppInfo appInfo : appInfos) { >>> try { >>> - List<DeploymentInfo> deployments = >>> assembler.createApplication(appInfo, >>> assembler.createAppClassLoader(appInfo), true); >>> + AppContext appContext = >>> assembler.createApplication(appInfo, >>> assembler.createAppClassLoader(appInfo), true); >>> + List<DeploymentInfo> deployments = appContext.getDeployments(); >>> if (export) { >>> for (DeploymentInfo deployment : deployments) { >>> JndiNameStrategy strategy = >>> createStrategy(appInfo, deployments, deployment); >>> >>> >>> I then get another error: >>> >>> [WARNING] Warning building bundle >>> org.apache.openejb:openejb-core-osgi:bundle:3.2-SNAPSHOT : Bundle uses >>> Require Bundle, this can generate false errors because then not enough >>> information is available without the required bundles >>> [ERROR] Error building bundle >>> org.apache.openejb:openejb-core-osgi:bundle:3.2-SNAPSHOT : Unresolved >>> references to [org.apache.openejb.core] by class(es) on the >>> Bundle-Classpath[Jar:dot]: >>> [org/apache/openejb/core/osgi/impl/Deployer.class] >>> >>> Full log below: >>> >>> Jonathan-Gallimores-MacBook-Pro:openejb-osgi jon$ mvn -Dassemble >>> -Dmaven.test.skip=true clean install >>> [INFO] Scanning for projects... >>> [INFO] >>> ------------------------------------------------------------------------ >>> [INFO] Building OpenEJB :: Container :: Core :: OSGi >>> [INFO] task-segment: [clean, install] >>> [INFO] >>> ------------------------------------------------------------------------ >>> [INFO] [clean:clean {execution: default-clean}] >>> [INFO] Deleting file set: >>> /Users/jon/dev/openejb-svn/openejb3/container/openejb-osgi/target >>> (included: >>> [**], excluded: []) >>> [INFO] snapshot org.apache.openejb:deps:3.2-SNAPSHOT: checking for >>> updates >>> from codehaus-snapshot >>> [INFO] snapshot org.apache.openejb:deps:3.2-SNAPSHOT: checking for >>> updates >>> from apache-m2-snapshot >>> [INFO] snapshot org.apache.openejb:deps:3.2-SNAPSHOT: checking for >>> updates >>> from java.net >>> [INFO] snapshot org.apache.openejb:deps:3.2-SNAPSHOT: checking for >>> updates >>> from apache.snapshots >>> [INFO] Setting property: classpath.resource.loader.class => >>> 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'. >>> [INFO] Setting property: velocimacro.messages.on => 'false'. >>> [INFO] Setting property: resource.loader => 'classpath'. >>> [INFO] Setting property: resource.manager.logwhenfound => 'false'. >>> [INFO] [remote-resources:process {execution: default}] >>> [WARNING] org.apache.velocity.runtime.exception.ReferenceException: >>> reference : template = META-INF/DEPENDENCIES.vm [line 40,column 14] : $ >>> license.name is not a valid reference. >>> [WARNING] org.apache.velocity.runtime.exception.ReferenceException: >>> reference : template = META-INF/DEPENDENCIES.vm [line 40,column 14] : $ >>> license.name is not a valid reference. >>> [INFO] [resources:resources {execution: default-resources}] >>> [INFO] Using 'UTF-8' encoding to copy filtered resources. >>> [INFO] Copying 6 resources >>> [INFO] Copying 1 resource >>> [INFO] Copying 3 resources >>> [INFO] [compiler:compile {execution: default-compile}] >>> [INFO] Compiling 2 source files to >>> /Users/jon/dev/openejb-svn/openejb3/container/openejb-osgi/target/classes >>> [INFO] [dependency-report:report {execution: default}] >>> [INFO] [bundle:manifest {execution: bundle-manifest}] >>> [WARNING] Include-Resource: overriding >>> >>> default.openejb.conf=src/main/resources/default.openejb.conf,logging.properties=src/main/resources/logging.properties,login.config=src/main/resources/login.config,META-INF/org.apache.openejb/service-jar.xml=src/main/resources/META-INF/org.apache.openejb/service-jar.xml,META-INF/services/org/apache/activemq/broker/openejb=src/main/resources/META-INF/services/org/apache/activemq/broker/openejb,openejb-version.properties=src/main/resources/openejb-version.properties,{features.xml=src/main/filtered-resources/features.xml},META-INF/DEPENDENCIES=target/maven-shared-archive-resources/META-INF/DEPENDENCIES,META-INF/LICENSE=target/maven-shared-archive-resources/META-INF/LICENSE,META-INF/NOTICE=target/maven-shared-archive-resources/META-INF/NOTICE >>> with >>> >>> /Users/jon/dev/openejb-svn/openejb3/container/openejb-osgi/src/main/resources >>> (add {maven-resources} if you want to include the maven resources) >>> [INFO] [resources:testResources {execution: default-testResources}] >>> [INFO] Using 'UTF-8' encoding to copy filtered resources. >>> [INFO] skip non existing resourceDirectory >>> >>> /Users/jon/dev/openejb-svn/openejb3/container/openejb-osgi/src/test/resources >>> [INFO] Copying 3 resources >>> [INFO] [compiler:testCompile {execution: default-testCompile}] >>> [INFO] Not compiling test sources >>> [INFO] [surefire:test {execution: default-test}] >>> [INFO] Tests are skipped. >>> [INFO] [bundle:bundle {execution: default-bundle}] >>> [WARNING] Include-Resource: overriding >>> >>> default.openejb.conf=src/main/resources/default.openejb.conf,logging.properties=src/main/resources/logging.properties,login.config=src/main/resources/login.config,META-INF/org.apache.openejb/service-jar.xml=src/main/resources/META-INF/org.apache.openejb/service-jar.xml,META-INF/services/org/apache/activemq/broker/openejb=src/main/resources/META-INF/services/org/apache/activemq/broker/openejb,openejb-version.properties=src/main/resources/openejb-version.properties,{features.xml=src/main/filtered-resources/features.xml},META-INF/DEPENDENCIES=target/maven-shared-archive-resources/META-INF/DEPENDENCIES,META-INF/LICENSE=target/maven-shared-archive-resources/META-INF/LICENSE,META-INF/NOTICE=target/maven-shared-archive-resources/META-INF/NOTICE >>> with >>> >>> /Users/jon/dev/openejb-svn/openejb3/container/openejb-osgi/src/main/resources >>> (add {maven-resources} if you want to include the maven resources) >>> Aug 30, 2010 1:03:29 PM java.util.jar.Attributes read >>> WARNING: Duplicate name in Manifest: Manifest-Version. >>> Ensure that the manifest does not have duplicate entries, and >>> that blank lines separate individual sections in both your >>> manifest and in the META-INF/MANIFEST.MF entry in the jar file. >>> Aug 30, 2010 1:03:29 PM java.util.jar.Attributes read >>> WARNING: Duplicate name in Manifest: Created-By. >>> Ensure that the manifest does not have duplicate entries, and >>> that blank lines separate individual sections in both your >>> manifest and in the META-INF/MANIFEST.MF entry in the jar file. >>> Aug 30, 2010 1:03:29 PM java.util.jar.Attributes read >>> WARNING: Duplicate name in Manifest: Built-By. >>> Ensure that the manifest does not have duplicate entries, and >>> that blank lines separate individual sections in both your >>> manifest and in the META-INF/MANIFEST.MF entry in the jar file. >>> Aug 30, 2010 1:03:29 PM java.util.jar.Attributes read >>> WARNING: Duplicate name in Manifest: Build-Jdk. >>> Ensure that the manifest does not have duplicate entries, and >>> that blank lines separate individual sections in both your >>> manifest and in the META-INF/MANIFEST.MF entry in the jar file. >>> Aug 30, 2010 1:03:29 PM java.util.jar.Attributes read >>> WARNING: Duplicate name in Manifest: Specification-Title. >>> Ensure that the manifest does not have duplicate entries, and >>> that blank lines separate individual sections in both your >>> manifest and in the META-INF/MANIFEST.MF entry in the jar file. >>> Aug 30, 2010 1:03:29 PM java.util.jar.Attributes read >>> WARNING: Duplicate name in Manifest: Specification-Version. >>> Ensure that the manifest does not have duplicate entries, and >>> that blank lines separate individual sections in both your >>> manifest and in the META-INF/MANIFEST.MF entry in the jar file. >>> Aug 30, 2010 1:03:29 PM java.util.jar.Attributes read >>> WARNING: Duplicate name in Manifest: Specification-Vendor. >>> Ensure that the manifest does not have duplicate entries, and >>> that blank lines separate individual sections in both your >>> manifest and in the META-INF/MANIFEST.MF entry in the jar file. >>> Aug 30, 2010 1:03:29 PM java.util.jar.Attributes read >>> WARNING: Duplicate name in Manifest: Implementation-Title. >>> Ensure that the manifest does not have duplicate entries, and >>> that blank lines separate individual sections in both your >>> manifest and in the META-INF/MANIFEST.MF entry in the jar file. >>> Aug 30, 2010 1:03:29 PM java.util.jar.Attributes read >>> WARNING: Duplicate name in Manifest: Implementation-Version. >>> Ensure that the manifest does not have duplicate entries, and >>> that blank lines separate individual sections in both your >>> manifest and in the META-INF/MANIFEST.MF entry in the jar file. >>> Aug 30, 2010 1:03:29 PM java.util.jar.Attributes read >>> WARNING: Duplicate name in Manifest: Implementation-Vendor-Id. >>> Ensure that the manifest does not have duplicate entries, and >>> that blank lines separate individual sections in both your >>> manifest and in the META-INF/MANIFEST.MF entry in the jar file. >>> Aug 30, 2010 1:03:29 PM java.util.jar.Attributes read >>> WARNING: Duplicate name in Manifest: Implementation-Vendor. >>> Ensure that the manifest does not have duplicate entries, and >>> that blank lines separate individual sections in both your >>> manifest and in the META-INF/MANIFEST.MF entry in the jar file. >>> [WARNING] Warning building bundle >>> org.apache.openejb:openejb-core-osgi:bundle:3.2-SNAPSHOT : Bundle uses >>> Require Bundle, this can generate false errors because then not enough >>> information is available without the required bundles >>> [ERROR] Error building bundle >>> org.apache.openejb:openejb-core-osgi:bundle:3.2-SNAPSHOT : Unresolved >>> references to [org.apache.openejb.core] by class(es) on the >>> Bundle-Classpath[Jar:dot]: >>> [org/apache/openejb/core/osgi/impl/Deployer.class] >>> [ERROR] Error(s) found in bundle configuration >>> [INFO] >>> ------------------------------------------------------------------------ >>> [ERROR] BUILD ERROR >>> [INFO] >>> ------------------------------------------------------------------------ >>> [INFO] Error(s) found in bundle configuration >>> >>> [INFO] >>> ------------------------------------------------------------------------ >>> [INFO] For more information, run Maven with the -e switch >>> [INFO] >>> ------------------------------------------------------------------------ >>> [INFO] Total time: 8 seconds >>> [INFO] Finished at: Mon Aug 30 13:03:29 BST 2010 >>> [INFO] Final Memory: 52M/106M >>> [INFO] >>> ------------------------------------------------------------------------ >>> >>> >>> Cheers >>> >>> Jon >>> >>> >
