David Conde | 1 Jun 14:57
Picon
Favicon

Testing bundles with Pax Exam

HI everyone,

 

I have been trying use Pax Exam in order to test my bundles running on Equinox without using Maven, but I got dependencies errors so I could not get any result for testing my bundles.

 

Have anybody tried with Pax Exam for Eclipse without Maven? Do you know any other way to test bundles on Equinox using JUnit?

 

Thank you in advance

 

Regards

 

--

David Conde Baena

CITIC
Centro Andaluz de Innovación y Tecnologías de la Información y las Comunicaciones
Edificio CITIC, C/ Marie Curie, 6
Parque Tecnológico de Andalucía
29590 - Campanillas (MÁLAGA)

Tfno.: +34 952028610
Fax: +34 951231029
Email: dconde-fzAlJQVsllk@public.gmane.org
Web: www.citic.es

 

 

Laidlaw, Don | 1 Jun 15:10
Favicon

Re: Testing bundles with Pax Exam

PAX Exam does not require Maven to run, but it is easier to use maven because maven makes it easier to collect all your transient dependencies into a common repository.

Whether using Maven or not, you need to make sure you provision all the bundles required by the test code being run, including the transient dependencies. If you are getting ClassNotFound exceptions then there are probably bundles required that are not provisioned.

Provisioning happens in the config() method you must add to your test class. It will look something like:

<at> Configuration    public static Option[] config() {        return options(                frameworks(equinox()),                provision(bundle( "file:///Some/bundle/to/add/bundle.jar"),
                provision(bundle(“http://host/some/other/bundle.jar”)
      );
    }

The Spring framework also has a good integration testing framework using Junit, and I use that most times. But it is definitely a lot easier to work with when using Maven as well. If you need to do a lot of integration testing and use the Spring Framework I would definitely recommend looking into their framework. And if you want to see how to use Maven to automatically manage all your transient dependencies for the test you can check out my blog post on the topic at: http://yetanotherway.blogspot.com/

No matter which way you choose to integration test your bundles in the OSGi container, Maven can really help you by making it easy to collect the transient dependencies for you, even if you do not use maven for any other purpose!


--
Best Regards,

Don Laidlaw | Sr. Research Engineer |
Infor | office: +1 902-576-5185 | mobile: +1 902-401-6771 | don.laidlaw-wzDqe+/AE4kAvxtiuMwx3w@public.gmane.org



From: David Conde <dconde-fzAlJQVsllk@public.gmane.org>
Reply-To: Equinox development mailing list <equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>
Date: Mon, 1 Jun 2009 14:57:30 +0200
To: 'Equinox development mailing list' <equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>
Subject: [equinox-dev] Testing bundles with Pax Exam

HI everyone,
 
I have been trying use Pax Exam in order to test my bundles running on Equinox without using Maven, but I got dependencies errors so I could not get any result for testing my bundles.
 
Have anybody tried with Pax Exam for Eclipse without Maven? Do you know any other way to test bundles on Equinox using JUnit?
 
Thank you in advance
 
Regards
 
--
David Conde Baena

  
CITIC
 Centro Andaluz de Innovación y Tecnologías de la Información y las Comunicaciones
Edificio CITIC, C/ Marie Curie, 6
 Parque Tecnológico de Andalucía
 29590 - Campanillas (MÁLAGA)
  Tfno.: +34 952028610
 Fax: +34 951231029
 Email:
dconde-fzAlJQVsllk@public.gmane.org <mailto:usuario-fzAlJQVsllk@public.gmane.org>
 Web: www.citic.es <http://www.citic.es/>  
 

 

_______________________________________________
equinox-dev mailing list
equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org
https://dev.eclipse.org/mailman/listinfo/equinox-dev
Alin Dreghiciu | 1 Jun 16:05
Picon
Gravatar

Re: Testing bundles with Pax Exam

As this has been asked now more times I will take some time to write a guide about using Pax Exam without Maven in Eclipse.

Stay tuned.

On Mon, Jun 1, 2009 at 3:57 PM, David Conde <dconde-fzAlJQVsllk@public.gmane.org> wrote:

HI everyone,

 

I have been trying use Pax Exam in order to test my bundles running on Equinox without using Maven, but I got dependencies errors so I could not get any result for testing my bundles.

 

Have anybody tried with Pax Exam for Eclipse without Maven? Do you know any other way to test bundles on Equinox using JUnit?

 

Thank you in advance

 

Regards

 

--

David Conde Baena

CITIC
Centro Andaluz de Innovación y Tecnologías de la Información y las Comunicaciones
Edificio CITIC, C/ Marie Curie, 6
Parque Tecnológico de Andalucía
29590 - Campanillas (MÁLAGA)

Tfno.: +34 952028610
Fax: +34 951231029
Email: dconde-fzAlJQVsllk@public.gmane.org
Web: www.citic.es

 

 


_______________________________________________
equinox-dev mailing list
equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org
https://dev.eclipse.org/mailman/listinfo/equinox-dev




--
Alin Dreghiciu
Software Developer - Looking for new projects!
My profile: http://www.linkedin.com/in/alindreghiciu
My blog: http://adreghiciu.blogspot.com
http://www.ops4j.org - New Energy for OSS Communities - Open Participation Software.
http://www.qi4j.org - New Energy for Java - Domain Driven Development.
Thomas Watson | 1 Jun 16:18
Picon
Favicon

Re: Help Request - Equinox error when starting Eclipse - crash

This error usually occurs because the org.eclipse.core.runtime bundle is not resolved or did not start correctly for some reason. Did you update eclipse recently?

You can try starting with -console -noExit and then running the "ss" command at the osgi> prompt to see what bundles are installed and what is resolved. You can also run the command "diag org.eclipse.core.runtime" to see why the core.runtime bundle is not resolved if that is the problem.

I suggest you open a bug against Equinox to track the issue.

Tom



"Razvan Hrestic" ---05/30/2009 02:52:07 PM---Hi all, I’m hoping someone could help me with this error I’ve been suddenly getting out of the blue.


From:

"Razvan Hrestic" <razvanh <at> gmail.com>

To:

<equinox-dev <at> eclipse.org>

Date:

05/30/2009 02:52 PM

Subject:

[equinox-dev] Help Request - Equinox error when starting Eclipse - crash



Hi all, I’m hoping someone could help me with this error I’ve been suddenly getting out of the blue.

!SESSION 2009-05-30 21:18:26.150 -----------------------------------------------
eclipse.buildId=M20090211-1700
java.version=1.6.0_12
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Command-line arguments: -os win32 -ws win32 -arch x86

!ENTRY org.eclipse.osgi 4 0 2009-05-30 21:18:26.876
!MESSAGE Application error
!STACK 1
java.lang.IllegalStateException: Unable to acquire application service. Ensure that the org.eclipse.core.runtime bundle is resolved and started (see config.ini).
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:74)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:386)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)


and this is the config.ini file:

#This configuration file was written by: org.eclipse.equinox.internal.frameworkadmin.equinox.EquinoxFwConfigFileParser
#Fri May 29 21:30:25 CEST 2009
osgi.launcherPath=.
org.eclipse.update.reconcile=false
eclipse.p2.profile=SDKProfile
osgi.instance.area.default= <at> user.home/workspace
osgi.framework=file\:plugins\\org.eclipse.osgi_3.4.3.R34x_v20081215-1030.jar
eclipse.buildId=M20090211-1700
osgi.bundles=reference\:file\:org.eclipse.equinox.weaving.hook_1.0.0.200901261628.jar <at> 4,reference\:file\:org.eclipse.equinox.simpleconfigurator_1.0.0.v20080604.jar <at> 1\:start
org.eclipse.equinox.simpleconfigurator.configUrl=file\:org.eclipse.equinox.simpleconfigurator\\bundles.info
eclipse.product=org.eclipse.sdk.ide
osgi.splashPath=platform\:/base/plugins/org.eclipse.platform
osgi.launcherIni=eclipse
eclipse.p2.data.area= <at> config.dir/../p2
osgi.bundles.defaultStartLevel=4

Could anyone help me work out why eclipse won’t start and how to fix it, maybe also explain “why” it just happened and point me to some web resources to understand more in the future about the causes of such issues? I’m not new to eclipse but I don’t even know where to begin understanding how it works and how to interpret it’s errors.

Thanks a lot in advance!

Razvan
_______________________________________________
equinox-dev mailing list
equinox-dev <at> eclipse.org
https://dev.eclipse.org/mailman/listinfo/equinox-dev


Thomas Watson | 1 Jun 21:31
Picon
Favicon

One more fix in DS for today's RC4 build.

There is one bug in DS that we are fixing for RC4. The bug is safe and simple to fix.

The map file has been updated for the following Bug changes:
+ Bug 278333. IllegalArgumentException when signature of unbind method differs from the bind method signature (FIXED)

The following projects have changed:
org.eclipse.equinox.ds
org.eclipse.osgi.tests

Tom

_______________________________________________
platform-releng-dev mailing list
platform-releng-dev@...
https://dev.eclipse.org/mailman/listinfo/platform-releng-dev
Thomas Watson | 2 Jun 19:27
Picon
Favicon

Cancel Equinox call today

We are all busy with 3.5 docs and closing out RC4. Unless someone has items to add to the agenda I suggest we cancel the Equinox call today. Please ping the team on equinox-dev IRC or mailing list if there are urgent items to discuss for 3.5.

Thanks.

Tom

David Conde | 3 Jun 13:01
Picon
Favicon

Using Log4J in Equinox framework

Hi,

 

I have been trying to use org.apache.lo4j jar in Equinox but I got an exception :

 

Java.lang.Error Unresolved compilation problems:

 

The import org.apache cannot be resolved

….

 

My framework is not able either to recognize or load this library.

 

I have in my Activator. Java  the next one:

 

import org.apache.log4j.Logger;

import org.apache.log4j.PropertyConfigurator;

 

Furthermore, I included org.apache.log4j.jar in my classpath, either I installed this library like a bundle. I also tried to install the bundle from Orbit which implemented log4J, but I always have the same result.

 

Does anyone know what I have to do to use org.apache.log4J in Equinox?

 

I have either include import org.apache.log4j in Manifest.MF, I guess that there is a way to load external libraries in Equinox framework, other times I tried directly installing the jar file and it was fine, but with org.apache.lo4j jar there is no way to get a good result.

 

Any idea?

 

I am using Equinox by Console, not through Eclipse.

 

Thank you in advance

 

Laidlaw, Don | 3 Jun 14:40
Favicon

Re: Using Log4J in Equinox framework

PAX Logging at http://wiki.ops4j.org/display/paxlogging/Pax+Logging is a good solution, and the one I use. Another good solution is SLF4J at http://www.slf4j.org/.

Both of those implement the log4j logging API and use standard log4j configuration property/xml formats for configuration, which is convenient if that is what you know.

Both of those also implement Commons Logging and other logging APIs making it very convenient in an OSGi container!
--
Best Regards,

Don Laidlaw | Sr. Research Engineer |
Infor | office: +1 902-576-5185 | mobile: +1 902-401-6771 | don.laidlaw-wzDqe+/AE4kAvxtiuMwx3w@public.gmane.org



From: David Conde <dconde-fzAlJQVsllk@public.gmane.org>
Reply-To: Equinox development mailing list <equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>
Date: Wed, 3 Jun 2009 13:01:18 +0200
To: 'Equinox development mailing list' <equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>
Subject: [equinox-dev] Using Log4J in Equinox framework

Hi,
 
I have been trying to use org.apache.lo4j jar in Equinox but I got an exception :
 
Java.lang.Error Unresolved compilation problems:
 
The import org.apache cannot be resolved
….
 
My framework is not able either to recognize or load this library.
 
I have in my Activator. Java  the next one:
 
import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;
 
Furthermore, I included org.apache.log4j.jar in my classpath, either I installed this library like a bundle. I also tried to install the bundle from Orbit which implemented log4J, but I always have the same result.
 
Does anyone know what I have to do to use org.apache.log4J in Equinox?
 
I have either include import org.apache.log4j in Manifest.MF, I guess that there is a way to load external libraries in Equinox framework, other times I tried directly installing the jar file and it was fine, but with org.apache.lo4j jar there is no way to get a good result.
 
Any idea?
 
I am using Equinox by Console, not through Eclipse.
 
Thank you in advance


_______________________________________________
equinox-dev mailing list
equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org
https://dev.eclipse.org/mailman/listinfo/equinox-dev
David Conde | 4 Jun 10:28
Picon
Favicon

RE: Using Log4J in Equinox framework

Hi, thank you very much for your answer.

 

I have tried to download the Pax Logging binary file but I have got error with the web site.

 

If I am not wrong, the idea would be included paxlogging bundle as a required bundle, in order to get the libraries log4j and common-logging, to launch this bundle and use in my bundle log4j as the same way as I did without Equinox I mean in normal java applications, am I missing anything?

 

By the way, why I can’t to load the library org.apache.log4j.jar in my bundle and simply to use it? If I have to use other external libraries, what would I have to do in order to be able to use in Equinox framework?

 

Thank you in advance

 

Regards

 

 

De: equinox-dev-bounces-j9T/66MeVpFAfugRpC6u6w@public.gmane.org [mailto:equinox-dev-bounces-j9T/66MeVpFAfugRpC6u6w@public.gmane.org] En nombre de Laidlaw, Don
Enviado el: miércoles, 03 de junio de 2009 14:40
Para: Equinox development mailing list
Asunto: Re: [equinox-dev] Using Log4J in Equinox framework

 

PAX Logging at http://wiki.ops4j.org/display/paxlogging/Pax+Logging is a good solution, and the one I use. Another good solution is SLF4J at http://www.slf4j.org/.

Both of those implement the log4j logging API and use standard log4j configuration property/xml formats for configuration, which is convenient if that is what you know.

Both of those also implement Commons Logging and other logging APIs making it very convenient in an OSGi container!
--
Best Regards,

Don Laidlaw | Sr. Research Engineer |
Infor | office: +1 902-576-5185 | mobile: +1 902-401-6771 | don.laidlaw-wzDqe+/AE4kAvxtiuMwx3w@public.gmane.org


From: David Conde <dconde-fzAlJQVsllk@public.gmane.org>
Reply-To: Equinox development mailing list <equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>
Date: Wed, 3 Jun 2009 13:01:18 +0200
To: 'Equinox development mailing list' <equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>
Subject: [equinox-dev] Using Log4J in Equinox framework

Hi,
 
I have been trying to use org.apache.lo4j jar in Equinox but I got an exception :
 
Java.lang.Error Unresolved compilation problems:
 
The import org.apache cannot be resolved
….
 
My framework is not able either to recognize or load this library.
 
I have in my Activator. Java  the next one:
 
import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;
 
Furthermore, I included org.apache.log4j.jar in my classpath, either I installed this library like a bundle. I also tried to install the bundle from Orbit which implemented log4J, but I always have the same result.
 
Does anyone know what I have to do to use org.apache.log4J in Equinox?
 
I have either include import org.apache.log4j in Manifest.MF, I guess that there is a way to load external libraries in Equinox framework, other times I tried directly installing the jar file and it was fine, but with org.apache.lo4j jar there is no way to get a good result.
 
Any idea?
 
I am using Equinox by Console, not through Eclipse.
 
Thank you in advance

_______________________________________________
equinox-dev mailing list
equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org
https://dev.eclipse.org/mailman/listinfo/equinox-dev

林恺 | 4 Jun 11:45
Picon

Re: Using Log4J in Equinox framework


On Thu, Jun 4, 2009 at 4:28 PM, David Conde <dconde-fzAlJQVsllk@public.gmane.org> wrote:

Hi, thank you very much for your answer.

 

I have tried to download the Pax Logging binary file but I have got error with the web site.

 

If I am not wrong, the idea would be included paxlogging bundle as a required bundle, in order to get the libraries log4j and common-logging, to launch this bundle and use in my bundle log4j as the same way as I did without Equinox I mean in normal java applications, am I missing anything?

 

By the way, why I can’t to load the library org.apache.log4j.jar in my bundle and simply to use it? If I have to use other external libraries, what would I have to do in order to be able to use in Equinox framework?

I think the simplest way you want is to change a log4j Jar file to a log4j bundle. Just create a new bundle project, put log4j.jar in the bundle directory, add log4j.jar to the project build path, export all the packages in log4j.jar,(through Export-Package in bundle's MANIFEST.MF), add log4j to the bundle class path (through Bundle-Classpath in bundle's MANIFEST.MF). And then you get a log4j bundle which can run on Equinox.
 
You want to use log4j APIs, just import log4j package in other bundle (through Import-Package in bundle's MANIFEST.MF) and use it directly. But in this way, loading of the configuration file log4j.properties is a problem. log4j.properties can locate in the jar bundle or use a argument to figure it out.

So using pax log is a better way to resolve the class loader problem.

Thank you in advance

 

Regards

 

 

De: equinox-dev-bounces-j9T/66MeVpFAfugRpC6u6w@public.gmane.org [mailto:equinox-dev-bounces-j9T/66MeVpFAfugRpC6u6w@public.gmane.org] En nombre de Laidlaw, Don
Enviado el: miércoles, 03 de junio de 2009 14:40
Para: Equinox development mailing list
Asunto: Re: [equinox-dev] Using Log4J in Equinox framework

 

PAX Logging at http://wiki.ops4j.org/display/paxlogging/Pax+Logging is a good solution, and the one I use. Another good solution is SLF4J at http://www.slf4j.org/.

Both of those implement the log4j logging API and use standard log4j configuration property/xml formats for configuration, which is convenient if that is what you know.

Both of those also implement Commons Logging and other logging APIs making it very convenient in an OSGi container!
--
Best Regards,

Don Laidlaw | Sr. Research Engineer |
Infor | office: +1 902-576-5185 | mobile: +1 902-401-6771 | don.laidlaw-wzDqe+/AE4kAvxtiuMwx3w@public.gmane.org


From: David Conde <dconde <at> citic.es>
Reply-To: Equinox development mailing list <equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>
Date: Wed, 3 Jun 2009 13:01:18 +0200
To: 'Equinox development mailing list' <equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org>
Subject: [equinox-dev] Using Log4J in Equinox framework

Hi,
 
I have been trying to use org.apache.lo4j jar in Equinox but I got an exception :
 
Java.lang.Error Unresolved compilation problems:
 
The import org.apache cannot be resolved
….
 
My framework is not able either to recognize or load this library.
 
I have in my Activator. Java  the next one:
 
import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;
 
Furthermore, I included org.apache.log4j.jar in my classpath, either I installed this library like a bundle. I also tried to install the bundle from Orbit which implemented log4J, but I always have the same result.
 
Does anyone know what I have to do to use org.apache.log4J in Equinox?
 
I have either include import org.apache.log4j in Manifest.MF, I guess that there is a way to load external libraries in Equinox framework, other times I tried directly installing the jar file and it was fine, but with org.apache.lo4j jar there is no way to get a good result.
 
Any idea?
 
I am using Equinox by Console, not through Eclipse.
 
Thank you in advance

_______________________________________________
equinox-dev mailing list
equinox-dev <at> eclipse.org
https://dev.eclipse.org/mailman/listinfo/equinox-dev


_______________________________________________
equinox-dev mailing list
equinox-dev-j9T/66MeVpFAfugRpC6u6w@public.gmane.org
https://dev.eclipse.org/mailman/listinfo/equinox-dev



Gmane