You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Florent Métral <fl...@inrialpes.fr> on 2007/11/29 10:51:22 UTC
Accessing Bundle resources through classloader
Hi all,
I'm new in Felix because I used Oscar till now.
I'm trying to convert my Osacr bundles to Felix and get some troubles.
In my bundle, I embedd some resources like one Julia config file.
With oscar, this file was reachable though my classloader using
myClassLoarder.getResourceAsStream(myFile) method.
But with Felix, the result of the previous call is null and I get an
error that exlpains that It can get and open my resource file.
Is there a special way to access bundle resources? Do I have to
declare something special in my manifest?
I use the Maven Bundle Plugin BND to generate my bundle and I'd like
to use the same manifest file than the one I had with oscar:
here are my pom.xml and my manifest files:
<?xml version="1.0" encoding="UTF-8"?><project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.ow2.jasmine.jade.wrapper</groupId>
<artifactId>org.ow2.jasmine.jade.wrapper.joram</artifactId>
<packaging>bundle</packaging>
<name>Joram Server</name>
<version>0.0.1-SNAPSHOT</version>
<description>A Bundle for Joram</description>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>1.1.0-SNAPSHOT</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${pom.artifactId}</Bundle-
SymbolicName>
<_include>-target/classes/META-INF/$
{pom.artifactId}.bnd</_include>
<_include>src/main/resources/META-INF/MANIFEST.MF</
_include>
<Export-Package>org.ow2.jasmine.jade.*</Export-Package>
</instructions>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<inherited>true</inherited>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce-java</id>
<goals>
<goal>enforce</goal>
</goals>
</execution>
</executions>
<configuration>
<rules>
<requireJavaVersion>
<version>1.5</version>
</requireJavaVersion>
</rules>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.objectweb.fractal</groupId>
<artifactId>fractal-api</artifactId>
<version>2.0.2</version>
</dependency>
<dependency>
<groupId>org.objectweb.fractal</groupId>
<artifactId>fscript</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.ow2.jasmine</groupId>
<artifactId>jade</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>org.ow2.jasmine.jade</groupId>
<artifactId>jade-fractal</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>org.objectweb.joram</groupId>
<artifactId>joram-client</artifactId>
<version>5.0.4</version>
</dependency>
<dependency>
<groupId>org.objectweb.joram</groupId>
<artifactId>joram-mom</artifactId>
<version>5.0.4</version>
</dependency>
<dependency>
<groupId>org.objectweb.joram</groupId>
<artifactId>joram-shared</artifactId>
<version>5.0.4</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jms_1.1_spec</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>org.objectweb.fractal.julia</groupId>
<artifactId>julia-runtime</artifactId>
<version>2.5.1</version>
</dependency>
</dependencies>
</project>
Bundle-Name: Joram Server
Import-Package:
org.ow2.jasmine.jade.fractal.adl.attributes,
org.ow2.jasmine.jade.fractal.adl.components,
org.ow2.jasmine.jade.fractal.api.control,
org.ow2.jasmine.jade.fractal.julia,
org.ow2.jasmine.jade.fractal.julia.control.deployment,
org.ow2.jasmine.jade.fractal.julia.control.genericattribute,
org.ow2.jasmine.jade.fractal.julia.control.binding,
org.ow2.jasmine.jade.fractal.julia.control.reversebinding,
org.ow2.jasmine.jade.fractal.julia.control.factory,
org.ow2.jasmine.jade.fractal.julia.control.content,
org.ow2.jasmine.jade.fractal.util,
org.ow2.jasmine.jade.reflex.api.control,
org.objectweb.jasmine.jade.resource,
org.objectweb.jasmine.jade.resource.start,
org.objectweb.jasmine.jade.service,
org.objectweb.jasmine.jade.service.allocator,
org.objectweb.jasmine.jade.service.deployer,
org.objectweb.jasmine.jade.util,
org.objectweb.asm,
org.objectweb.asm.signature,
org.objectweb.fractal.deployment.local.api,
org.objectweb.fractal.adl,
org.objectweb.fractal.adl.arguments,
org.objectweb.fractal.adl.attributes,
org.objectweb.fractal.adl.bindings,
org.objectweb.fractal.adl.comments,
org.objectweb.fractal.adl.components,
org.objectweb.fractal.adl.coordinates,
org.objectweb.fractal.adl.implementations,
org.objectweb.fractal.adl.interfaces,
org.objectweb.fractal.adl.loggers,
org.objectweb.fractal.adl.nodes,
org.objectweb.fractal.adl.types,
org.objectweb.fractal.adl.util,
org.objectweb.fractal.adl.xml,
org.objectweb.fractal.api,
org.objectweb.fractal.api.control,
org.objectweb.fractal.api.factory,
org.objectweb.fractal.api.type,
org.objectweb.fractal.util,
org.objectweb.fractal.julia,
org.objectweb.fractal.julia.asm,
org.objectweb.fractal.julia.control.attribute,
org.objectweb.fractal.julia.control.binding,
org.objectweb.fractal.julia.control.content,
org.objectweb.fractal.julia.control.lifecycle,
org.objectweb.fractal.julia.control.name,
org.objectweb.fractal.julia.factory,
org.objectweb.fractal.julia.loader,
org.objectweb.fractal.julia.logger,
org.objectweb.fractal.julia.type,
org.objectweb.fractal.rmi.registry,
org.objectweb.fractal.rmi,
org.objectweb.fractal.rmi.io,
org.objectweb.fractal.rmi.stub,
org.objectweb.fractal.jonathan,
org.objectweb.jonathan.apis.binding,
org.objectweb.jonathan.apis.kernel,
org.objectweb.jonathan.apis.presentation,
org.objectweb.jonathan.apis.protocols,
org.objectweb.jonathan.apis.protocols.ip,
org.objectweb.jonathan.apis.resources,
org.objectweb.jonathan.apis.stub_factories,
org.objectweb.jonathan.libs.helpers,
org.objectweb.jonathan.libs.kernel,
org.objectweb.jonathan.libs.protocols.tcpip,
org.objectweb.jonathan.libs.resources,
org.objectweb.jonathan.libs.resources.tcpip
Bundle-Description: A bundle that wrapps a Joram Architecture
Export-Package:
org.objectweb.fractal.fscript,
org.objectweb.fractal.fscript.nodes,
org.objectweb.fractal.fscript.actions,
org.objectweb.fractal.fscript.axes,
org.objectweb.fractal.fscript.expressions,
org.objectweb.fractal.fscript.functions,
org.objectweb.fractal.fscript.functions.fractal,
org.objectweb.fractal.fscript.jade,
org.objectweb.fractal.fscript.parser,
org.objectweb.fractal.fscript.reconfiguration,
org.objectweb.fractal.fscript.statements,
org.objectweb.joram.client.jms.tcp,
org.objectweb.joram.client.jms.admin,
org.ow2.jasmine.jade.resource.joram
Include-Resource: lib/joram-mom.jar,
lib/joram-client.jar,
lib/joram-shared.jar,
lib/jms.jar,
lib/ow_monolog.jar,
lib/JCup.jar,
lib/jgroups-all.jar,
lib/fscript-1.0-SNAPSHOT.jar,
lib/antlr-2.7.7.jar,
etc/julia-joram.cfg=etc/julia-joram.cfg
Bundle-Vendor: Scalagent D.T.
Bundle-Version: 0.0.1
Manifest-Version: 1.0
Bundle-ClassPath: .,
joram-mom.jar,
joram-client.jar,
joram-shared.jar,
jms.jar,
ow_monolog.jar,
JCup.jar,
jgroups-all.jar,
fscript-1.0-SNAPSHOT.jar,
antlr-2.7.7.jar
The problem is that when I process the mvn install, I get a compile
error that I don't have when I generate the jar with my .bnd file.
[ERROR] Error building bundle
org.ow2.jasmine.jade.wrapper:org.ow2.jasmine.jade.wrapper.joram:bundle:0
.0.1-SNAPSHOT : Unresolved references to [antlr,
antlr.collections.impl, fr.dyade.aaa.jndi2.soap, fr.dyade.aaa.util,
fr.dyade.aaa.util.management, javax.jms, javax.naming,
javax.naming.spi, javax.net, javax.net.ssl, javax.xml.parsers,
org.objectweb.joram.client.jms,
org.objectweb.joram.client.jms.connection,
org.objectweb.joram.client.jms.ha.local,
org.objectweb.joram.client.jms.ha.tcp,
org.objectweb.joram.client.jms.local, org.objectweb.joram.shared,
org.objectweb.joram.shared.admin, org.objectweb.joram.shared.client,
org.objectweb.joram.shared.messages,
org.objectweb.joram.shared.stream, org.objectweb.util.monolog.api,
org.ow2.jasmine.jade.resource.joram, org.xml.sax,
org.xml.sax.helpers] by class(es) on the Bundle-Classpath[Jar:dot]:
[org/objectweb/joram/client/jms/admin/JoramAdmin.class, org/objectweb/
fractal/fscript/parser/FScriptLexer.class, org/objectweb/joram/client/
jms/admin/PlatformAdminMBean.class, org/objectweb/joram/client/jms/
admin/AdminMessage.class, org/objectweb/joram/client/jms/admin/
User.class, org/objectweb/joram/client/jms/admin/ObjectFactory.class,
org/objectweb/joram/client/jms/tcp/OptimizedReliableTcpClient.class,
org/objectweb/fractal/fscript/AttributesHelper.class, org/objectweb/
joram/client/jms/admin/JoramSaxWrapper.class, org/objectweb/fractal/
fscript/FScriptInterpreter.class, org/objectweb/joram/client/jms/tcp/
ReliableSSLTcpClient.class, org/objectweb/joram/client/jms/admin/
UserMBean.class, org/objectweb/joram/client/jms/admin/
OptimizedClusterConnectionFactory.class, org/objectweb/joram/client/
jms/tcp/XATcpConnectionFactory.class, org/objectweb/joram/client/jms/
tcp/XAQueueTcpConnectionFactory.class, org/objectweb/joram/client/jms/
tcp/XATopicTcpConnectionFactory.class, org/objectweb/joram/client/jms/
admin/AbstractConnectionFactory.class, org/objectweb/joram/client/jms/
tcp/QueueTcpConnectionFactory.class, org/objectweb/joram/client/jms/
admin/AdministeredObject.class, org/objectweb/joram/client/jms/tcp/
TopicTcpConnectionFactory.class, org/objectweb/fractal/fscript/parser/
FScriptParser1.class, org/objectweb/joram/client/jms/admin/
AdminModule.class, org/objectweb/joram/client/jms/admin/
DeadMQueue.class, org/objectweb/joram/client/jms/admin/
ClusterQueue.class, org/objectweb/joram/client/jms/admin/
ClusterTopic.class, org/objectweb/joram/client/jms/admin/AdminModule
$AdminRequestor.class, org/objectweb/joram/client/jms/tcp/
ReliableTcpClient.class, org/objectweb/joram/client/jms/admin/
PlatformAdmin.class, org/objectweb/joram/client/jms/tcp/
TcpConnection.class, org/objectweb/joram/client/jms/admin/
ClusterConnectionFactory.class, org/objectweb/joram/client/jms/admin/
AdminHelper.class, org/objectweb/fractal/fscript/nodes/
AttributeNodeImpl.class, org/objectweb/joram/client/jms/tcp/
TcpConnectionFactory.class, org/objectweb/joram/client/jms/admin/
JoramAdminMBean.class, org/objectweb/joram/client/jms/admin/
ClusterDestination.class, org/objectweb/fractal/fscript/
reconfiguration/SetValueReconfiguration.class]
[ERROR] Error(s) found in bundle configuration
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Error(s) found in bundle configuration
[INFO]
------------------------------------------------------------------------
[DEBUG] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Error(s)
found in bundle configuration
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals
(DefaultLifecycleExecutor.java:564)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifec
ycle(DefaultLifecycleExecutor.java:480)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal
(DefaultLifecycleExecutor.java:459)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandle
Failures(DefaultLifecycleExecutor.java:311)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(
DefaultLifecycleExecutor.java:278)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute
(DefaultLifecycleExecutor.java:143)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:
333)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:126)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:282)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.classworlds.Launcher.launchEnhanced
(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode
(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error(s)
found in bundle configuration
at org.apache.felix.bundleplugin.BundlePlugin.execute
(BundlePlugin.java:332)
at org.apache.felix.bundleplugin.BundlePlugin.execute
(BundlePlugin.java:172)
at org.apache.felix.bundleplugin.BundlePlugin.execute
(BundlePlugin.java:164)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo
(DefaultPluginManager.java:447)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals
(DefaultLifecycleExecutor.java:539)
... 16 more
Caused by: org.apache.maven.plugin.MojoFailureException: Error(s)
found in bundle configuration
at org.apache.felix.bundleplugin.BundlePlugin.execute
(BundlePlugin.java:302)
... 20 more
Can someone help me?
Thanks in advance.
F. Metral
-------------------------------------------------------------------
Florent METRAL
Ingénieur Expert - Projet SARDES
INRIA Rhône-Alpes
655, avenue de l'Europe, Montbonnot
38334 St Ismier Cedex, France
Mail: florent.metral@inrialpes.fr
Tel: +33 4 76 61 52 80
Re: Accessing Bundle resources through classloader
Posted by "Richard S. Hall" <he...@ungoverned.org>.
fmetral@inrialpes.fr wrote:
> Thanks for your help.
>
> I've found my problem and so, a solution.
>
> In fact, I was trying to access my resources directly through the Java
> Class loader and not through the Bundle object.
> It seems that this was allowed with the OSGi R3 but not the R4.
>
My guess is that it was getting it off the class path, so it appeared to
be working correctly...
> I've changed my calls and now it works.
>
Great.
-> richard
> F. Métral
>
>
>> Did you try running your old bundle on Felix? It should work. The
>> main difference between Felix and Oscar is that Felix is more strict
>> about how classes are accessed. Oscar automatically allowed access to
>> classes on the class path, Felix does not. Generally, to get old
>> bundles to work on Felix, the only thing that you need to do is add
>> imports for the osgi api (e.g., org.osgi.framework) and any other
>> packages you were accessing off of the class path.
>>
>> I would guess you are having an issue with maven-bundle-plugin, not
>> with accessing resources.
>>
>> -> richard
>>
>> On Nov 29, 2007, at 4:51 AM, Florent Métral wrote:
>>
>>
>>> Hi all,
>>>
>>> I'm new in Felix because I used Oscar till now.
>>>
>>> I'm trying to convert my Osacr bundles to Felix and get some troubles.
>>>
>>> In my bundle, I embedd some resources like one Julia config file.
>>> With oscar, this file was reachable though my classloader using
>>> myClassLoarder.getResourceAsStream(myFile) method.
>>>
>>> But with Felix, the result of the previous call is null and I get
>>> an error that exlpains that It can get and open my resource file.
>>>
>>> Is there a special way to access bundle resources? Do I have to
>>> declare something special in my manifest?
>>>
>>> I use the Maven Bundle Plugin BND to generate my bundle and I'd
>>> like to use the same manifest file than the one I had with oscar:
>>> here are my pom.xml and my manifest files:
>>>
>>> <?xml version="1.0" encoding="UTF-8"?><project>
>>> <modelVersion>4.0.0</modelVersion>
>>> <groupId>org.ow2.jasmine.jade.wrapper</groupId>
>>> <artifactId>org.ow2.jasmine.jade.wrapper.joram</artifactId>
>>> <packaging>bundle</packaging>
>>> <name>Joram Server</name>
>>> <version>0.0.1-SNAPSHOT</version>
>>> <description>A Bundle for Joram</description>
>>> <build>
>>> <plugins>
>>> <plugin>
>>> <groupId>org.apache.felix</groupId>
>>> <artifactId>maven-bundle-plugin</artifactId>
>>> <version>1.1.0-SNAPSHOT</version>
>>> <extensions>true</extensions>
>>> <configuration>
>>> <instructions>
>>> <Bundle-SymbolicName>${pom.artifactId}</Bundle-
>>> SymbolicName>
>>> <_include>-target/classes/META-INF/$
>>> {pom.artifactId}.bnd</_include>
>>> <_include>src/main/resources/META-INF/MANIFEST.MF</
>>> _include>
>>> <Export-Package>org.ow2.jasmine.jade.*</Export-Package>
>>> </instructions>
>>> </configuration>
>>> </plugin>
>>> <plugin>
>>> <artifactId>maven-compiler-plugin</artifactId>
>>> <inherited>true</inherited>
>>> <configuration>
>>> <source>1.5</source>
>>> <target>1.5</target>
>>> </configuration>
>>> </plugin>
>>> <plugin>
>>> <artifactId>maven-enforcer-plugin</artifactId>
>>> <executions>
>>> <execution>
>>> <id>enforce-java</id>
>>> <goals>
>>> <goal>enforce</goal>
>>> </goals>
>>> </execution>
>>> </executions>
>>> <configuration>
>>> <rules>
>>> <requireJavaVersion>
>>> <version>1.5</version>
>>> </requireJavaVersion>
>>> </rules>
>>> </configuration>
>>> </plugin>
>>> </plugins>
>>> </build>
>>> <dependencies>
>>> <dependency>
>>> <groupId>org.objectweb.fractal</groupId>
>>> <artifactId>fractal-api</artifactId>
>>> <version>2.0.2</version>
>>> </dependency>
>>> <dependency>
>>> <groupId>org.objectweb.fractal</groupId>
>>> <artifactId>fscript</artifactId>
>>> <version>1.0-SNAPSHOT</version>
>>> </dependency>
>>> <dependency>
>>> <groupId>org.ow2.jasmine</groupId>
>>> <artifactId>jade</artifactId>
>>> <version>1.0.0</version>
>>> </dependency>
>>> <dependency>
>>> <groupId>org.ow2.jasmine.jade</groupId>
>>> <artifactId>jade-fractal</artifactId>
>>> <version>1.0.0</version>
>>> </dependency>
>>> <dependency>
>>> <groupId>org.objectweb.joram</groupId>
>>> <artifactId>joram-client</artifactId>
>>> <version>5.0.4</version>
>>> </dependency>
>>> <dependency>
>>> <groupId>org.objectweb.joram</groupId>
>>> <artifactId>joram-mom</artifactId>
>>> <version>5.0.4</version>
>>> </dependency>
>>> <dependency>
>>> <groupId>org.objectweb.joram</groupId>
>>> <artifactId>joram-shared</artifactId>
>>> <version>5.0.4</version>
>>> </dependency>
>>> <dependency>
>>> <groupId>org.apache.geronimo.specs</groupId>
>>> <artifactId>geronimo-jms_1.1_spec</artifactId>
>>> <version>1.1</version>
>>> </dependency>
>>> <dependency>
>>> <groupId>org.objectweb.fractal.julia</groupId>
>>> <artifactId>julia-runtime</artifactId>
>>> <version>2.5.1</version>
>>> </dependency>
>>> </dependencies>
>>> </project>
>>>
>>>
>>> Bundle-Name: Joram Server
>>> Import-Package:
>>> org.ow2.jasmine.jade.fractal.adl.attributes,
>>> org.ow2.jasmine.jade.fractal.adl.components,
>>> org.ow2.jasmine.jade.fractal.api.control,
>>> org.ow2.jasmine.jade.fractal.julia,
>>> org.ow2.jasmine.jade.fractal.julia.control.deployment,
>>> org.ow2.jasmine.jade.fractal.julia.control.genericattribute,
>>> org.ow2.jasmine.jade.fractal.julia.control.binding,
>>> org.ow2.jasmine.jade.fractal.julia.control.reversebinding,
>>> org.ow2.jasmine.jade.fractal.julia.control.factory,
>>> org.ow2.jasmine.jade.fractal.julia.control.content,
>>> org.ow2.jasmine.jade.fractal.util,
>>> org.ow2.jasmine.jade.reflex.api.control,
>>> org.objectweb.jasmine.jade.resource,
>>> org.objectweb.jasmine.jade.resource.start,
>>> org.objectweb.jasmine.jade.service,
>>> org.objectweb.jasmine.jade.service.allocator,
>>> org.objectweb.jasmine.jade.service.deployer,
>>> org.objectweb.jasmine.jade.util,
>>> org.objectweb.asm,
>>> org.objectweb.asm.signature,
>>> org.objectweb.fractal.deployment.local.api,
>>> org.objectweb.fractal.adl,
>>> org.objectweb.fractal.adl.arguments,
>>> org.objectweb.fractal.adl.attributes,
>>> org.objectweb.fractal.adl.bindings,
>>> org.objectweb.fractal.adl.comments,
>>> org.objectweb.fractal.adl.components,
>>> org.objectweb.fractal.adl.coordinates,
>>> org.objectweb.fractal.adl.implementations,
>>> org.objectweb.fractal.adl.interfaces,
>>> org.objectweb.fractal.adl.loggers,
>>> org.objectweb.fractal.adl.nodes,
>>> org.objectweb.fractal.adl.types,
>>> org.objectweb.fractal.adl.util,
>>> org.objectweb.fractal.adl.xml,
>>> org.objectweb.fractal.api,
>>> org.objectweb.fractal.api.control,
>>> org.objectweb.fractal.api.factory,
>>> org.objectweb.fractal.api.type,
>>> org.objectweb.fractal.util,
>>> org.objectweb.fractal.julia,
>>> org.objectweb.fractal.julia.asm,
>>> org.objectweb.fractal.julia.control.attribute,
>>> org.objectweb.fractal.julia.control.binding,
>>> org.objectweb.fractal.julia.control.content,
>>> org.objectweb.fractal.julia.control.lifecycle,
>>> org.objectweb.fractal.julia.control.name,
>>> org.objectweb.fractal.julia.factory,
>>> org.objectweb.fractal.julia.loader,
>>> org.objectweb.fractal.julia.logger,
>>> org.objectweb.fractal.julia.type,
>>> org.objectweb.fractal.rmi.registry,
>>> org.objectweb.fractal.rmi,
>>> org.objectweb.fractal.rmi.io,
>>> org.objectweb.fractal.rmi.stub,
>>> org.objectweb.fractal.jonathan,
>>> org.objectweb.jonathan.apis.binding,
>>> org.objectweb.jonathan.apis.kernel,
>>> org.objectweb.jonathan.apis.presentation,
>>> org.objectweb.jonathan.apis.protocols,
>>> org.objectweb.jonathan.apis.protocols.ip,
>>> org.objectweb.jonathan.apis.resources,
>>> org.objectweb.jonathan.apis.stub_factories,
>>> org.objectweb.jonathan.libs.helpers,
>>> org.objectweb.jonathan.libs.kernel,
>>> org.objectweb.jonathan.libs.protocols.tcpip,
>>> org.objectweb.jonathan.libs.resources,
>>> org.objectweb.jonathan.libs.resources.tcpip
>>> Bundle-Description: A bundle that wrapps a Joram Architecture
>>> Export-Package:
>>> org.objectweb.fractal.fscript,
>>> org.objectweb.fractal.fscript.nodes,
>>> org.objectweb.fractal.fscript.actions,
>>> org.objectweb.fractal.fscript.axes,
>>> org.objectweb.fractal.fscript.expressions,
>>> org.objectweb.fractal.fscript.functions,
>>> org.objectweb.fractal.fscript.functions.fractal,
>>> org.objectweb.fractal.fscript.jade,
>>> org.objectweb.fractal.fscript.parser,
>>> org.objectweb.fractal.fscript.reconfiguration,
>>> org.objectweb.fractal.fscript.statements,
>>> org.objectweb.joram.client.jms.tcp,
>>> org.objectweb.joram.client.jms.admin,
>>> org.ow2.jasmine.jade.resource.joram
>>> Include-Resource: lib/joram-mom.jar,
>>> lib/joram-client.jar,
>>> lib/joram-shared.jar,
>>> lib/jms.jar,
>>> lib/ow_monolog.jar,
>>> lib/JCup.jar,
>>> lib/jgroups-all.jar,
>>> lib/fscript-1.0-SNAPSHOT.jar,
>>> lib/antlr-2.7.7.jar,
>>> etc/julia-joram.cfg=etc/julia-joram.cfg
>>> Bundle-Vendor: Scalagent D.T.
>>> Bundle-Version: 0.0.1
>>> Manifest-Version: 1.0
>>> Bundle-ClassPath: .,
>>> joram-mom.jar,
>>> joram-client.jar,
>>> joram-shared.jar,
>>> jms.jar,
>>> ow_monolog.jar,
>>> JCup.jar,
>>> jgroups-all.jar,
>>> fscript-1.0-SNAPSHOT.jar,
>>> antlr-2.7.7.jar
>>>
>>> The problem is that when I process the mvn install, I get a compile
>>> error that I don't have when I generate the jar with my .bnd file.
>>>
>>> [ERROR] Error building bundle
>>> org.ow2.jasmine.jade.wrapper:org.ow2.jasmine.jade.wrapper.joram:bundle
>>> :0.0.1-SNAPSHOT : Unresolved references to [antlr,
>>> antlr.collections.impl, fr.dyade.aaa.jndi2.soap, fr.dyade.aaa.util,
>>> fr.dyade.aaa.util.management, javax.jms, javax.naming,
>>> javax.naming.spi, javax.net, javax.net.ssl, javax.xml.parsers,
>>> org.objectweb.joram.client.jms,
>>> org.objectweb.joram.client.jms.connection,
>>> org.objectweb.joram.client.jms.ha.local,
>>> org.objectweb.joram.client.jms.ha.tcp,
>>> org.objectweb.joram.client.jms.local, org.objectweb.joram.shared,
>>> org.objectweb.joram.shared.admin,
>>> org.objectweb.joram.shared.client,
>>> org.objectweb.joram.shared.messages,
>>> org.objectweb.joram.shared.stream, org.objectweb.util.monolog.api,
>>> org.ow2.jasmine.jade.resource.joram, org.xml.sax,
>>> org.xml.sax.helpers] by class(es) on the Bundle-Classpath[Jar:dot]:
>>> [org/objectweb/joram/client/jms/admin/JoramAdmin.class, org/
>>> objectweb/fractal/fscript/parser/FScriptLexer.class, org/objectweb/
>>> joram/client/jms/admin/PlatformAdminMBean.class, org/objectweb/
>>> joram/client/jms/admin/AdminMessage.class, org/objectweb/joram/
>>> client/jms/admin/User.class, org/objectweb/joram/client/jms/admin/
>>> ObjectFactory.class, org/objectweb/joram/client/jms/tcp/
>>> OptimizedReliableTcpClient.class, org/objectweb/fractal/fscript/
>>> AttributesHelper.class, org/objectweb/joram/client/jms/admin/
>>> JoramSaxWrapper.class, org/objectweb/fractal/fscript/
>>> FScriptInterpreter.class, org/objectweb/joram/client/jms/tcp/
>>> ReliableSSLTcpClient.class, org/objectweb/joram/client/jms/admin/
>>> UserMBean.class, org/objectweb/joram/client/jms/admin/
>>> OptimizedClusterConnectionFactory.class, org/objectweb/joram/client/
>>> jms/tcp/XATcpConnectionFactory.class, org/objectweb/joram/client/
>>> jms/tcp/XAQueueTcpConnectionFactory.class, org/objectweb/joram/
>>> client/jms/tcp/XATopicTcpConnectionFactory.class, org/objectweb/
>>> joram/client/jms/admin/AbstractConnectionFactory.class, org/
>>> objectweb/joram/client/jms/tcp/QueueTcpConnectionFactory.class, org/
>>> objectweb/joram/client/jms/admin/AdministeredObject.class, org/
>>> objectweb/joram/client/jms/tcp/TopicTcpConnectionFactory.class, org/
>>> objectweb/fractal/fscript/parser/FScriptParser1.class, org/
>>> objectweb/joram/client/jms/admin/AdminModule.class, org/objectweb/
>>> joram/client/jms/admin/DeadMQueue.class, org/objectweb/joram/client/
>>> jms/admin/ClusterQueue.class, org/objectweb/joram/client/jms/admin/
>>> ClusterTopic.class, org/objectweb/joram/client/jms/admin/AdminModule
>>> $AdminRequestor.class, org/objectweb/joram/client/jms/tcp/
>>> ReliableTcpClient.class, org/objectweb/joram/client/jms/admin/
>>> PlatformAdmin.class, org/objectweb/joram/client/jms/tcp/
>>> TcpConnection.class, org/objectweb/joram/client/jms/admin/
>>> ClusterConnectionFactory.class, org/objectweb/joram/client/jms/
>>> admin/AdminHelper.class, org/objectweb/fractal/fscript/nodes/
>>> AttributeNodeImpl.class, org/objectweb/joram/client/jms/tcp/
>>> TcpConnectionFactory.class, org/objectweb/joram/client/jms/admin/
>>> JoramAdminMBean.class, org/objectweb/joram/client/jms/admin/
>>> ClusterDestination.class, org/objectweb/fractal/fscript/
>>> reconfiguration/SetValueReconfiguration.class]
>>> [ERROR] Error(s) found in bundle configuration
>>> [INFO]
>>> ----------------------------------------------------------------------
>>> --
>>> [ERROR] BUILD ERROR
>>> [INFO]
>>> ----------------------------------------------------------------------
>>> --
>>> [INFO] Error(s) found in bundle configuration
>>> [INFO]
>>> ----------------------------------------------------------------------
>>> --
>>> [DEBUG] Trace
>>> org.apache.maven.lifecycle.LifecycleExecutionException: Error(s)
>>> found in bundle configuration
>>> at
>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals
>>> (DefaultLifecycleExecutor.java:564)
>>> at
>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLif
>>> ecycle(DefaultLifecycleExecutor.java:480)
>>> at
>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal
>>> (DefaultLifecycleExecutor.java:459)
>>> at
>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHand
>>> leFailures(DefaultLifecycleExecutor.java:311)
>>> at
>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegment
>>> s(DefaultLifecycleExecutor.java:278)
>>> at
>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute
>>> (DefaultLifecycleExecutor.java:143)
>>> at org.apache.maven.DefaultMaven.doExecute
>>> (DefaultMaven.java:333)
>>> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:
>>> 126)
>>> at org.apache.maven.cli.MavenCli.main(MavenCli.java:282)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke
>>> (NativeMethodAccessorImpl.java:39)
>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke
>>> (DelegatingMethodAccessorImpl.java:25)
>>> at java.lang.reflect.Method.invoke(Method.java:585)
>>> at org.codehaus.classworlds.Launcher.launchEnhanced
>>> (Launcher.java:315)
>>> at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>>> at org.codehaus.classworlds.Launcher.mainWithExitCode
>>> (Launcher.java:430)
>>> at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
>>> Caused by: org.apache.maven.plugin.MojoExecutionException: Error(s)
>>> found in bundle configuration
>>> at org.apache.felix.bundleplugin.BundlePlugin.execute
>>> (BundlePlugin.java:332)
>>> at org.apache.felix.bundleplugin.BundlePlugin.execute
>>> (BundlePlugin.java:172)
>>> at org.apache.felix.bundleplugin.BundlePlugin.execute
>>> (BundlePlugin.java:164)
>>> at org.apache.maven.plugin.DefaultPluginManager.executeMojo
>>> (DefaultPluginManager.java:447)
>>> at
>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals
>>> (DefaultLifecycleExecutor.java:539)
>>> ... 16 more
>>> Caused by: org.apache.maven.plugin.MojoFailureException: Error(s)
>>> found in bundle configuration
>>> at org.apache.felix.bundleplugin.BundlePlugin.execute
>>> (BundlePlugin.java:302)
>>> ... 20 more
>>>
>>>
>>> Can someone help me?
>>> Thanks in advance.
>>> F. Metral
>>>
>>>
>>> -------------------------------------------------------------------
>>> Florent METRAL
>>> Ingénieur Expert - Projet SARDES
>>> INRIA Rhône-Alpes
>>> 655, avenue de l'Europe, Montbonnot
>>> 38334 St Ismier Cedex, France
>>> Mail: florent.metral@inrialpes.fr
>>> Tel: +33 4 76 61 52 80
>>>
>>>
>>>
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
Re: Accessing Bundle resources through classloader
Posted by fm...@inrialpes.fr.
Thanks for your help.
I've found my problem and so, a solution.
In fact, I was trying to access my resources directly through the Java
Class loader and not through the Bundle object.
It seems that this was allowed with the OSGi R3 but not the R4.
I've changed my calls and now it works.
F. Métral
> Did you try running your old bundle on Felix? It should work. The
> main difference between Felix and Oscar is that Felix is more strict
> about how classes are accessed. Oscar automatically allowed access to
> classes on the class path, Felix does not. Generally, to get old
> bundles to work on Felix, the only thing that you need to do is add
> imports for the osgi api (e.g., org.osgi.framework) and any other
> packages you were accessing off of the class path.
>
> I would guess you are having an issue with maven-bundle-plugin, not
> with accessing resources.
>
> -> richard
>
> On Nov 29, 2007, at 4:51 AM, Florent Métral wrote:
>
>> Hi all,
>>
>> I'm new in Felix because I used Oscar till now.
>>
>> I'm trying to convert my Osacr bundles to Felix and get some troubles.
>>
>> In my bundle, I embedd some resources like one Julia config file.
>> With oscar, this file was reachable though my classloader using
>> myClassLoarder.getResourceAsStream(myFile) method.
>>
>> But with Felix, the result of the previous call is null and I get
>> an error that exlpains that It can get and open my resource file.
>>
>> Is there a special way to access bundle resources? Do I have to
>> declare something special in my manifest?
>>
>> I use the Maven Bundle Plugin BND to generate my bundle and I'd
>> like to use the same manifest file than the one I had with oscar:
>> here are my pom.xml and my manifest files:
>>
>> <?xml version="1.0" encoding="UTF-8"?><project>
>> <modelVersion>4.0.0</modelVersion>
>> <groupId>org.ow2.jasmine.jade.wrapper</groupId>
>> <artifactId>org.ow2.jasmine.jade.wrapper.joram</artifactId>
>> <packaging>bundle</packaging>
>> <name>Joram Server</name>
>> <version>0.0.1-SNAPSHOT</version>
>> <description>A Bundle for Joram</description>
>> <build>
>> <plugins>
>> <plugin>
>> <groupId>org.apache.felix</groupId>
>> <artifactId>maven-bundle-plugin</artifactId>
>> <version>1.1.0-SNAPSHOT</version>
>> <extensions>true</extensions>
>> <configuration>
>> <instructions>
>> <Bundle-SymbolicName>${pom.artifactId}</Bundle-
>> SymbolicName>
>> <_include>-target/classes/META-INF/$
>> {pom.artifactId}.bnd</_include>
>> <_include>src/main/resources/META-INF/MANIFEST.MF</
>> _include>
>> <Export-Package>org.ow2.jasmine.jade.*</Export-Package>
>> </instructions>
>> </configuration>
>> </plugin>
>> <plugin>
>> <artifactId>maven-compiler-plugin</artifactId>
>> <inherited>true</inherited>
>> <configuration>
>> <source>1.5</source>
>> <target>1.5</target>
>> </configuration>
>> </plugin>
>> <plugin>
>> <artifactId>maven-enforcer-plugin</artifactId>
>> <executions>
>> <execution>
>> <id>enforce-java</id>
>> <goals>
>> <goal>enforce</goal>
>> </goals>
>> </execution>
>> </executions>
>> <configuration>
>> <rules>
>> <requireJavaVersion>
>> <version>1.5</version>
>> </requireJavaVersion>
>> </rules>
>> </configuration>
>> </plugin>
>> </plugins>
>> </build>
>> <dependencies>
>> <dependency>
>> <groupId>org.objectweb.fractal</groupId>
>> <artifactId>fractal-api</artifactId>
>> <version>2.0.2</version>
>> </dependency>
>> <dependency>
>> <groupId>org.objectweb.fractal</groupId>
>> <artifactId>fscript</artifactId>
>> <version>1.0-SNAPSHOT</version>
>> </dependency>
>> <dependency>
>> <groupId>org.ow2.jasmine</groupId>
>> <artifactId>jade</artifactId>
>> <version>1.0.0</version>
>> </dependency>
>> <dependency>
>> <groupId>org.ow2.jasmine.jade</groupId>
>> <artifactId>jade-fractal</artifactId>
>> <version>1.0.0</version>
>> </dependency>
>> <dependency>
>> <groupId>org.objectweb.joram</groupId>
>> <artifactId>joram-client</artifactId>
>> <version>5.0.4</version>
>> </dependency>
>> <dependency>
>> <groupId>org.objectweb.joram</groupId>
>> <artifactId>joram-mom</artifactId>
>> <version>5.0.4</version>
>> </dependency>
>> <dependency>
>> <groupId>org.objectweb.joram</groupId>
>> <artifactId>joram-shared</artifactId>
>> <version>5.0.4</version>
>> </dependency>
>> <dependency>
>> <groupId>org.apache.geronimo.specs</groupId>
>> <artifactId>geronimo-jms_1.1_spec</artifactId>
>> <version>1.1</version>
>> </dependency>
>> <dependency>
>> <groupId>org.objectweb.fractal.julia</groupId>
>> <artifactId>julia-runtime</artifactId>
>> <version>2.5.1</version>
>> </dependency>
>> </dependencies>
>> </project>
>>
>>
>> Bundle-Name: Joram Server
>> Import-Package:
>> org.ow2.jasmine.jade.fractal.adl.attributes,
>> org.ow2.jasmine.jade.fractal.adl.components,
>> org.ow2.jasmine.jade.fractal.api.control,
>> org.ow2.jasmine.jade.fractal.julia,
>> org.ow2.jasmine.jade.fractal.julia.control.deployment,
>> org.ow2.jasmine.jade.fractal.julia.control.genericattribute,
>> org.ow2.jasmine.jade.fractal.julia.control.binding,
>> org.ow2.jasmine.jade.fractal.julia.control.reversebinding,
>> org.ow2.jasmine.jade.fractal.julia.control.factory,
>> org.ow2.jasmine.jade.fractal.julia.control.content,
>> org.ow2.jasmine.jade.fractal.util,
>> org.ow2.jasmine.jade.reflex.api.control,
>> org.objectweb.jasmine.jade.resource,
>> org.objectweb.jasmine.jade.resource.start,
>> org.objectweb.jasmine.jade.service,
>> org.objectweb.jasmine.jade.service.allocator,
>> org.objectweb.jasmine.jade.service.deployer,
>> org.objectweb.jasmine.jade.util,
>> org.objectweb.asm,
>> org.objectweb.asm.signature,
>> org.objectweb.fractal.deployment.local.api,
>> org.objectweb.fractal.adl,
>> org.objectweb.fractal.adl.arguments,
>> org.objectweb.fractal.adl.attributes,
>> org.objectweb.fractal.adl.bindings,
>> org.objectweb.fractal.adl.comments,
>> org.objectweb.fractal.adl.components,
>> org.objectweb.fractal.adl.coordinates,
>> org.objectweb.fractal.adl.implementations,
>> org.objectweb.fractal.adl.interfaces,
>> org.objectweb.fractal.adl.loggers,
>> org.objectweb.fractal.adl.nodes,
>> org.objectweb.fractal.adl.types,
>> org.objectweb.fractal.adl.util,
>> org.objectweb.fractal.adl.xml,
>> org.objectweb.fractal.api,
>> org.objectweb.fractal.api.control,
>> org.objectweb.fractal.api.factory,
>> org.objectweb.fractal.api.type,
>> org.objectweb.fractal.util,
>> org.objectweb.fractal.julia,
>> org.objectweb.fractal.julia.asm,
>> org.objectweb.fractal.julia.control.attribute,
>> org.objectweb.fractal.julia.control.binding,
>> org.objectweb.fractal.julia.control.content,
>> org.objectweb.fractal.julia.control.lifecycle,
>> org.objectweb.fractal.julia.control.name,
>> org.objectweb.fractal.julia.factory,
>> org.objectweb.fractal.julia.loader,
>> org.objectweb.fractal.julia.logger,
>> org.objectweb.fractal.julia.type,
>> org.objectweb.fractal.rmi.registry,
>> org.objectweb.fractal.rmi,
>> org.objectweb.fractal.rmi.io,
>> org.objectweb.fractal.rmi.stub,
>> org.objectweb.fractal.jonathan,
>> org.objectweb.jonathan.apis.binding,
>> org.objectweb.jonathan.apis.kernel,
>> org.objectweb.jonathan.apis.presentation,
>> org.objectweb.jonathan.apis.protocols,
>> org.objectweb.jonathan.apis.protocols.ip,
>> org.objectweb.jonathan.apis.resources,
>> org.objectweb.jonathan.apis.stub_factories,
>> org.objectweb.jonathan.libs.helpers,
>> org.objectweb.jonathan.libs.kernel,
>> org.objectweb.jonathan.libs.protocols.tcpip,
>> org.objectweb.jonathan.libs.resources,
>> org.objectweb.jonathan.libs.resources.tcpip
>> Bundle-Description: A bundle that wrapps a Joram Architecture
>> Export-Package:
>> org.objectweb.fractal.fscript,
>> org.objectweb.fractal.fscript.nodes,
>> org.objectweb.fractal.fscript.actions,
>> org.objectweb.fractal.fscript.axes,
>> org.objectweb.fractal.fscript.expressions,
>> org.objectweb.fractal.fscript.functions,
>> org.objectweb.fractal.fscript.functions.fractal,
>> org.objectweb.fractal.fscript.jade,
>> org.objectweb.fractal.fscript.parser,
>> org.objectweb.fractal.fscript.reconfiguration,
>> org.objectweb.fractal.fscript.statements,
>> org.objectweb.joram.client.jms.tcp,
>> org.objectweb.joram.client.jms.admin,
>> org.ow2.jasmine.jade.resource.joram
>> Include-Resource: lib/joram-mom.jar,
>> lib/joram-client.jar,
>> lib/joram-shared.jar,
>> lib/jms.jar,
>> lib/ow_monolog.jar,
>> lib/JCup.jar,
>> lib/jgroups-all.jar,
>> lib/fscript-1.0-SNAPSHOT.jar,
>> lib/antlr-2.7.7.jar,
>> etc/julia-joram.cfg=etc/julia-joram.cfg
>> Bundle-Vendor: Scalagent D.T.
>> Bundle-Version: 0.0.1
>> Manifest-Version: 1.0
>> Bundle-ClassPath: .,
>> joram-mom.jar,
>> joram-client.jar,
>> joram-shared.jar,
>> jms.jar,
>> ow_monolog.jar,
>> JCup.jar,
>> jgroups-all.jar,
>> fscript-1.0-SNAPSHOT.jar,
>> antlr-2.7.7.jar
>>
>> The problem is that when I process the mvn install, I get a compile
>> error that I don't have when I generate the jar with my .bnd file.
>>
>> [ERROR] Error building bundle
>> org.ow2.jasmine.jade.wrapper:org.ow2.jasmine.jade.wrapper.joram:bundle
>> :0.0.1-SNAPSHOT : Unresolved references to [antlr,
>> antlr.collections.impl, fr.dyade.aaa.jndi2.soap, fr.dyade.aaa.util,
>> fr.dyade.aaa.util.management, javax.jms, javax.naming,
>> javax.naming.spi, javax.net, javax.net.ssl, javax.xml.parsers,
>> org.objectweb.joram.client.jms,
>> org.objectweb.joram.client.jms.connection,
>> org.objectweb.joram.client.jms.ha.local,
>> org.objectweb.joram.client.jms.ha.tcp,
>> org.objectweb.joram.client.jms.local, org.objectweb.joram.shared,
>> org.objectweb.joram.shared.admin,
>> org.objectweb.joram.shared.client,
>> org.objectweb.joram.shared.messages,
>> org.objectweb.joram.shared.stream, org.objectweb.util.monolog.api,
>> org.ow2.jasmine.jade.resource.joram, org.xml.sax,
>> org.xml.sax.helpers] by class(es) on the Bundle-Classpath[Jar:dot]:
>> [org/objectweb/joram/client/jms/admin/JoramAdmin.class, org/
>> objectweb/fractal/fscript/parser/FScriptLexer.class, org/objectweb/
>> joram/client/jms/admin/PlatformAdminMBean.class, org/objectweb/
>> joram/client/jms/admin/AdminMessage.class, org/objectweb/joram/
>> client/jms/admin/User.class, org/objectweb/joram/client/jms/admin/
>> ObjectFactory.class, org/objectweb/joram/client/jms/tcp/
>> OptimizedReliableTcpClient.class, org/objectweb/fractal/fscript/
>> AttributesHelper.class, org/objectweb/joram/client/jms/admin/
>> JoramSaxWrapper.class, org/objectweb/fractal/fscript/
>> FScriptInterpreter.class, org/objectweb/joram/client/jms/tcp/
>> ReliableSSLTcpClient.class, org/objectweb/joram/client/jms/admin/
>> UserMBean.class, org/objectweb/joram/client/jms/admin/
>> OptimizedClusterConnectionFactory.class, org/objectweb/joram/client/
>> jms/tcp/XATcpConnectionFactory.class, org/objectweb/joram/client/
>> jms/tcp/XAQueueTcpConnectionFactory.class, org/objectweb/joram/
>> client/jms/tcp/XATopicTcpConnectionFactory.class, org/objectweb/
>> joram/client/jms/admin/AbstractConnectionFactory.class, org/
>> objectweb/joram/client/jms/tcp/QueueTcpConnectionFactory.class, org/
>> objectweb/joram/client/jms/admin/AdministeredObject.class, org/
>> objectweb/joram/client/jms/tcp/TopicTcpConnectionFactory.class, org/
>> objectweb/fractal/fscript/parser/FScriptParser1.class, org/
>> objectweb/joram/client/jms/admin/AdminModule.class, org/objectweb/
>> joram/client/jms/admin/DeadMQueue.class, org/objectweb/joram/client/
>> jms/admin/ClusterQueue.class, org/objectweb/joram/client/jms/admin/
>> ClusterTopic.class, org/objectweb/joram/client/jms/admin/AdminModule
>> $AdminRequestor.class, org/objectweb/joram/client/jms/tcp/
>> ReliableTcpClient.class, org/objectweb/joram/client/jms/admin/
>> PlatformAdmin.class, org/objectweb/joram/client/jms/tcp/
>> TcpConnection.class, org/objectweb/joram/client/jms/admin/
>> ClusterConnectionFactory.class, org/objectweb/joram/client/jms/
>> admin/AdminHelper.class, org/objectweb/fractal/fscript/nodes/
>> AttributeNodeImpl.class, org/objectweb/joram/client/jms/tcp/
>> TcpConnectionFactory.class, org/objectweb/joram/client/jms/admin/
>> JoramAdminMBean.class, org/objectweb/joram/client/jms/admin/
>> ClusterDestination.class, org/objectweb/fractal/fscript/
>> reconfiguration/SetValueReconfiguration.class]
>> [ERROR] Error(s) found in bundle configuration
>> [INFO]
>> ----------------------------------------------------------------------
>> --
>> [ERROR] BUILD ERROR
>> [INFO]
>> ----------------------------------------------------------------------
>> --
>> [INFO] Error(s) found in bundle configuration
>> [INFO]
>> ----------------------------------------------------------------------
>> --
>> [DEBUG] Trace
>> org.apache.maven.lifecycle.LifecycleExecutionException: Error(s)
>> found in bundle configuration
>> at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals
>> (DefaultLifecycleExecutor.java:564)
>> at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLif
>> ecycle(DefaultLifecycleExecutor.java:480)
>> at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal
>> (DefaultLifecycleExecutor.java:459)
>> at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHand
>> leFailures(DefaultLifecycleExecutor.java:311)
>> at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegment
>> s(DefaultLifecycleExecutor.java:278)
>> at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute
>> (DefaultLifecycleExecutor.java:143)
>> at org.apache.maven.DefaultMaven.doExecute
>> (DefaultMaven.java:333)
>> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:
>> 126)
>> at org.apache.maven.cli.MavenCli.main(MavenCli.java:282)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at sun.reflect.NativeMethodAccessorImpl.invoke
>> (NativeMethodAccessorImpl.java:39)
>> at sun.reflect.DelegatingMethodAccessorImpl.invoke
>> (DelegatingMethodAccessorImpl.java:25)
>> at java.lang.reflect.Method.invoke(Method.java:585)
>> at org.codehaus.classworlds.Launcher.launchEnhanced
>> (Launcher.java:315)
>> at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>> at org.codehaus.classworlds.Launcher.mainWithExitCode
>> (Launcher.java:430)
>> at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
>> Caused by: org.apache.maven.plugin.MojoExecutionException: Error(s)
>> found in bundle configuration
>> at org.apache.felix.bundleplugin.BundlePlugin.execute
>> (BundlePlugin.java:332)
>> at org.apache.felix.bundleplugin.BundlePlugin.execute
>> (BundlePlugin.java:172)
>> at org.apache.felix.bundleplugin.BundlePlugin.execute
>> (BundlePlugin.java:164)
>> at org.apache.maven.plugin.DefaultPluginManager.executeMojo
>> (DefaultPluginManager.java:447)
>> at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals
>> (DefaultLifecycleExecutor.java:539)
>> ... 16 more
>> Caused by: org.apache.maven.plugin.MojoFailureException: Error(s)
>> found in bundle configuration
>> at org.apache.felix.bundleplugin.BundlePlugin.execute
>> (BundlePlugin.java:302)
>> ... 20 more
>>
>>
>> Can someone help me?
>> Thanks in advance.
>> F. Metral
>>
>>
>> -------------------------------------------------------------------
>> Florent METRAL
>> Ingénieur Expert - Projet SARDES
>> INRIA Rhône-Alpes
>> 655, avenue de l'Europe, Montbonnot
>> 38334 St Ismier Cedex, France
>> Mail: florent.metral@inrialpes.fr
>> Tel: +33 4 76 61 52 80
>>
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
Re: Accessing Bundle resources through classloader
Posted by "Richard S. Hall" <he...@ungoverned.org>.
Did you try running your old bundle on Felix? It should work. The
main difference between Felix and Oscar is that Felix is more strict
about how classes are accessed. Oscar automatically allowed access to
classes on the class path, Felix does not. Generally, to get old
bundles to work on Felix, the only thing that you need to do is add
imports for the osgi api (e.g., org.osgi.framework) and any other
packages you were accessing off of the class path.
I would guess you are having an issue with maven-bundle-plugin, not
with accessing resources.
-> richard
On Nov 29, 2007, at 4:51 AM, Florent Métral wrote:
> Hi all,
>
> I'm new in Felix because I used Oscar till now.
>
> I'm trying to convert my Osacr bundles to Felix and get some troubles.
>
> In my bundle, I embedd some resources like one Julia config file.
> With oscar, this file was reachable though my classloader using
> myClassLoarder.getResourceAsStream(myFile) method.
>
> But with Felix, the result of the previous call is null and I get
> an error that exlpains that It can get and open my resource file.
>
> Is there a special way to access bundle resources? Do I have to
> declare something special in my manifest?
>
> I use the Maven Bundle Plugin BND to generate my bundle and I'd
> like to use the same manifest file than the one I had with oscar:
> here are my pom.xml and my manifest files:
>
> <?xml version="1.0" encoding="UTF-8"?><project>
> <modelVersion>4.0.0</modelVersion>
> <groupId>org.ow2.jasmine.jade.wrapper</groupId>
> <artifactId>org.ow2.jasmine.jade.wrapper.joram</artifactId>
> <packaging>bundle</packaging>
> <name>Joram Server</name>
> <version>0.0.1-SNAPSHOT</version>
> <description>A Bundle for Joram</description>
> <build>
> <plugins>
> <plugin>
> <groupId>org.apache.felix</groupId>
> <artifactId>maven-bundle-plugin</artifactId>
> <version>1.1.0-SNAPSHOT</version>
> <extensions>true</extensions>
> <configuration>
> <instructions>
> <Bundle-SymbolicName>${pom.artifactId}</Bundle-
> SymbolicName>
> <_include>-target/classes/META-INF/$
> {pom.artifactId}.bnd</_include>
> <_include>src/main/resources/META-INF/MANIFEST.MF</
> _include>
> <Export-Package>org.ow2.jasmine.jade.*</Export-Package>
> </instructions>
> </configuration>
> </plugin>
> <plugin>
> <artifactId>maven-compiler-plugin</artifactId>
> <inherited>true</inherited>
> <configuration>
> <source>1.5</source>
> <target>1.5</target>
> </configuration>
> </plugin>
> <plugin>
> <artifactId>maven-enforcer-plugin</artifactId>
> <executions>
> <execution>
> <id>enforce-java</id>
> <goals>
> <goal>enforce</goal>
> </goals>
> </execution>
> </executions>
> <configuration>
> <rules>
> <requireJavaVersion>
> <version>1.5</version>
> </requireJavaVersion>
> </rules>
> </configuration>
> </plugin>
> </plugins>
> </build>
> <dependencies>
> <dependency>
> <groupId>org.objectweb.fractal</groupId>
> <artifactId>fractal-api</artifactId>
> <version>2.0.2</version>
> </dependency>
> <dependency>
> <groupId>org.objectweb.fractal</groupId>
> <artifactId>fscript</artifactId>
> <version>1.0-SNAPSHOT</version>
> </dependency>
> <dependency>
> <groupId>org.ow2.jasmine</groupId>
> <artifactId>jade</artifactId>
> <version>1.0.0</version>
> </dependency>
> <dependency>
> <groupId>org.ow2.jasmine.jade</groupId>
> <artifactId>jade-fractal</artifactId>
> <version>1.0.0</version>
> </dependency>
> <dependency>
> <groupId>org.objectweb.joram</groupId>
> <artifactId>joram-client</artifactId>
> <version>5.0.4</version>
> </dependency>
> <dependency>
> <groupId>org.objectweb.joram</groupId>
> <artifactId>joram-mom</artifactId>
> <version>5.0.4</version>
> </dependency>
> <dependency>
> <groupId>org.objectweb.joram</groupId>
> <artifactId>joram-shared</artifactId>
> <version>5.0.4</version>
> </dependency>
> <dependency>
> <groupId>org.apache.geronimo.specs</groupId>
> <artifactId>geronimo-jms_1.1_spec</artifactId>
> <version>1.1</version>
> </dependency>
> <dependency>
> <groupId>org.objectweb.fractal.julia</groupId>
> <artifactId>julia-runtime</artifactId>
> <version>2.5.1</version>
> </dependency>
> </dependencies>
> </project>
>
>
> Bundle-Name: Joram Server
> Import-Package:
> org.ow2.jasmine.jade.fractal.adl.attributes,
> org.ow2.jasmine.jade.fractal.adl.components,
> org.ow2.jasmine.jade.fractal.api.control,
> org.ow2.jasmine.jade.fractal.julia,
> org.ow2.jasmine.jade.fractal.julia.control.deployment,
> org.ow2.jasmine.jade.fractal.julia.control.genericattribute,
> org.ow2.jasmine.jade.fractal.julia.control.binding,
> org.ow2.jasmine.jade.fractal.julia.control.reversebinding,
> org.ow2.jasmine.jade.fractal.julia.control.factory,
> org.ow2.jasmine.jade.fractal.julia.control.content,
> org.ow2.jasmine.jade.fractal.util,
> org.ow2.jasmine.jade.reflex.api.control,
> org.objectweb.jasmine.jade.resource,
> org.objectweb.jasmine.jade.resource.start,
> org.objectweb.jasmine.jade.service,
> org.objectweb.jasmine.jade.service.allocator,
> org.objectweb.jasmine.jade.service.deployer,
> org.objectweb.jasmine.jade.util,
> org.objectweb.asm,
> org.objectweb.asm.signature,
> org.objectweb.fractal.deployment.local.api,
> org.objectweb.fractal.adl,
> org.objectweb.fractal.adl.arguments,
> org.objectweb.fractal.adl.attributes,
> org.objectweb.fractal.adl.bindings,
> org.objectweb.fractal.adl.comments,
> org.objectweb.fractal.adl.components,
> org.objectweb.fractal.adl.coordinates,
> org.objectweb.fractal.adl.implementations,
> org.objectweb.fractal.adl.interfaces,
> org.objectweb.fractal.adl.loggers,
> org.objectweb.fractal.adl.nodes,
> org.objectweb.fractal.adl.types,
> org.objectweb.fractal.adl.util,
> org.objectweb.fractal.adl.xml,
> org.objectweb.fractal.api,
> org.objectweb.fractal.api.control,
> org.objectweb.fractal.api.factory,
> org.objectweb.fractal.api.type,
> org.objectweb.fractal.util,
> org.objectweb.fractal.julia,
> org.objectweb.fractal.julia.asm,
> org.objectweb.fractal.julia.control.attribute,
> org.objectweb.fractal.julia.control.binding,
> org.objectweb.fractal.julia.control.content,
> org.objectweb.fractal.julia.control.lifecycle,
> org.objectweb.fractal.julia.control.name,
> org.objectweb.fractal.julia.factory,
> org.objectweb.fractal.julia.loader,
> org.objectweb.fractal.julia.logger,
> org.objectweb.fractal.julia.type,
> org.objectweb.fractal.rmi.registry,
> org.objectweb.fractal.rmi,
> org.objectweb.fractal.rmi.io,
> org.objectweb.fractal.rmi.stub,
> org.objectweb.fractal.jonathan,
> org.objectweb.jonathan.apis.binding,
> org.objectweb.jonathan.apis.kernel,
> org.objectweb.jonathan.apis.presentation,
> org.objectweb.jonathan.apis.protocols,
> org.objectweb.jonathan.apis.protocols.ip,
> org.objectweb.jonathan.apis.resources,
> org.objectweb.jonathan.apis.stub_factories,
> org.objectweb.jonathan.libs.helpers,
> org.objectweb.jonathan.libs.kernel,
> org.objectweb.jonathan.libs.protocols.tcpip,
> org.objectweb.jonathan.libs.resources,
> org.objectweb.jonathan.libs.resources.tcpip
> Bundle-Description: A bundle that wrapps a Joram Architecture
> Export-Package:
> org.objectweb.fractal.fscript,
> org.objectweb.fractal.fscript.nodes,
> org.objectweb.fractal.fscript.actions,
> org.objectweb.fractal.fscript.axes,
> org.objectweb.fractal.fscript.expressions,
> org.objectweb.fractal.fscript.functions,
> org.objectweb.fractal.fscript.functions.fractal,
> org.objectweb.fractal.fscript.jade,
> org.objectweb.fractal.fscript.parser,
> org.objectweb.fractal.fscript.reconfiguration,
> org.objectweb.fractal.fscript.statements,
> org.objectweb.joram.client.jms.tcp,
> org.objectweb.joram.client.jms.admin,
> org.ow2.jasmine.jade.resource.joram
> Include-Resource: lib/joram-mom.jar,
> lib/joram-client.jar,
> lib/joram-shared.jar,
> lib/jms.jar,
> lib/ow_monolog.jar,
> lib/JCup.jar,
> lib/jgroups-all.jar,
> lib/fscript-1.0-SNAPSHOT.jar,
> lib/antlr-2.7.7.jar,
> etc/julia-joram.cfg=etc/julia-joram.cfg
> Bundle-Vendor: Scalagent D.T.
> Bundle-Version: 0.0.1
> Manifest-Version: 1.0
> Bundle-ClassPath: .,
> joram-mom.jar,
> joram-client.jar,
> joram-shared.jar,
> jms.jar,
> ow_monolog.jar,
> JCup.jar,
> jgroups-all.jar,
> fscript-1.0-SNAPSHOT.jar,
> antlr-2.7.7.jar
>
> The problem is that when I process the mvn install, I get a compile
> error that I don't have when I generate the jar with my .bnd file.
>
> [ERROR] Error building bundle
> org.ow2.jasmine.jade.wrapper:org.ow2.jasmine.jade.wrapper.joram:bundle
> :0.0.1-SNAPSHOT : Unresolved references to [antlr,
> antlr.collections.impl, fr.dyade.aaa.jndi2.soap, fr.dyade.aaa.util,
> fr.dyade.aaa.util.management, javax.jms, javax.naming,
> javax.naming.spi, javax.net, javax.net.ssl, javax.xml.parsers,
> org.objectweb.joram.client.jms,
> org.objectweb.joram.client.jms.connection,
> org.objectweb.joram.client.jms.ha.local,
> org.objectweb.joram.client.jms.ha.tcp,
> org.objectweb.joram.client.jms.local, org.objectweb.joram.shared,
> org.objectweb.joram.shared.admin,
> org.objectweb.joram.shared.client,
> org.objectweb.joram.shared.messages,
> org.objectweb.joram.shared.stream, org.objectweb.util.monolog.api,
> org.ow2.jasmine.jade.resource.joram, org.xml.sax,
> org.xml.sax.helpers] by class(es) on the Bundle-Classpath[Jar:dot]:
> [org/objectweb/joram/client/jms/admin/JoramAdmin.class, org/
> objectweb/fractal/fscript/parser/FScriptLexer.class, org/objectweb/
> joram/client/jms/admin/PlatformAdminMBean.class, org/objectweb/
> joram/client/jms/admin/AdminMessage.class, org/objectweb/joram/
> client/jms/admin/User.class, org/objectweb/joram/client/jms/admin/
> ObjectFactory.class, org/objectweb/joram/client/jms/tcp/
> OptimizedReliableTcpClient.class, org/objectweb/fractal/fscript/
> AttributesHelper.class, org/objectweb/joram/client/jms/admin/
> JoramSaxWrapper.class, org/objectweb/fractal/fscript/
> FScriptInterpreter.class, org/objectweb/joram/client/jms/tcp/
> ReliableSSLTcpClient.class, org/objectweb/joram/client/jms/admin/
> UserMBean.class, org/objectweb/joram/client/jms/admin/
> OptimizedClusterConnectionFactory.class, org/objectweb/joram/client/
> jms/tcp/XATcpConnectionFactory.class, org/objectweb/joram/client/
> jms/tcp/XAQueueTcpConnectionFactory.class, org/objectweb/joram/
> client/jms/tcp/XATopicTcpConnectionFactory.class, org/objectweb/
> joram/client/jms/admin/AbstractConnectionFactory.class, org/
> objectweb/joram/client/jms/tcp/QueueTcpConnectionFactory.class, org/
> objectweb/joram/client/jms/admin/AdministeredObject.class, org/
> objectweb/joram/client/jms/tcp/TopicTcpConnectionFactory.class, org/
> objectweb/fractal/fscript/parser/FScriptParser1.class, org/
> objectweb/joram/client/jms/admin/AdminModule.class, org/objectweb/
> joram/client/jms/admin/DeadMQueue.class, org/objectweb/joram/client/
> jms/admin/ClusterQueue.class, org/objectweb/joram/client/jms/admin/
> ClusterTopic.class, org/objectweb/joram/client/jms/admin/AdminModule
> $AdminRequestor.class, org/objectweb/joram/client/jms/tcp/
> ReliableTcpClient.class, org/objectweb/joram/client/jms/admin/
> PlatformAdmin.class, org/objectweb/joram/client/jms/tcp/
> TcpConnection.class, org/objectweb/joram/client/jms/admin/
> ClusterConnectionFactory.class, org/objectweb/joram/client/jms/
> admin/AdminHelper.class, org/objectweb/fractal/fscript/nodes/
> AttributeNodeImpl.class, org/objectweb/joram/client/jms/tcp/
> TcpConnectionFactory.class, org/objectweb/joram/client/jms/admin/
> JoramAdminMBean.class, org/objectweb/joram/client/jms/admin/
> ClusterDestination.class, org/objectweb/fractal/fscript/
> reconfiguration/SetValueReconfiguration.class]
> [ERROR] Error(s) found in bundle configuration
> [INFO]
> ----------------------------------------------------------------------
> --
> [ERROR] BUILD ERROR
> [INFO]
> ----------------------------------------------------------------------
> --
> [INFO] Error(s) found in bundle configuration
> [INFO]
> ----------------------------------------------------------------------
> --
> [DEBUG] Trace
> org.apache.maven.lifecycle.LifecycleExecutionException: Error(s)
> found in bundle configuration
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals
> (DefaultLifecycleExecutor.java:564)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLif
> ecycle(DefaultLifecycleExecutor.java:480)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal
> (DefaultLifecycleExecutor.java:459)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHand
> leFailures(DefaultLifecycleExecutor.java:311)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegment
> s(DefaultLifecycleExecutor.java:278)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute
> (DefaultLifecycleExecutor.java:143)
> at org.apache.maven.DefaultMaven.doExecute
> (DefaultMaven.java:333)
> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:
> 126)
> at org.apache.maven.cli.MavenCli.main(MavenCli.java:282)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke
> (NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke
> (DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at org.codehaus.classworlds.Launcher.launchEnhanced
> (Launcher.java:315)
> at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
> at org.codehaus.classworlds.Launcher.mainWithExitCode
> (Launcher.java:430)
> at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> Caused by: org.apache.maven.plugin.MojoExecutionException: Error(s)
> found in bundle configuration
> at org.apache.felix.bundleplugin.BundlePlugin.execute
> (BundlePlugin.java:332)
> at org.apache.felix.bundleplugin.BundlePlugin.execute
> (BundlePlugin.java:172)
> at org.apache.felix.bundleplugin.BundlePlugin.execute
> (BundlePlugin.java:164)
> at org.apache.maven.plugin.DefaultPluginManager.executeMojo
> (DefaultPluginManager.java:447)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals
> (DefaultLifecycleExecutor.java:539)
> ... 16 more
> Caused by: org.apache.maven.plugin.MojoFailureException: Error(s)
> found in bundle configuration
> at org.apache.felix.bundleplugin.BundlePlugin.execute
> (BundlePlugin.java:302)
> ... 20 more
>
>
> Can someone help me?
> Thanks in advance.
> F. Metral
>
>
> -------------------------------------------------------------------
> Florent METRAL
> Ingénieur Expert - Projet SARDES
> INRIA Rhône-Alpes
> 655, avenue de l'Europe, Montbonnot
> 38334 St Ismier Cedex, France
> Mail: florent.metral@inrialpes.fr
> Tel: +33 4 76 61 52 80
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org