Hi,
I am currently evaluating Glassfish 3.1.1 and JBoss 7.0.0 as an application
server to migrate to from JBoss 5.1.0. Initially looking from outside of the
container, I'm trying to establish what deployable types can be deployed to
them via Cargo.
I'm a newbie to J2EE concepts EJB, OSGI, etc, so I'm using some very basic
quick start samples from the JBoss archive to test the water. Of course I'm
taking out any JBoss dependencies and replacing where appropriate with
container agnostic ones. I was able to deploy a web application quite easily.
However, now I'm looking at an OSGI example, and trying to deploy a simple
bundle. I have hit an error when deploying to Glassfish. The messages I get
from Glassfish are
[#|2011-09-29T11:09:48.241+0100|INFO|glassfish3.1.1|org.hibernate.validator.engine.resolver.DefaultTraversableResolver|_ThreadID=17;_ThreadName=Thread-2;|Instantiated
an instance of
org.hibernate.validator.engine.resolver.JPATraversableResolver.|#]
[#|2011-09-29T11:09:48.585+0100|SEVERE|glassfish3.1.1|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=17;_ThreadName=Thread-2;|Module
type not recognized for module
C:\SAA\Reims\glassfish3\glassfish\domains\domain1\applications\HelloWorld-OSGI-0.0.1-SNAPSHOT|#]
[#|2011-09-29T11:09:48.585+0100|SEVERE|glassfish3.1.1|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=17;_ThreadName=Thread-2;|There
is no installed container capable of handling this application
HelloWorld-OSGI-0.0.1-SNAPSHOT|#]
My Eclipse project contains source for a Bundle Activator, which outputs some
messages in the start and stop methods. I'm using m2Eclipse plugin to manage
all the dependencies and packaging. The jar gets built and the jar contains a
Manifest, Pom (properties and xml) and the Activator class.
Manifest-Version: 1.0 Built-By: ejr Tool: Bnd-1.15.0 Bundle-Name: Hellow
World OSGI Created-By: Apache Maven Bundle Plugin Bundle-Version:
0.0.1.SNAPSHOT Build-Jdk: 1.6.0_27 Bnd-LastModified: 1317226263623
Bundle-ManifestVersion: 2 Bundle-Activator:
org.jboss.as.quickstarts.helloworld.osgi.Activator Bundle-Description: Hellow
World OSGI Activator Import-Package: org.osgi.framework;version="[1.5,2)"
Bundle-SymbolicName: HelloWorld-OSGI
The pom I'm using contains
<
project xmlns=/"
http://maven.apache.org/POM/4.0.0"
xmlns:xsi=/"
http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=/"
http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>HelloWorld-OSGI</groupId>
<artifactId>HelloWorld-OSGI</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>Hellow</name>
<description>Hellow</description>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven</artifactId>
<version>2.3.4</version>
<extensions>true</extensions>
<configuration>
<instructions>
<!-- OSGi Manifest Metadata is specified here -->
<!-- The Bundle SymbolicName is the same as the artifact ID -->
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
the Bundle is started -->
<!-- Specify the Bundle activator, which is invoked when
<Bundle-Activator>org.jboss.as.quickstarts.helloworld.osgi.Activator</Bundle-Activator>
<!-- Automatically compute all the necessary Import-Package statements -->
<Import-Package>*</Import-Package>
<!-- This bundle does not export any packages -->
<Export-Package/>
need to be listed as Private-Package -->
<!-- Packages that are not exported but need to be included
<Private-Package>org.jboss.as.quickstarts.helloworld.osgi</Private-Package>
</instructions>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven</artifactId>
<version>2.3.1</version>
<configuration>
<!-- Java EE 6 needs 1.6 compilation! -->
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>core</artifactId>
<version>4.2.0</version>
</dependency>
</dependencies>
<properties>
<!-- Explicitly declaring the source encoding eliminates the following
message: -->
resources, i.e. build is platform dependent! -->
<!-- [WARNING] Using platform encoding (UTF-8 actually) to copy filtered
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</
</properties>project>
Can anyone explain why Glassfish doesn't want to know about the bundle ?
Many thanks to anyone that shed some light
Thanks
Ed
-compiler-plugin-bundle-plugin World OSGI Activator World OSGI///
--
[Message sent by forum member 'ejroberts']
View Post: http://forums.java.net/node/848290