Having some problems...

103 views
Skip to first unread message

Gauthier

unread,
Jun 4, 2009, 7:59:08 AM6/4/09
to Tapestry-OSGi
Hi there,

I'm working on an OSGi project and I would like to use Tapestry-OSGi
(very good idea to implement this framework onto OSGi) but I have
encountered some problems. It works very well inside Eclipse (your
example or my app) but outside Eclipse it gave me this error:

org.osgi.framework.BundleException: Exception in
org.extwind.osgi.tapestry.firstpage.internal.Activator.start() of
bundle org.extwind.osgi.tapestry.firstpage.
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator
(BundleContextImpl.java:805)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.start
(BundleContextImpl.java:754)
at
org.eclipse.osgi.framework.internal.core.BundleHost.startWorker
(BundleHost.java:352)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.start
(AbstractBundle.java:280)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.start
(AbstractBundle.java:272)
at
org.eclipse.osgi.framework.internal.core.FrameworkCommandProvider._start
(FrameworkCommandProvider.java:253)
at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.execute
(FrameworkCommandInterpreter.java:155)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand
(FrameworkConsole.java:303)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.console
(FrameworkConsole.java:288)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.run
(FrameworkConsole.java:224)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException: A null service reference is
not allowed.
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.getService
(BundleContextImpl.java:659)
at org.extwind.osgi.tapestry.firstpage.internal.Activator.start
(Activator.java:14)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl
$1.run(BundleContextImpl.java:782)
at java.security.AccessController.doPrivileged(Native Method)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator
(BundleContextImpl.java:773)
... 13 more
Nested Exception:
java.lang.NullPointerException: A null service reference is not
allowed.
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.getService
(BundleContextImpl.java:659)
at org.extwind.osgi.tapestry.firstpage.internal.Activator.start
(Activator.java:14)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl
$1.run(BundleContextImpl.java:782)
at java.security.AccessController.doPrivileged(Native Method)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator
(BundleContextImpl.java:773)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.start
(BundleContextImpl.java:754)
at
org.eclipse.osgi.framework.internal.core.BundleHost.startWorker
(BundleHost.java:352)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.start
(AbstractBundle.java:280)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.start
(AbstractBundle.java:272)
at
org.eclipse.osgi.framework.internal.core.FrameworkCommandProvider._start
(FrameworkCommandProvider.java:253)
at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.execute
(FrameworkCommandInterpreter.java:155)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand
(FrameworkConsole.java:303)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.console
(FrameworkConsole.java:288)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.run
(FrameworkConsole.java:224)
at java.lang.Thread.run(Unknown Source)
Nested Exception:
java.lang.NullPointerException: A null service reference is not
allowed.
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.getService
(BundleContextImpl.java:659)
at org.extwind.osgi.tapestry.firstpage.internal.Activator.start
(Activator.java:14)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl
$1.run(BundleContextImpl.java:782)
at java.security.AccessController.doPrivileged(Native Method)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator
(BundleContextImpl.java:773)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.start
(BundleContextImpl.java:754)
at
org.eclipse.osgi.framework.internal.core.BundleHost.startWorker
(BundleHost.java:352)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.start
(AbstractBundle.java:280)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.start
(AbstractBundle.java:272)
at
org.eclipse.osgi.framework.internal.core.FrameworkCommandProvider._start
(FrameworkCommandProvider.java:253)
at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.execute
(FrameworkCommandInterpreter.java:155)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand
(FrameworkConsole.java:303)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.console
(FrameworkConsole.java:288)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.run
(FrameworkConsole.java:224)
at java.lang.Thread.run(Unknown Source)

Could you explain me why it doesn't work ?

Thanks for your help.

With best regards,
--
Gauthier

donf yang

unread,
Jun 4, 2009, 10:05:47 PM6/4/09
to tapest...@googlegroups.com
This means osgi-service [org.extwind.osgi.tapestry.ComponentService] has not been registered.
 
Check if (only) all of the following bundles are in state [ACTIVE]
 
Framework is launched.
id State       Bundle
0 ACTIVE      org.eclipse.osgi_3.4.2.R34x_v20080826-1230
1 ACTIVE      org.extwind.osgi.bundles.commons.logging_1.0.4.v20080605-1930
2 ACTIVE      org.extwind.osgi.equinox.http.jetty6_1.0.0
3 ACTIVE      org.extwind.osgi.tapestry_5.0.18
4 ACTIVE      org.extwind.osgi.bundles.mortbay.jetty6_6.1.17
5 ACTIVE      org.extwind.osgi.bundles.javax.servlet_2.5.0
6 ACTIVE      org.extwind.osgi.bundles.tapestry_5.0.18
7 ACTIVE      org.extwind.osgi.http.filter_1.0.0
8 ACTIVE      org.extwind.osgi.bundles.javassist_3.10.0
9 ACTIVE      org.eclipse.equinox.http.servlet_1.0.100.v20080427-0830
10 ACTIVE      org.apache.commons.codec_1.3.0.v20080530-1600
11 ACTIVE      org.eclipse.osgi.services_3.1.200.v20071203
12 ACTIVE      org.extwind.osgi.tapestry.firstpage_1.0.0
osgi>

By the way, configuration file META-INF\extwind\component.xml has been introduced for component bundle definition,  to take the place of any codes for tapestry-services registry in Activator of bundle, and a sample OSGi-Console is in programming, check it in svn.
 
 
--
Gauthier

--

Regards,

Donf Yang
------------------------------------------------------------------------------
To be surprised,to wonder,is to begin to understand.

Gauthier

unread,
Jun 5, 2009, 7:33:32 AM6/5/09
to Tapestry-OSGi
Hi,

first of all, thanks a lot for your help :-)

That's exactly what I have in my OSGi console (even with an another
version of Equinox).
The previous-published error is due to this line of code:

ServiceReference sr = context.getServiceReference
(org.extwind.osgi.tapestry.ComponentService.class.getName());

So it confirms that my service is not registered but I don't
understand why.

Regards,
---
Gauthier

donf yang

unread,
Jun 5, 2009, 8:06:26 AM6/5/09
to tapest...@googlegroups.com
Service[org.extwind.osgi.tapestry.ComponentService] was published by bundle org.extwind.osgi.tapestry, used to register component bundle's root package into tapestry, which as the definition of context-param "tapestry.app-package" in web.xml.
 
Therefore the exception you encountered is probably caused by some errors bring the state of bundle org.extwind.osgi.tapestry_5.0.18 out of ACTIVE.
 
Reply all
Reply to author
Forward
0 new messages