NullPointerException when trying to load class

2011-07-13 Thread Olivier Bigard

Hi,

We are using Felix 3.2.2 and sometimes following NPE occurs when Framework
tries to load a class during Bundle startup:

Caused by: java.lang.Exception: org.osgi.framework.BundleException:
Activator start error in bundle XXX [167].
at org.apache.felix.framework.Felix.activateBundle(Felix.java:1951)
at org.apache.felix.framework.Felix.startBundle(Felix.java:1822)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:927)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:914)
... 8 more
Caused by: java.lang.Exception: java.lang.NullPointerException: null
at
org.apache.felix.framework.ModuleImpl$ModuleClassLoader.findClass(ModuleImpl.java:1853)
at
org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:752)
at org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.java:72)
at
org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1807)
at java.lang.ClassLoader.loadClass(Unknown Source)
at
org.apache.felix.framework.ModuleImpl.getClassByDelegation(ModuleImpl.java:670)
at 
org.apache.felix.framework.Felix.createBundleActivator(Felix.java:3808)
at org.apache.felix.framework.Felix.activateBundle(Felix.java:1899)
... 12 more

I had a look at Felix sources and found that some ContextPath object seems
to be null...
Does anyone already got this error?

Thank you
Olivier
-- 
View this message in context: 
http://old.nabble.com/NullPointerException-when-trying-to-load-class-tp32052769p32052769.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



Re: iPojo - A methodID cannot be associated with a method from the POJO class

2011-05-12 Thread Olivier Bigard


Hi Clément,

Regarding your answer, is it planned to modify the source code in
InstanceManager class to change the log criticity from ERROR to INFO or
DEBUG as you suggested?

Thanks
Olivier


clement escoffier wrote:
 
 Hi,
 
 On 05.04.11 17:56, Cédric Casenove ccasen...@axway.com wrote:
 

Hi,

I encountered the error A methodID cannot be associated with a method
from
the POJO class.

I am using iPojo 1.6.4, and the error seems to happen when I specify a
factory method on my components (with annotation like
@Component(...,factory_method=getInstance)

I try to debug a little bit and I found that in the method
getMethodById(String methodId) of the InstanceManager where this message
is
logged, the methodId parameter contains the fully qualified name of my
class, not a method name. If I look at the createObject() method, when a
factory method is specified, this is indeed the classname that is passed
to
the onEntry() method (that seems to expect a method name).

I am not sure at all to understand what's really goes on in the code and
if
this strange parameter really causes the error.
 
 This message is not logged using the correct log level, should be INFO /
 DEBUG. You can safely ignore it.
 
 Regards,
 
 Clement
 

Thanks.
-- 
View this message in context:
http://old.nabble.com/iPojo---A-methodID-cannot-be-associated-with-a-metho
d-from-the-POJO-class-tp31325587p31325587.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org

 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
 For additional commands, e-mail: users-h...@felix.apache.org
 
 
 

-- 
View this message in context: 
http://old.nabble.com/iPojo---A-methodID-cannot-be-associated-with-a-method-from-the-POJO-class-tp31325587p31601063.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



ConfigAdmin and iPojo

2011-05-09 Thread Olivier Bigard

Hi all,

I've got a question regarding the OSGi ConfigAdmin service used in
association with iPojo.

Here is what I want to do:
I've got 2 Felix instances in my architecture.
One of these instances is currently running, the other one is stopped.
If I change some configurations in the running instance of Felix using the
ConfigAdmin service in association with iPojo, all my iPojo instances are
correctly created/updated in this Felix instance.

What I want when starting the second Felix instance is all the existing
iPojo instances to be updated with the same configuration (the one modified
in the first Felix instance) before starting.

Of course, to do that our application is responsible to store the
configuration of instances in a central repository to be accessible by all
my felix instances.

My question is: what is the best technical solution to update an iPojo
instance configuration before starting it?
Do I have to manually modify the configuration files in the cache folder
of the second Felix instance before starting it?

Thank you for your advices

Olivier
-- 
View this message in context: 
http://old.nabble.com/ConfigAdmin-and-iPojo-tp31574943p31574943.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



OSGi Deployment Admin

2011-05-04 Thread Olivier Bigard

Hi all,

We are currently having a look at the OSGi Deployment Admin service.
I found an implementation of it in Apache Felix sources (not released yet),
but also in a github project created by Clément. I'm testing this last
implementation.
I also found in this forum a previous thread saying that it would be a good
idea to merge the two.
My question is: is this merge done now? If no, when is it planned?

Thanks
Olivier
-- 
View this message in context: 
http://old.nabble.com/OSGi-Deployment-Admin-tp31541828p31541828.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



RE: iPojo inner class instrumentation

2011-01-31 Thread Olivier Bigard

Sorry, here are the attachments...
http://old.nabble.com/file/p30806605/ipojo.testcase.C1-0.0.1-SNAPSHOT.jar
ipojo.testcase.C1-0.0.1-SNAPSHOT.jar 
http://old.nabble.com/file/p30806605/ipojo.testcase.C2-0.0.1-SNAPSHOT.jar
ipojo.testcase.C2-0.0.1-SNAPSHOT.jar 
http://old.nabble.com/file/p30806605/ipojo.testcase.C3-0.0.1-SNAPSHOT.jar
ipojo.testcase.C3-0.0.1-SNAPSHOT.jar 
http://old.nabble.com/file/p30806605/ipojo.testcase.C4-0.0.1-SNAPSHOT.jar
ipojo.testcase.C4-0.0.1-SNAPSHOT.jar 


Olivier Bigard wrote:
 
 Hi Clément,
 
 We tried to execute your sample in our environment: it produced the same
 error described below.
 We just modified a little your sources to make them run: we add a C4
 Bundle that contains an iPojo instance that calls C3 getFilter() method
 in its validate callback.
 We created one OSGi Bundle per component.
 You can find these 4 OSGi Bundles in attachments.
 Can you try to do following:
   - start the 4 Bundles (C4 validate callback is correctly called) - 
 My
 filter ... called is produced in standard output
   - stop C1 and C2 Bundles
   - restart C1 and C2 Bundles
   - validate callback is not correctly called - only My filter ... is
 produced in standard output and the stacktrace below is produced
 
 Thanks
 Olivier
 
 -Message d'origine-
 De : Clement Escoffier [mailto:clement.escoff...@gmail.com] 
 Envoyé : vendredi 28 janvier 2011 17:28
 À : Apache Felix - Users Mailing List
 Objet : Re: iPojo inner class instrumentation
 
 Hi,
 
 Invalid Bundle Context means that the bundle is stopping or already
 stopped, and so is not able to access the service registry anymore. Is it
 your case?
 
 Regards,
 
 Clement
 
 On 28.01.11 17:11, Bigard Olivier obig...@axway.com wrote:
 
Hi Clément,

Sorry to answer so late, but we just test your proposal.

We tried to disable proxy on C2 as suggested below, but no positive
effect.

After that we tried to test our use-case with last 1.8.0 iPojo version.
We still had an exception, but with more information. Here it is:

java.lang.IllegalStateException: Cannot create the Nullable object,
an unexpected error occurs: Invalid BundleContext.
at
org.apache.felix.ipojo.handlers.dependency.Dependency.createNullableObject
(Dependency.java:377)
at
org.apache.felix.ipojo.handlers.dependency.Dependency.createServiceObject(
Dependency.java:656)
at
org.apache.felix.ipojo.handlers.dependency.Dependency.onGet(Dependency.jav
a:632)
at
org.apache.felix.ipojo.InstanceManager.onGet(InstanceManager.java:1035)
at
c4z.usecase.consumer.UseCaseConsumer.__getprovider(UseCaseConsumer.java)
at
c4z.usecase.consumer.UseCaseConsumer.__authenticate(UseCaseConsumer.java:3
7)
at
c4z.usecase.consumer.UseCaseConsumer.authenticate(UseCaseConsumer.java)
at
c4z.usecase.rest.RestApiProviderKO$1.authenticate(RestApiProviderKO.java:6
7)
at
c4z.usecase.rest.MyRestApiListener.__addApi(MyRestApiListener.java:49)
at
c4z.usecase.rest.MyRestApiListener.addApi(MyRestApiListener.java)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorIm
pl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.apache.felix.ipojo.util.Callback.call(Callback.java:237)
at
org.apache.felix.ipojo.handlers.dependency.DependencyCallback.call(Depende
ncyCallback.java:237)
at
org.apache.felix.ipojo.handlers.dependency.Dependency.invokeCallback(Depen
dency.java:312)
at
org.apache.felix.ipojo.handlers.dependency.Dependency.callBindMethod(Depen
dency.java:354)
at
org.apache.felix.ipojo.handlers.dependency.Dependency.onServiceArrival(Dep
endency.java:475)
at
org.apache.felix.ipojo.util.DependencyModel.manageArrival(DependencyModel.
java:392)
at
org.apache.felix.ipojo.util.DependencyModel.addedService(DependencyModel.j
ava:335)
at
org.apache.felix.ipojo.util.Tracker$Tracked.trackAdding(Tracker.java:725)
at
org.apache.felix.ipojo.util.Tracker$Tracked.track(Tracker.java:686)
at
org.apache.felix.ipojo.util.Tracker$Tracked.serviceChanged(Tracker.java:64
7)
at
org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallb
ack(EventDispatcher.java:864)
at
org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(Event
Dispatcher.java:732)
at
org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDisp
atcher.java:662)
at
org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:3726)
at
org.apache.felix.framework.Felix.access$000