You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by teemu kanstren <tk...@gmail.com> on 2011/02/27 19:04:26 UTC

pax exam and felix

Hello all,

 I have been trying to learn to use Pax Exam with Felix but without much
success. My latest issue is that I get the error

java.lang.NoSuchMethodError:
org.apache.felix.framework.ServiceRegistry.<init>(Lorg/apache/felix/framework/Logger;)V
at org.ops4j.pax.runner.Run.createContext(Run.java:255)

and looking at the Felix sources for ServiceRegistry I see

    public ServiceRegistry(Logger logger, ServiceRegistryCallbacks
callbacks)

and the failing line 255 from Run in pax

        final ServiceRegistry serviceRegistry = new ServiceRegistry( null );

since there is no single argument constructor for ServiceRegistry in Felix
(as expected by Pax Exam), it seems to me that this is what the error is
for.

So what am I doing wrong? Maybe it is my environment, since I do not use
Maven and I had to manually go hunt and pick all the dependencies for Pax.
As these are not listed anywhere, maybe I got something wrong?

I have
-Felix 3.0.8
-commons-discovery-0.4.jar
-ops4j-base-lang-1.2.0.jar
-ops4j-base-store-1.2.0.jar
-pax-exam-1.2.3.jar
-pax-exam-container-default-1.2.3.jar
-pax-exam-container-rbc-1.2.3.jar
-pax-exam-container-rbc-client-1.2.3.jar
-pax-exam-junit-1.2.3.jar
-pax-exam-runtime-1.2.3.jar
-pax-exam-spi-1.2.3.jar
-pax-runner-1.5.0.jar

I have tried with frameworks(felix()) and
frameworks(felix().version("3.0.8")) options in my pax @Configuration
method. But no change. Perhaps I am missing how pax would try to change the
code to create the container based on this configuration and thus am not
configuring something as needed?

Any ideas?

Thanks,
Teemu

Re: pax exam and felix

Posted by Allen Lau <al...@gmail.com>.
The current Pax Exam loads it's only Felix libraries until 3.0.2 I
believe.   It doesn't work with the new Felix versions yet, so take out your
3.0.8 jar and that should work.

Allen

On Sun, Feb 27, 2011 at 10:04 AM, teemu kanstren <tk...@gmail.com>wrote:

> Hello all,
>
>  I have been trying to learn to use Pax Exam with Felix but without much
> success. My latest issue is that I get the error
>
> java.lang.NoSuchMethodError:
>
> org.apache.felix.framework.ServiceRegistry.<init>(Lorg/apache/felix/framework/Logger;)V
> at org.ops4j.pax.runner.Run.createContext(Run.java:255)
>
> and looking at the Felix sources for ServiceRegistry I see
>
>    public ServiceRegistry(Logger logger, ServiceRegistryCallbacks
> callbacks)
>
> and the failing line 255 from Run in pax
>
>        final ServiceRegistry serviceRegistry = new ServiceRegistry( null );
>
> since there is no single argument constructor for ServiceRegistry in Felix
> (as expected by Pax Exam), it seems to me that this is what the error is
> for.
>
> So what am I doing wrong? Maybe it is my environment, since I do not use
> Maven and I had to manually go hunt and pick all the dependencies for Pax.
> As these are not listed anywhere, maybe I got something wrong?
>
> I have
> -Felix 3.0.8
> -commons-discovery-0.4.jar
> -ops4j-base-lang-1.2.0.jar
> -ops4j-base-store-1.2.0.jar
> -pax-exam-1.2.3.jar
> -pax-exam-container-default-1.2.3.jar
> -pax-exam-container-rbc-1.2.3.jar
> -pax-exam-container-rbc-client-1.2.3.jar
> -pax-exam-junit-1.2.3.jar
> -pax-exam-runtime-1.2.3.jar
> -pax-exam-spi-1.2.3.jar
> -pax-runner-1.5.0.jar
>
> I have tried with frameworks(felix()) and
> frameworks(felix().version("3.0.8")) options in my pax @Configuration
> method. But no change. Perhaps I am missing how pax would try to change the
> code to create the container based on this configuration and thus am not
> configuring something as needed?
>
> Any ideas?
>
> Thanks,
> Teemu
>

Re: pax exam and felix

Posted by Alex Karasulu <ak...@apache.org>.
On Sun, Feb 27, 2011 at 8:31 PM, Richard S. Hall <he...@ungoverned.org> wrote:
> Not sure why Pax Exam would depend on internal framework API, but the last
> framework version to have that single parameter constructor was 1.8.1...
>
> -> richard
>
> On 2/27/11 13:04, teemu kanstren wrote:
>>
>> Hello all,
>>
>>  I have been trying to learn to use Pax Exam with Felix but without much
>> success. My latest issue is that I get the error
>>
>> java.lang.NoSuchMethodError:
>>
>> org.apache.felix.framework.ServiceRegistry.<init>(Lorg/apache/felix/framework/Logger;)V
>> at org.ops4j.pax.runner.Run.createContext(Run.java:255)
>>
>> and looking at the Felix sources for ServiceRegistry I see
>>
>>     public ServiceRegistry(Logger logger, ServiceRegistryCallbacks
>> callbacks)

Yes I had the same issue. I think pax-exam is using a version of the
runner that's somewhat outdated. I actually checked out their code to
fix this but could not get automated registration to work so I can
commit back. Since then I just did not bother working with it because
of a lack of time.

The runner depends on internal Felix classes yes because it launches
Felix although now with the Framework factory it may no long need to
bother.

Regards,
Alex

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


Re: pax exam and felix

Posted by "Richard S. Hall" <he...@ungoverned.org>.
Not sure why Pax Exam would depend on internal framework API, but the 
last framework version to have that single parameter constructor was 
1.8.1...

-> richard

On 2/27/11 13:04, teemu kanstren wrote:
> Hello all,
>
>   I have been trying to learn to use Pax Exam with Felix but without much
> success. My latest issue is that I get the error
>
> java.lang.NoSuchMethodError:
> org.apache.felix.framework.ServiceRegistry.<init>(Lorg/apache/felix/framework/Logger;)V
> at org.ops4j.pax.runner.Run.createContext(Run.java:255)
>
> and looking at the Felix sources for ServiceRegistry I see
>
>      public ServiceRegistry(Logger logger, ServiceRegistryCallbacks
> callbacks)
>
> and the failing line 255 from Run in pax
>
>          final ServiceRegistry serviceRegistry = new ServiceRegistry( null );
>
> since there is no single argument constructor for ServiceRegistry in Felix
> (as expected by Pax Exam), it seems to me that this is what the error is
> for.
>
> So what am I doing wrong? Maybe it is my environment, since I do not use
> Maven and I had to manually go hunt and pick all the dependencies for Pax.
> As these are not listed anywhere, maybe I got something wrong?
>
> I have
> -Felix 3.0.8
> -commons-discovery-0.4.jar
> -ops4j-base-lang-1.2.0.jar
> -ops4j-base-store-1.2.0.jar
> -pax-exam-1.2.3.jar
> -pax-exam-container-default-1.2.3.jar
> -pax-exam-container-rbc-1.2.3.jar
> -pax-exam-container-rbc-client-1.2.3.jar
> -pax-exam-junit-1.2.3.jar
> -pax-exam-runtime-1.2.3.jar
> -pax-exam-spi-1.2.3.jar
> -pax-runner-1.5.0.jar
>
> I have tried with frameworks(felix()) and
> frameworks(felix().version("3.0.8")) options in my pax @Configuration
> method. But no change. Perhaps I am missing how pax would try to change the
> code to create the container based on this configuration and thus am not
> configuring something as needed?
>
> Any ideas?
>
> Thanks,
> Teemu
>

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


Re: pax exam and felix

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Sun, Feb 27, 2011 at 7:04 PM, teemu kanstren <tk...@gmail.com> wrote:
>  I have been trying to learn to use Pax Exam with Felix but without much
> success...

FWIW we do use Pax Exam with Felix in Sling, see for example
http://svn.apache.org/repos/asf/sling/trunk/installer/it

but that might not use the very latest versions of those tools.

-Bertrand

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