I have several Maven projects that are using OpenEJB to do the unit testing
of the web services. These tests are doing fine.
I am not trying to create new Maven projects in a different tree. When I
try to run Web Service Tests the web service never comes and I net
exceptions because the service can not be initialized.
Web Service Unit Test Code:
public class SubscriberAvailableWebTest extends MockedWebServiceTest {
private Service subAvail;
private SubscriberAvailableLocal but;
private SubscriberAvailable saw;
private ConfigMockLocal config;
public SubscriberAvailableWebTest() {
super();
}
super here sets up the InitialContext with the following properties:
Properties properties = new Properties();
properties.put( Context.INITIAL_CONTEXT_FACTORY,
"org.apache.openejb.client.LocalInitialContextFactory" );
properties.put( "kvpdb", "new://Resource?type=DataSource" );
properties.put( "kvpdb.JdbcDriver",
"org.apache.derby.jdbc.EmbeddedDriver" );
properties.put( "kvpdb.JdbcUrl",
"jdbc:derby:target/db/kvpdb;create=true" );
properties.put( "kvpdb.UserName", "guest" );
properties.put( "kvpdb.Password", "guest" );
properties.put( "CommonMocksDataSource",
"new://Resource?type=DataSource" );
properties.put( "CommonMocksDataSource.JdbcDriver",
"org.apache.derby.jdbc.EmbeddedDriver" );
properties.put( "CommonMocksDataSource.JdbcUrl",
"jdbc:derby:target/db/CommonMocksDataSource;create=true" );
properties.put( "CommonMocksDataSource.UserName", "guest" );
properties.put( "CommonMocksDataSource.Password", "guest" );
properties.put( "openejb.embedded.remotable", "true" );
System.getProperties().setProperty( "toplink.ddl-generation",
"drop-and-create-table" );
System.getProperties().setProperty( "toplink.logging.level", "DEBUG"
);
System.getProperties().setProperty(
"toplink.create-ddl-jdbc-file-name", "create.sql" );
System.getProperties().setProperty(
"toplink.ddl-generation.output-mode", "both" );
I then try to create my service:
try {
subAvail = Service.create(
new URL(
"http://127.0.0.1:4204/SubscriberAvailableWeb?wsdl" ),
new QName(
"http://subscriberavailable.features.calldriver.acision.com-v0.1",
"SubscriberAvailableWebService" ) );
} catch ( Exception e ) {
fail( e.getMessage() );
}
I always get an error here.
My output of the test is :
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running
com.acision.calldriver.features.subscriberavailable.SubscriberAvailableBeanTest
Apache OpenEJB 3.1.1 build: 20090530-06:18
http://openejb.apache.org/
INFO - openejb.home =
/home/MAF/maf/call_driver/features/subscriber_available
INFO - openejb.base =
/home/MAF/maf/call_driver/features/subscriber_available
INFO - Configuring Service(id=Default Security Service,
type=SecurityService, provider-id=Default Security Service)
INFO - Configuring Service(id=Default Transaction Manager,
type=TransactionManager, provider-id=Default Transaction Manager)
INFO - Configuring Service(id=CommonMocksDataSource, type=Resource,
provider-id=Default JDBC Database)
INFO - Configuring Service(id=kvpdb, type=Resource, provider-id=Default JDBC
Database)
INFO - Found EjbModule in classpath:
/users/bdodge/.m2/repository/com/acision/mplus/services/mplus-applications-common-mock/R4.0-00.00.B05-SNAPSHOT/mplus-applications-common-mock-R4.0-00.00.B05-SNAPSHOT.jar
INFO - Found EjbModule in classpath:
/users/bdodge/.m2/repository/com/acision/calldriver/calldriver-core/R4.0-00.00.B02-SNAPSHOT/calldriver-core-R4.0-00.00.B02-SNAPSHOT.jar
INFO - Found EjbModule in classpath:
/home/MAF/maf/call_driver/features/subscriber_available/target/test-classes
INFO - Found EjbModule in classpath:
/home/MAF/maf/call_driver/features/subscriber_available/target/classes
INFO - Beginning load:
/users/bdodge/.m2/repository/com/acision/mplus/services/mplus-applications-common-mock/R4.0-00.00.B05-SNAPSHOT/mplus-applications-common-mock-R4.0-00.00.B05-SNAPSHOT.jar
INFO - Beginning load:
/users/bdodge/.m2/repository/com/acision/calldriver/calldriver-core/R4.0-00.00.B02-SNAPSHOT/calldriver-core-R4.0-00.00.B02-SNAPSHOT.jar
INFO - Beginning load:
/home/MAF/maf/call_driver/features/subscriber_available/target/test-classes
INFO - Beginning load:
/home/MAF/maf/call_driver/features/subscriber_available/target/classes
INFO - Configuring enterprise application: classpath.ear
INFO - Configuring Service(id=Default Stateless Container, type=Container,
provider-id=Default Stateless Container)
INFO - Auto-creating a container for bean LdapMockImpl:
Container(type=STATELESS, id=Default Stateless Container)
INFO - Configuring PersistenceUnit(name=CommonMocksPU,
provider=org.apache.openjpa.persistence.PersistenceProviderImpl)
INFO - Auto-creating a Resource with id 'CommonMocksDataSourceNonJta' of
type 'DataSource for 'CommonMocksPU'.
INFO - Configuring Service(id=CommonMocksDataSourceNonJta, type=Resource,
provider-id=CommonMocksDataSource)
INFO - Adjusting PersistenceUnit CommonMocksPU <non-jta-data-source> to
Resource ID 'CommonMocksDataSourceNonJta' from 'null'
INFO - Enterprise application "classpath.ear" loaded.
INFO - Assembling app: classpath.ear
INFO - PersistenceUnit(name=CommonMocksPU,
provider=org.apache.openjpa.persistence.PersistenceProviderImpl)
ERROR - JAVA AGENT NOT INSTALLED. The JPA Persistence Provider requested
installation of a ClassFileTransformer which requiresa JavaAgent. See
http://openejb.apache.org/3.0/javaagent.html
INFO - Jndi(name=LdapMockImplLocal) --> Ejb(deployment-id=LdapMockImpl)
INFO - Jndi(name=maf-components/LdapServiceBean/remote) -->
Ejb(deployment-id=LdapMockImpl)
INFO - Jndi(name=SnmpServiceMockBeanLocal) -->
Ejb(deployment-id=SnmpServiceMockBean)
INFO - Jndi(name=maf-components/SnmpServiceBean/remote) -->
Ejb(deployment-id=SnmpServiceMockBean)
INFO - Jndi(name=ConfigMockImplLocal) --> Ejb(deployment-id=ConfigMockImpl)
INFO - Jndi(name=maf-components/ConfigurationBean/remote) -->
Ejb(deployment-id=ConfigMockImpl)
Failed to load configuration from /config/maf-config.xml, will be empty
INFO - Jndi(name=SubscriberAvailableBeanLocal) -->
Ejb(deployment-id=SubscriberAvailableBean)
INFO - Created Ejb(deployment-id=SubscriberAvailableBean,
ejb-name=SubscriberAvailableBean, container=Default Stateless Container)
INFO - Created Ejb(deployment-id=SubscriberAvailableWeb,
ejb-name=SubscriberAvailableWeb, container=Default Stateless Container)
INFO - Created Ejb(deployment-id=LdapMockImpl, ejb-name=LdapMockImpl,
container=Default Stateless Container)
INFO - Created Ejb(deployment-id=SnmpServiceMockBean,
ejb-name=SnmpServiceMockBean, container=Default Stateless Container)
INFO - Created Ejb(deployment-id=ConfigMockImpl, ejb-name=ConfigMockImpl,
container=Default Stateless Container)
INFO - Deployed Application(path=classpath.ear)
prepareMCallMessage
purgeDataForMSISDN
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.596 sec
Running
com.acision.calldriver.features.subscriberavailable.SubscriberAvailableWebTest
INFO - Starting network services
** Starting Services **
NAME IP PORT
admin thread 127.0.0.1 4200
ejbd 127.0.0.1 4201
-------
Ready!
Tests run: 2, Failures: 1, Errors: 0, Skipped: 1, Time elapsed: 0.278 sec
<<< FAILURE!
Here is the output from another project that works:
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running com.acision.features.divert.DivertTest
Apache OpenEJB 3.1.1 build: 20090530-06:18
http://openejb.apache.org/
INFO - openejb.home =
/home/MAF/synergy2/mplus_services/applications/features/divert
INFO - openejb.base =
/home/MAF/synergy2/mplus_services/applications/features/divert
INFO - Configuring Service(id=Default Security Service,
type=SecurityService, provider-id=Default Security Service)
INFO - Configuring Service(id=Default Transaction Manager,
type=TransactionManager, provider-id=Default Transaction Manager)
INFO - Configuring Service(id=CommonMocksDataSource, type=Resource,
provider-id=Default JDBC Database)
INFO - Configuring Service(id=kvpdb, type=Resource, provider-id=Default JDBC
Database)
INFO - Found EjbModule in classpath:
/home/MAF/synergy2/mplus_services/applications/features/divert/target/classes
INFO - Found ClientModule in classpath:
/users/bdodge/.m2/repository/xml-resolver/xml-resolver/1.2/xml-resolver-1.2.jar
INFO - Found EjbModule in classpath:
/users/bdodge/.m2/repository/com/acision/mplus/services/mplus-applications-common-mock/R4.0-00.00.B06-SNAPSHOT/mplus-applications-common-mock-R4.0-00.00.B06-SNAPSHOT.jar
INFO - Beginning load:
/home/MAF/synergy2/mplus_services/applications/features/divert/target/classes
INFO - Beginning load:
/users/bdodge/.m2/repository/xml-resolver/xml-resolver/1.2/xml-resolver-1.2.jar
INFO - Beginning load:
/users/bdodge/.m2/repository/com/acision/mplus/services/mplus-applications-common-mock/R4.0-00.00.B06-SNAPSHOT/mplus-applications-common-mock-R4.0-00.00.B06-SNAPSHOT.jar
INFO - Configuring enterprise application: classpath.ear
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: xml-resolver-1.2.jar
INFO - Configuring Service(id=Default Stateless Container, type=Container,
provider-id=Default Stateless Container)
INFO - Auto-creating a container for bean DivertConfigWeb:
Container(type=STATELESS, id=Default Stateless Container)
INFO - Configuring PersistenceUnit(name=CommonMocksPU,
provider=org.apache.openjpa.persistence.PersistenceProviderImpl)
INFO - Auto-creating a Resource with id 'CommonMocksDataSourceNonJta' of
type 'DataSource for 'CommonMocksPU'.
INFO - Configuring Service(id=CommonMocksDataSourceNonJta, type=Resource,
provider-id=CommonMocksDataSource)
INFO - Adjusting PersistenceUnit CommonMocksPU <non-jta-data-source> to
Resource ID 'CommonMocksDataSourceNonJta' from 'null'
INFO - Enterprise application "classpath.ear" loaded.
INFO - Assembling app: classpath.ear
INFO - PersistenceUnit(name=CommonMocksPU,
provider=org.apache.openjpa.persistence.PersistenceProviderImpl)
ERROR - JAVA AGENT NOT INSTALLED. The JPA Persistence Provider requested
installation of a ClassFileTransformer which requiresa JavaAgent. See
http://openejb.apache.org/3.0/javaagent.html
Failed to load configuration from /config/maf-config.xml, will be empty
INFO - Jndi(name=DivertConfigBeanLocal) -->
Ejb(deployment-id=DivertConfigBean)
INFO - Jndi(name=DivertConfigBean) --> Ejb(deployment-id=DivertConfigBean)
INFO - Jndi(name=DivertBeanLocal) --> Ejb(deployment-id=DivertBean)
INFO - Jndi(name=LdapMockImplLocal) --> Ejb(deployment-id=LdapMockImpl)
INFO - Jndi(name=maf-components/LdapServiceBean/remote) -->
Ejb(deployment-id=LdapMockImpl)
INFO - Jndi(name=SnmpServiceMockBeanLocal) -->
Ejb(deployment-id=SnmpServiceMockBean)
INFO - Jndi(name=maf-components/SnmpServiceBean/remote) -->
Ejb(deployment-id=SnmpServiceMockBean)
INFO - Jndi(name=ConfigMockImplLocal) --> Ejb(deployment-id=ConfigMockImpl)
INFO - Jndi(name=maf-components/ConfigurationBean/remote) -->
Ejb(deployment-id=ConfigMockImpl)
INFO - Created Ejb(deployment-id=LdapMockImpl, ejb-name=LdapMockImpl,
container=Default Stateless Container)
INFO - Created Ejb(deployment-id=SnmpServiceMockBean,
ejb-name=SnmpServiceMockBean, container=Default Stateless Container)
INFO - Created Ejb(deployment-id=ConfigMockImpl, ejb-name=ConfigMockImpl,
container=Default Stateless Container)
INFO - Created Ejb(deployment-id=DivertWeb, ejb-name=DivertWeb,
container=Default Stateless Container)
INFO - Created Ejb(deployment-id=DivertConfigBean,
ejb-name=DivertConfigBean, container=Default Stateless Container)
INFO - Created Ejb(deployment-id=DivertConfigWeb, ejb-name=DivertConfigWeb,
container=Default Stateless Container)
INFO - Created Ejb(deployment-id=DivertBean, ejb-name=DivertBean,
container=Default Stateless Container)
INFO - Deployed Application(path=classpath.ear)
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 10.24 sec
Running com.acision.features.divert.DivertWebServiceTest
INFO - Starting network services
** Starting Services **
NAME IP PORT
httpejbd 127.0.0.1 4204
Sep 23, 2009 3:19:41 PM org.apache.cxf.endpoint.ServerImpl initDestination
INFO: Setting the server's publish address to be http://nopath:80
Sep 23, 2009 3:19:41 PM org.apache.cxf.endpoint.ServerImpl initDestination
INFO: Setting the server's publish address to be http://nopath:80
admin thread 127.0.0.1 4200
ejbd 127.0.0.1 4201
-------
Ready!
The only thing that stands out to me is that the one that doesn't work does
not do anything with xml-resolver and it does not load the web service on
port 4204.
Does anybody know why this would be. The different projects are very
similar in structure.
--
View this message in context:
http://www.nabble.com/OpenEJB-with-JAX-WS-Unit-Test---Web-Service-not-coming-up-tp25531284p25531284.html
Sent from the OpenEJB User mailing list archive at Nabble.com.