users@glassfish.java.net

Re: Attempt to invoke when Ejb container is in Initializing

From: <forums_at_java.net>
Date: Wed, 17 Jul 2013 16:45:53 -0500 (CDT)

Using the code sample from
docs.oracle.com/cd/E18930_01/html/821-2424/gjlde.html#scrolltoc, I managed to
use the Standart API for my UT. public class
InitActionWithEmbeddedContainerTest { public static EJBContainer
ejbContainer; public static Context ctx; public InitAction action; public
InitActionWithEmbeddedContainerTest() { } @Test public void callExecute()
throws Exception { action.setLang("EN"); action.setRequest("aa");
action.validate(); action.execute(); } @BeforeClass public static void
setUpClass() throws Exception { Properties props = new Properties();
props.load(InitActionTest.class.getClassLoader().getResourceAsStream("EJBContainer.properties"));
System.out.println("Properties :\n" + props); ejbContainer =
EJBContainer.createEJBContainer(props); System.out.println("Starting the
container"); ctx = ejbContainer.getContext(); } @AfterClass public static
void tearDownClass() { ejbContainer.close(); System.out.println("Closing the
container"); } @Before public void setUp() throws Exception { action = new
InitAction(); action.prepare(); } @After public void tearDown() { } } The
file EJBContainer.properties contains the keys as specified in the Oracle
documentation. but it seems that my datasource is not created correctly :
SEVERE: Exception while invoking class
org.glassfish.persistence.jpa.JPADeployer prepare method
java.lang.RuntimeException: Invalid resource : jdbc/myDS__pm at
com.sun.enterprise.connectors.ConnectorRuntime.lookupDataSourceInDAS(ConnectorRuntime.java:539)
at
com.sun.enterprise.connectors.ConnectorRuntime.lookupPMResource(ConnectorRuntime.java:468)
at... ... Jul 18, 2013 01:30:28 AM
org.glassfish.deployment.admin.DeployCommand execute SEVERE: Exception while
preparing the app : Invalid resource : jdbc/myDS__pm
com.sun.appserv.connectors.internal.api.ConnectorRuntimeException: Invalid
resource : jdbc/myDS__pm at
com.sun.enterprise.connectors.service.ConnectorResourceAdminServiceImpl$MyDataSource.validateResource(ConnectorResourceAdminServiceImpl.java:272)
at com.sun.enterprise... ... PlainTextActionReporterFAILUREDescription:
deploy AdminCommandError occurred during deployment: Exception while
preparing the app : Invalid resource : jdbc/myApp__pm. Please see server.log
for more details. [name=classes Jul 18, 2013 01:30:34 AM
org.glassfish.ejb.embedded.EJBContainerProviderImpl createEJBContainer INFO:
[EJBContainerProviderImpl] Cleaning up on failure ... ... Now one of the
reason, I can imagine is that the hsqldb.jar may not be available in the
classpath ... ? ? ? Thought present in the ${instance.root}/lib, as I
successfully use the instance for my full size testing

--
[Message sent by forum member 'tsmets']
View Post: http://forums.java.net/node/692685