Hello Jacek,
i run tests again... this time i made sure to use openejb-2.0..
i got same problems...
it looks like no matter i am including openejb-2.0 in dependencies,
the outpout in logs shows version 1.0
i attach logs, project.xml & maven.xml..
can you tell me what could possibly be wrong?
is openejb-2.0-SNAPSHOT the correct jar that i need? or do i need
something else?
thanx in advance and regards
marco
On 7/20/05, Marco Mistroni <[EMAIL PROTECTED]> wrote:
> Hello Jacek,
> thanx for your reply..
> > Hi Marco,
> >
> > Can you tell me where the article can be found? I assume it's the one by
> > Alex, but it might not be.
>
> if it is the same Alex (Rupp), i guess we are talking about same article
> here is the link
> http://www.theserverside.com/articles/article.tss?l=ContainerDrivenTestingSeries&page=part2
>
> >
> > You may be interested in http://docs.openejb.org/Creating+itests.
> >
>
> i'll have a look, thank you..
>
> > > i am however unable to run tests with the 2.0 version, and i was
> > > wondering if
> > > someone could help.
> >
> > Am I right that you're (trying to be) running EJB test scripts with
> > OpenEJB 2.0?
>
> yes..but i guess i messed upt a little my environment, i tried first
> with 2.0, then got errors and went back to 1.0 but didn't change
> deployment descriptor (i am generating them with XDoclet)... so i'll
> give it another try today..then i'll try to post more useful info..
>
> >
> > > TEsts are articulated so that there is no server running,but the
> > > openEJB is embedded inside the JUnit test (i attach sample test case).
> >
> > Things are getting complicated here. I don't think OpenEJB 2.0-SNAPSHOT
> > can do that.
>
> really? mayb i expressed myself wrongly... the link to hte article
> will give more info i suppose..
>
> >
> > > I am unable to run tests, and checking logs i found out following:
> > >
> > > INFO :
> > > ********************************************************************************
> > > OpenEJB http://www.openejb.org
> > > Startup: 13/07/05 18:24
> > > Copyright 1999-2004 (C) OpenEJB Project, All Rights Reserved.
> > > Version: 1.0-SNAPSHOT
> > > Build date: 20040829
> > > Build time: 0049
> >
> > It can't be. You've just said you're running OpenEJB 2, but the log is
> > from OpenEJB 1. You've said EJB tests run well with OpenEJB 1.
> >
> > By the way, how did you get this version?
>
> i don't know...i just downloaded the article and run it... then i
> created my own project and copied maven files... (bad idea i suppose
> :(
>
>
> >
> > > DEBUG: Instantiating assembler class org.openejb.assembler.Assembler
> > > FATAL: OpenEJB has encountered a fatal error and cannot be started:
> > > Assembler failed to initialize.
> > > org.openejb.OpenEJBException: Cannot read the service-jar.xml at
> > > resource2:/org/openejb/service-jar.xml. Received message: unknown
> > > protocol: resource2
> > > at
> > > org.openejb.config.ServiceUtils.handleException(ServiceUtils.java:311)
> > > at
> > > org.openejb.config.ServiceUtils.readServicesJar(ServiceUtils.java:137)
> > > at
> > > org.openejb.config.ServiceUtils.getServiceProvider(ServiceUtils.java:100)
> > > at
> > > org.openejb.config.ServiceUtils.getServiceProvider(ServiceUtils.java:76)
> > > at
> > > org.openejb.config.ConfigurationFactory.initTransactionService(ConfigurationFactory.java:308)
> >
> > That confuses me even more. The class - o.o.config.ConfigurationFactory
> > doesn't exist in OpenEJB 1 whereas it does in OpenEJB 2. It did in
> > OpenEJB 1, but in a slighly different package - o.o.config.alt. I don't
> > follow - the version above says 1.0-SNAPSHOT while the stack trace seems
> > to be from OpenEJB 2.
> >
> > The javadoc of o.o.config.ServiceUtils.readServicesJar reads:
> >
> > Opens the specified jar file, locates the service-jar.xml file,
> > unmarshals it to a java object and returns it. If there is no
> > service-jar.xml in the jar an exception will be thrown.
> >
> > Somehow the resource2 URL provider wasn't set up properly.
>
>
>
> >
> > > attached is my sample test case, along with openejb.properties (if that
> > > matter)
> >
> > It does, but I can't find openejb.properties in your email.
>
> i actually have no openejb.properties.... are you referring to
> openejb.conf? well i
> haven't configured that properties in openejb.conf
>
> as i said, i give it another try this morning and let you know results.....
>
> thanx and regards
> marco
>
>
>
>
> >
> > Jacek
> >
>
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE project [
<!ENTITY xdoclet-commons SYSTEM
"file:${basedir}/../xdoclet-commons.ent">
]>
<!-- $Revision: 1.6 $ $Date: 2004/04/27 00:39:55 $ -->
<project>
<name>NRFX :: EJB Unit Testing Examples</name>
<id>ejb-testing-examples</id>
<groupId>nrfx</groupId>
<currentVersion>1.0</currentVersion>
<inceptionYear>2004</inceptionYear>
<package>com.nrfx.articles.openejb</package>
<organization>
<name>NRFX Technologies LLC</name>
<url>http://www.nrfx.com/</url>
<logo>http://www.nrfx.com/images/logo01.gif</logo>
</organization>
<description>
EJB unit testing examples to accompany my OpenEJB article
</description>
<dependencies>
&xdoclet-commons;
<dependency>
<groupId>geronimo-spec</groupId>
<artifactId>geronimo-spec-j2ee</artifactId>
<version>1.4-rc1</version>
</dependency>
<!--<dependency>
<groupId>Budget-Project</groupId>
<artifactId>Commons</artifactId>
<version>1.1</version>
</dependency>
-->
<dependency>
<groupId>geronimo-spec</groupId>
<artifactId>geronimo-spec-j2ee</artifactId>
<version>1.4-rc1</version>
</dependency>
<dependency>
<groupId>openejb</groupId>
<artifactId>openejb-core</artifactId>
<version>2.0-SNAPSHOT</version>
</dependency>
<dependency>
<id>log4j</id>
<version>1.2.8</version>
<url>http://jakarta.apache.org/log4j</url>
<properties>
<runtime>true</runtime>
</properties>
</dependency>
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.6.0</version>
<url>http://xml.apache.org</url>
<properties>
<runtime>true</runtime>
</properties>
</dependency>
<dependency>
<id>xml-apis</id>
<version>1.0.b2</version>
<properties>
<runtime>true</runtime>
</properties>
</dependency>
<dependency>
<id>castor</id>
<version>0.9.5.3</version>
<url>http://www.castor.org</url>
<properties>
<runtime>true</runtime>
</properties>
</dependency>
<dependency>
<id>oro</id>
<version>2.0.8</version>
<properties>
<runtime>true</runtime>
</properties>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.0.3</version>
<url>http://jakarta.apache.org/commons/logging/</url>
<properties>
<runtime>true</runtime>
</properties>
</dependency>
<!--
required for the database connection configured in
the openejb.conf
-->
<dependency>
<groupId>axion</groupId>
<artifactId>axion</artifactId>
<version>1.0-M3-dev</version>
<properties>
<runtime>true</runtime>
</properties>
</dependency>
<!-- required by axion -->
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>2.1</version>
<properties>
<repository>true</repository>
</properties>
</dependency>
<dependency>
<groupId>commons-primitives</groupId>
<artifactId>commons-primitives</artifactId>
<version>1.0</version>
<properties>
<repository>true</repository>
</properties>
</dependency>
<dependency>
<groupId>regexp</groupId>
<artifactId>regexp</artifactId>
<version>1.3</version>
<properties>
<repository>true</repository>
</properties>
</dependency>
</dependencies>
<!-- =================== -->
<!-- Build Specification -->
<!-- =================== -->
<build>
<sourceDirectory>${basedir}/src/java</sourceDirectory>
<unitTestSourceDirectory>${basedir}/src/test</unitTestSourceDirectory>
<resources>
<resource>
<directory>${basedir}/src/java</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
</resource>
<resource>
<directory>${basedir}/src/resources</directory>
<includes>
<include>**/*</include>
</includes>
</resource>
</resources>
<unitTest>
<includes>
<include>**/*Test.java</include>
</includes>
</unitTest>
</build>
</project>
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- $Revision: 1.2 $ $Date: 2004/04/06 18:41:47 $ -->
<project default="default"
xmlns:j="jelly:core"
xmlns:ant="jelly:ant">
<goal name="default">
<!-- set up the logging directory -->
<ant:mkdir dir="${basedir}/logs"/>
<!-- compile and build the EJB jar -->
<j:set var="maven.test.skip" value="true" />
<attainGoal name="xdoclet:ejbdoclet"/>
<attainGoal name="jar"/>
<j:set var="openejb.validate.output" value="-v"/>
<!--<attainGoal name="validate" />-->
<!-- test the EJB jar -->
<j:set var="maven.test.skip" value="false" />
<attainGoal name="test"/>
</goal>
<goal name="reset">
<ant:delete dir="${basedir}/logs" />
<ant:delete dir="${basedir}/target" />
</goal>
<goal name="validate">
<java
classname="org.openejb.alt.config.EjbValidator"
fork="true"
failonerror="true" >
<classpath>
<pathelement path="${maven.test.dest}"/>
<pathelement path="${maven.build.dest}"/>
<path refid="maven.dependency.classpath"/>
</classpath>
<arg value="${openejb.validate.output}"/>
<arg value="${basedir}/target/${maven.final.name}.jar"/>
</java>
</goal>
<goal name="db:setup">
<sql
driver="org.axiondb.jdbc.AxionDriver"
url="jdbc:axiondb:DefaultDatabase:target/test-database"
userid="Admin"
password="pass">
<classpath>
<path refid="maven.dependency.classpath"/>
</classpath>
<fileset dir="${basedir}/src/sql">
<include name="setup*.sql"/>
</fileset>
</sql>
</goal>
<goal name="db:teardown">
<sql
driver="org.axiondb.jdbc.AxionDriver"
url="jdbc:axiondb:DefaultDatabase:target/test-database"
userid="Admin"
password="pass">
<classpath>
<path refid="maven.dependency.classpath"/>
</classpath>
<fileset dir="${basedir}/src/sql">
<include name="tearDown*.sql"/>
</fileset>
</sql>
</goal>
<goal name="start">
<java
classname="org.openejb.server.Start"
failonerror="true" >
<classpath>
<pathelement path="${maven.test.dest}"/>
<pathelement path="${maven.build.dest}"/>
<path refid="maven.dependency.classpath"/>
</classpath>
<sysproperty key="-Xms" value="128m" />
<sysproperty key="-Xmx" value="192m" />
</java>
</goal>
<goal name="stop">
<java
classname="org.openejb.server.Stop"
failonerror="true" >
<classpath>
<pathelement path="${maven.test.dest}"/>
<pathelement path="${maven.build.dest}"/>
<path refid="maven.dependency.classpath"/>
</classpath>
</java>
</goal>
<goal name="restart">
<java
classname="org.openejb.server.Restart"
failonerror="true" >
<classpath>
<pathelement path="${maven.test.dest}"/>
<pathelement path="${maven.build.dest}"/>
<path refid="maven.dependency.classpath"/>
</classpath>
</java>
</goal>
<goal name="status">
<java
classname="org.openejb.server.Status"
failonerror="true" >
<classpath>
<pathelement path="${maven.test.dest}"/>
<pathelement path="${maven.build.dest}"/>
<path refid="maven.dependency.classpath"/>
</classpath>
</java>
</goal>
</project>