Marco Mistroni wrote:
hello all,
  following an interesting article ont he net about testing EJBs using
OpenEJB (with no server running), i decided to try to use openEJB with
my EJBS.

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.

You may be interested in http://docs.openejb.org/Creating+itests.

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?

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.

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?

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.

Jacek

Reply via email to