Can I find any sample of latest PAX Exam for testing OSGi declarative service bundle with Java 8? - osgi-bundle

I am trying to create test environment with latest pax-exam-container-forked and Java 8, but there are many conflicts but it is not being resolved due to many dependency with different versions on maven.
I have taken ref from earcam's answer, that is explained very well and that is with very old pax exam and java 6.
Thanks.

PAX Exam and PAX Runner won't work together.
A long long time ago PAX Exam used to rely on PAX Runner, but this isn't the case anymore since version 2 of PAX Exam (current version is 4).
Therefore stick to the official documentation of PAX Exam and since you added PAX Web as another tag to the question, just take a look at how PAX Web itself uses PaX Exam to do integration tests. There are plenty of resources available at the itests of Pax Web

Related

How do I match versions of Wildfly 9.0.1 w/ org.wildfly.arquillian:wildfly-arquillian-container-managed?

Upgrading a J2EE application from Wildfly 8.2.1.FInal to 9.0.1.Final I
discovered the namespace and versioning change of the Arquillian
Wildfly container.
In the JBoss Developer forum I read
This is working with the Maven "org.wildfly.arquillian" group
artifacts instead, having versions matching the Wildfly J2EE spec
instead of the Wildfly container version, seems more reasonable
both by name and version numbering.
What is the "Wildfly J2EE spec" and how do I go about matching Wildfly
versions with versions of
org.wildfly.arquillian:wildfly-arquillian-container-managed?
Cheers
Mats
Addendum
If someone lands in this page because they have that same problem here is my recommendation: Arquillian Chameleon for the sake of simplicity. Arquillian Chameleon is an automatic container downloader-install-container manager for Arquillian integration tests.
If you're going for the org.wildfly.arquillian:wildfly-arquillian-container-managed, the verion to use with Wildfly 9.0.1.Final is org.wildfly.arquillian:wildfly-arquillian-container-managed:1.0.0.Final.
The easy way to work out what version of Arquillian jars to use with a specific version of WildFly is to look at the WildFly Source on GitHub.
Click on the "Branch: master" button and choose the "Tags" tab.
Look down the list until you find 9.0.1.Final and select it.
Open the pom.xml file and search the page for version.org.wildfly.arquillian.
You will see
<version.org.wildfly.arquillian>1.0.0.Final</version.org.wildfly.arquillian>
which is the version that you're after.
For 10.1.0.Final it says:
<version.org.wildfly.arquillian>1.0.2.Final</version.org.wildfly.arquillian>
which looks like a bug fix release that will likely work just fine with WildFly 9.0.1 as well.
Another way of dealing with versions of container adapters is to use Arquillian Chameleon - it will take care of all the dependencies hurdles for you. The only thing you need to specify is a target container as a property, e.g. wildfly:9.1.0.Final:managed.
For more details have a look in the official repository: https://github.com/arquillian/arquillian-container-chameleon#arquillian-chameleon-container-

Using Pax exam without using Maven

For a project I need to try to run tests in an osgi environment, but i haven't the possibility to use Maven for it, so I find it very hard to use as I am not even able to find sources to use Pax exam, for start...
Thanks for trying to help me.
Have a good day
The sources for Pax Exam are here: https://github.com/ops4j/org.ops4j.pax.exam2.
pax-exam-link-assembly can be used to provision all dependencies of Pax Exam itself in OSGi mode when Maven is not available.
You'll have to manage all other dependencies on your own, and you can't use mavenBundle() options or mvn: URLs, obviously.

Maven 3's support for Groovy poms

I am investigating the use of Maven 3's support for Groovy poms to aid the build process within my team.
From my initial readings, I can only find articles from 2 years ago mentioning it as a feature, although not part of core Maven.
Link to Polyglot Maven seem to redirect to the Sonatype homepage.
I have read the answer to this related question, I don't fully understand what it means.
Does this mean that Maven 3 supports the generation of Groovy poms or not? Would appreciate it someone could explain in simple terms as to what this means.
Thanks
It looks like Jason van Zyl, who is the founder of the Maven project and the CTO of Sonatype, is working on it, in sort of a private beta. It is not a part of the released version of Maven 3.
See this email from Jason
What's the problem with the build process? Do you need groovy poms to get it into your team? pom.xml files will usually not written by hand. You should IDE's for that purpose. Maven 3 does not support of Groovy pom's.

equinox + sample.http - issue with tomcat 7

I am importing sample.http from http://www.eclipse.org/equinox/server/http_in_container.php into eclipse , using tomcat 7 as server (linux platform).
It shows several problems such as :
BundleActivator cannot be resolved to a type
No available bundle exports package 'javax.servlet.http'
and several such errors due to plugin dependencies not being imported.
(If I try with tomcat 6,it works).
Can someone point out what changes I should make for making the dependencies compatible with tomcat 7 ?
The problem is the org.eclipse.equinox.http.servletbridge jar.
It exports Servlet javax.servlet 2.3 but for Tomcat 7 you need javax.servlet 3.0
Maybe you can open up the jar file and fix that, but I have wasted quite some time with this construction, and never got it right. It is 5 years old, and that means trouble.
For me Felix worked a lot better, there is a clearer and more consistent explanation.
Take a look here: apache felix
I think with this setup you could still use Equinox with the FrameworkLauncher, if that is necessary

Hard time on learning Java EE - mostly installing and testing stuff

Its quite a while since I started learning Java EE (I come from Rails world).
I'd like to test create a simple blog to test these:
- Hibernate, JPA
- Spring with MVC
- JSF and routing
- Struts 2
- Eclipse and local test (modify, reload, check changes)
- Tomcat, Jboss or Jetty
- An administration area (Session)
- Maven
I've a basic knowledge of each of those but as soon as I spend tons of time installing stuff and, somehow, I manage to resolve all inconveniences there is ALWAYS something that goes wrong (installation, tutorial obsolete, should I work with Spring IDE, MyEclipse, Jboss Application Server or regular Eclipse?, tons of random errors, each tutorial asking for random dependencies, each showcase).
QUESTION
How do you create quickly a startup project with these components?
You go with some Maven archetype? If so which one?
What I'd like is something I can download or build equipped out of the box with all above mentioned components. To name a few:
- railswizard.org, youvegotrails.com, railsboost.com/templates/new
SIDE QUESTION
Currently I'm following this great series, can you suggest some more like this:
- http://www.youtube.com/user/koushks?feature=gb_p13n_ch_rec
All the above components in a single project? That makes no sense; Spring MVC, Struts 2, and JSF would rarely be combined in the same project.
Each web framework has demo applications, what's wrong with those? There are archetypes for at least some combinations, although I'm not sure it's not better to put them together yourself.
Without knowing what kind of issues/errors you're getting, it's impossible to help. Maven should be taking care of most/all dependency issues. You shouldn't be spending much time installing anything by hand except maybe an app container.
IMO you're better off asking specific, actionable questions, and start with each specific technology and build up an application, rather than trying to integrate everything at once--a sure recipe for frustration.
For starting with a simple Java EE application, a good point to start is just downloading a Java EE 6 implementation.
Those are offered by various parties, which might be confusing at first. It's however just like there isn't the One and Only C compiler, but there are many and they all compile the same standard C.
For Java EE 6, obvious choices are GlassFish 3.1.2, JBoss AS 7.1, TomEE. (just pick one, at this stage it doesn't matter much which one you'll use).
Java EE 6 is a full stack solution. It's a single download and you don't necessarily need to install any other libraries. It comes with an MVC framework (JSF), an ORM solution (JPA), dependency injection (CDI), business logic support (EJB) and then some.
As for the IDE, NetBeans has a particular good default integration for GlassFish (can even be downloaded as one bundle), but for Eclipse it's not that difficult either. You need to download the Java EE edition of Eclipse and after starting it, go to Help -> Eclipse Marketplace, search for "GlassFish" and install the "GlassFish Server Plugin".
See also Minimal 3-tier Java EE app, without any XML config for a very minimal example to get started and JSF 2.0 tutorial with Eclipse and Glassfish for a very detailed one including instructions how to exactly setup the IDE.
What I'd like is something I can download or build equipped out of the box with all above mentioned components. To name a few:
http://appfuse.org/display/APF/Home
Appfuse will take you through the initial setup of a maven built spring based web application with hibernate included.
If you come from the rails world you might also look into Spring Roo which tries to borrow from Ruby i'm told. The primary focus of roo is to stand up all of the technology you've listed above quickly.

Resources