Hi,

Can you provide a threaddump ?
Is there a particular reason you are using version 1.0.1-SNAPSHOT ?
Most recent version is 1.2.0 (release last week).

Also please raise a jira ticket if the problem remains in 1.2.0. - though i
think its not related to the exam version.

Toni


On Thu, Nov 5, 2009 at 7:04 PM, Charles-André Martin <
[email protected]> wrote:

> Hi all,
>
>       I would like to use Pax Exam for integration tests. Currently,
> I have one bundle which has REST services. I use JAX-RS (CXF) for the
> REST services. My plans are to setup Pax Exam with JUnit and to use
> HTTP client to tests the REST services. The bundles work nice with
> fuse 4.1. When I test it, Pax Exam freeze at startup :
>
> ...
> main INFO [org.ops4j.pax.runner.platform.internal.ExecutionEnvironment]
> - Using execution environment [J2SE-1.6]
> main INFO [org.ops4j.pax.runner.platform.DefaultJavaRunner] - Runner
> has successfully finished his job!
> main INFO
> [org.ops4j.pax.exam.container.def.internal.PaxRunnerTestContainer]
> - Test container (Pax Runner 1.1.0) started in 33875 millis
> main INFO
> [org.ops4j.pax.exam.container.def.internal.PaxRunnerTestContainer]
> - Wait for test container to finish its initialization without timing
> out
>
> Welcome to Felix.
> =================
>
> [org.ops4j.pax.swissbox.extender.BundleWatcher] : Creating bundle
> watcher with scanner
> [org.ops4j.pax.swissbox.extender.bundlemanifestscan...@17e6a96]...
> [org.ops4j.pax.swissbox.extender.BundleWatcher] : Scanning bundle
> [osgi.compendium]
> [org.ops4j.pax.swissbox.extender.BundleWatcher] : Scanning bundle
> [org.ops4j.pax.exam]
> [org.ops4j.pax.swissbox.extender.BundleWatcher] : Scanning bundle
> [org.ops4j.pax.exam.junit.extender]
> [org.ops4j.pax.swissbox.extender.BundleWatcher] : Scanning bundle
> [org.ops4j.pax.exam.junit.extender.impl]
> [org.ops4j.pax.url.commons.handler.HandlerActivator] : Handler for
> protocols [dir] started
> [org.ops4j.pax.swissbox.extender.BundleWatcher] : Scanning bundle
> [org.ops4j.pax.url.dir]
> [org.ops4j.pax.swissbox.extender.BundleWatcher] : Scanning bundle
> [com.springsource.org.junit]
> [org.ops4j.pax.exam.rbc.internal.Activator] : Starting up RMI registry
> on port [1099]
> [org.ops4j.pax.exam.rbc.internal.Activator] : Binding
> RemoteBundleContext to RMI registry
> [org.ops4j.pax.exam.rbc.internal.Activator] : RMI registry started on
> port [1099]
> [org.ops4j.pax.swissbox.extender.BundleWatcher] : Scanning bundle
> [org.ops4j.pax.exam.rbc]
> [org.ops4j.pax.swissbox.extender.BundleWatcher] : Scanning bundle
> [org.apache.geronimo.specs.geronimo-annotation_1.0_spec]
> [org.ops4j.pax.swissbox.extender.BundleWatcher] : Scanning bundle
> [org.apache.geronimo.specs.geronimo-activation_1.1_spec]
> [org.ops4j.pax.swissbox.extender.BundleWatcher] : Scanning bundle
> [org.apache.geronimo.specs.geronimo-javamail_1.4_spec]
> [org.ops4j.pax.swissbox.extender.BundleWatcher] : Scanning bundle
> [org.apache.geronimo.specs.geronimo-ws-metadata_2.0_spec]
> [org.ops4j.pax.swissbox.extender.BundleWatcher] : Scanning bundle
> [com.springsource.org.jdom]
> [org.mortbay.jetty] : Logging to
> org.ops4j.pax.web.service.internal.util.jcllog...@1c92535 via
> org.ops4j.pax.web.service.internal.util.JCLLogger
> [org.ops4j.pax.web.service.internal.Activator] : Starting pax http service
> [org.ops4j.pax.web.service.internal.ServerControllerImpl] :
> configuring server: ServerControllerImpl{state=UNCONFIGURED} ->
> ConfigurationImpl{http enabled=true,http port=8080,http secure
> enabled=false,http secure port=8443,ssl keystore=C:\Documents and
> Settings\charles-andre.martin\.keystore,ssl keystoreType=null,session
> timeout=3600,listening addresses=[Ljava.lang.String;@c931fc}
> [org.ops4j.pax.web.service.internal.ServerControllerImpl] : starting
> server: ServerControllerImpl{state=STOPPED}
> [org.ops4j.pax.web.service.internal.JettyServerImpl] : adding
> [email protected]:8080
> [org.mortbay.jetty] : Container jettyserverwrap...@5e179a +
> [email protected]:8080 as connector
> [org.ops4j.pax.web.service.internal.JettyServerImpl] : starting
> JettyServerImpl{}
> [org.mortbay.jetty] : jetty-6.1.x
> [org.mortbay.jetty] : Container jettyserverwrap...@5e179a +
> org.mortbay.thread.queuedthreadp...@1ebd75b as threadpool
> [org.mortbay.jetty] : started org.mortbay.thread.queuedthreadp...@1ebd75b
> [org.mortbay.jetty] : starting jettyserverwrap...@5e179a
> [org.mortbay.jetty] : started
> org.mortbay.jetty.nio.selectchannelconnecto...@b01d43
> [org.mortbay.jetty] : Started [email protected]:8080
> [org.mortbay.jetty] : started [email protected]:8080
> [org.mortbay.jetty] : started jettyserverwrap...@5e179a
> [org.ops4j.pax.web.service.internal.Activator] : Started pax http service
> [org.ops4j.pax.swissbox.extender.BundleWatcher] : Scanning bundle
> [org.ops4j.pax.web.pax-web-service]
> main INFO [org.ops4j.pax.exam.rbc.client.RemoteBundleContextClient] -
> Remote bundle context found after 5219 millis
>
> Then it hangs here indefinitly, no tests are run. The java process
> using about 80% of the CPU.
>
>  Here is a sample of the code :
>
>
>        private BundleContext bundleContext;
>
>
>        @Configuration(extend=BNewsOption.class)
>        public static Option[] configuration() {
>
>                return options(
>
>
>  systemPackages("javax.xml.stream;version=1.0.0",
> "com.sun.org.apache.xerces.internal.dom",
>
> "javax.xml.stream.util;version=1.0.0",
> "com.sun.org.apache.xerces.internal.xni",
>
> "javax.xml.stream.events;version=1.0.0"),
>                                logProfile(),
>
>  
> systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("DEBUG"),
>                    repositories("http://repository.ops4j.org/maven2";,
> "..."),
>                            felix(), profile("spring"), profile("spring.dm"),
> webProfile(),
> profile("cxf.dosgi"));
>        }
>
> @Test
>        public void testCanAddNews() {
>                String content = "content";
>                HttpClient client = new HttpClient();
>
>                String url = "
> http://localhost:8080/cxf/bnews/portalRESTTestInt/siteRESTTestInt/topicRESTTestInt/section
> ";
>                EntityEnclosingMethod method = new PutMethod(url);
>
>                InputStream inputSteam = new
> ByteArrayInputStream(content.toString().getBytes());
>                method.setRequestEntity(new
> InputStreamRequestEntity(inputSteam,
> content.length()));
>
>                try {
>                        int statusCode = client.executeMethod(method);
>                        assertEquals(201, statusCode);
>                } catch (HTTPException e) {
>                        e.printStackTrace();
>                        fail(e.getMessage());
>                } catch (IOException e) {
>                        e.printStackTrace();
>                        fail(e.getMessage());
>                } finally {
>                        method.releaseConnection();
>                }
>        }
>
> public class BNewsOption implements CompositeOption {
>
>        public Option[] getOptions() {
>                return options(
>
> systemProperty("org.ops4j.pax.web.session.timeout").value("3600"),
>                   systemPackages("javax.xml.ws.http;version=2.1.0"),
>                   provision(
>
> mavenBundle().groupId("org.apache.servicemix.bundles").artifactId("org.apache.servicemix.bundles.commons-httpclient").version("3.1_1-fuse"),
>
> mavenBundle().groupId("org.apache.servicemix.bundles").artifactId("org.apache.servicemix.bundles.commons-codec").version("1.3_1-fuse"),
>
> mavenBundle().groupId("commons-lang").artifactId("commons-lang").version("2.4"),
>
> mavenBundle().groupId("com.sun.syndication").artifactId("....com.sun.syndication").version("1.0.0.BUILD-SNAPSHOT"),
>
> bundle("file:/C:/progress/fuse-esb-4.1.0.2/system/org/apache/mina/mina-core/2.0.0-M6/mina-core-2.0.0-M6.jar"),
>
> mavenBundle().groupId("....rest").artifactId("....rest.bnews"),
>
> mavenBundle().groupId("....business").artifactId("....business.bnews"),
>
> mavenBundle().groupId("....integration").artifactId("....integration.memcached"),
>
> mavenBundle().groupId("....integration").artifactId("....integration.sws")));
>        }
> }
>
> Here is my project POM file :
>
> <project xmlns="http://maven.apache.org/POM/4.0.0";
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/maven-v4_0_0.xsd";>
>
>        <modelVersion>4.0.0</modelVersion>
>        <groupId>....test</groupId>
>        <artifactId>....test.integration</artifactId>
>        <version>1.0.0.BUILD-SNAPSHOT</version>
>
>        <distributionManagement>
>                <snapshotRepository>
>                        <id>snapshots</id>
>                        <name>Snapshots</name>
>                        <url>.../snapshots</url>
>                </snapshotRepository>
>        </distributionManagement>
>
>        <dependencies>
>                <dependency>
>                        <groupId>....rest</groupId>
>                        <artifactId>....rest.bnews</artifactId>
>                        <version>1.0.0.BUILD-SNAPSHOT</version>
>                        <scope>compile</scope>
>                </dependency>
>                <dependency>
>                        <groupId>org.ops4j.pax.exam</groupId>
>                        <artifactId>pax-exam</artifactId>
>                        <version>1.0.1-SNAPSHOT</version>
>                        <scope>compile</scope>
>                </dependency>
>                <dependency>
>                        <groupId>org.ops4j.pax.exam</groupId>
>                        <artifactId>pax-exam-container-default</artifactId>
>                        <version>1.0.1-SNAPSHOT</version>
>                        <scope>compile</scope>
>                </dependency>
>                <dependency>
>                        <groupId>org.ops4j.pax.exam</groupId>
>                        <artifactId>pax-exam-junit</artifactId>
>                        <version>1.0.1-SNAPSHOT</version>
>                        <scope>compile</scope>
>                </dependency>
>                <dependency>
>                        <groupId>org.ops4j.pax.exam</groupId>
>                        <artifactId>pax-exam-junit-extender</artifactId>
>                        <version>1.0.1-SNAPSHOT</version>
>                        <scope>compile</scope>
>                </dependency>
>        </dependencies>
>
>        <build>
>                <resources>
>                        <!-- standard Maven folder -->
>                        <resource>
>                                <directory>src/main/java</directory>
>                        </resource>
>                        <resource>
>                                <directory>src/main/resources</directory>
>                        </resource>
>                </resources>
>
>                <plugins>
>                        <plugin>
>                                <groupId>org.apache.maven.plugins</groupId>
>
>  <artifactId>maven-compiler-plugin</artifactId>
>                                <configuration>
>                                        <encoding>UTF-8</encoding>
>                                        <source>1.5</source>
>                                        <target>1.5</target>
>                                </configuration>
>                        </plugin>
>                </plugins>
>        </build>
>
> </project>
>
> I'm using Windows XP with Java 6. Whatever I run the JUnit test by
> Eclipse or by maven test, it freeze.
> Anyone has an idea why Pax Runner hangs ? It only hangs when I include
> the CXF profile. Without the CXF profile, the tests are run.
> Obviously, I need CXF to test my REST services...
>
> Thank you !
>
>
> --
> Charles-André Martin
> [email protected]
>
> _______________________________________________
> general mailing list
> [email protected]
> http://lists.ops4j.org/mailman/listinfo/general
>



-- 
Toni Menzel
Independent Software Developer
Professional Profile: http://okidokiteam.com
[email protected]
http://www.ops4j.org     - New Energy for OSS Communities - Open
Participation Software.
_______________________________________________
general mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/general

Reply via email to