0
votes

On a Mac I developed and runned a Java EE application succesfully. It is an EAR with a EJB module and a Web module. Now continuing on a Linux device (Ubuntu) , I cant start exactly the same application anymore.

I created the JAR with Maven. I tried running the application with:

asadmin deploy ejbEntities/target/ejbEntities-1.0-SNAPSHOT.jar 

I also tried the admin console in the browse rhttp://localhost:4848: Applications/-> Deploy.. selecting Snapshot.jar

And I also tried it with Netbeans with all the same result:

After building with dependecies and running. Tha Glassfish output tells its succesfully running. But the App does not work and in services Servers/glassfish Server/applications/ nothing appears and the output is server.log:

    Exception while loading the app : EJB Container initialization error
    sageBeanClient.java:168)
at org.glassfish.ejb.mdb.MessageBeanContainer.<init>(MessageBeanContainer.java:252)
at org.glassfish.ejb.mdb.MessageBeanContainerFactory.createContainer(MessageBeanContainerFactory.java:63)
at org.glassfish.ejb.startup.EjbApplication.loadContainers(EjbApplication.java:221)
at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:291)
at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:99)
at org.glassfish.internal.data.ModuleInfo.load(ModuleInfo.java:206)
at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:313)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:496)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:539)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:535)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:360)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:534)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:565)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:557)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:360)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:556)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1464)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1300(CommandRunnerImpl.java:109)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1846)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1722)
at org.glassfish.admin.rest.resources.admin.CommandResource.executeCommand(CommandResource.java:404)
at org.glassfish.admin.rest.resources.admin.CommandResource.execCommandSimpInMultOut(CommandResource.java:234)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:151)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:171)
at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:152)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:104)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:387)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:331)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:103)
at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:271)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:297)
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:254)
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1028)
at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:365)
at org.glassfish.admin.rest.adapter.JerseyContainerCommandService$3.service(JerseyContainerCommandService.java:173)
at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:179)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
at java.lang.Thread.run(Thread.java:745) Caused by: com.sun.appserv.connectors.internal.api.ConnectorRuntimeException: Invalid destination jms/NewMessage for MDB: JNDI name not found
at com.sun.enterprise.connectors.jms.system.ActiveJmsResourceAdapter.getPhysicalDestinationFromConfiguration(ActiveJmsResourceAdapter.java:2263)
... 71 more]][2015-06-01T15:15:19.286+0200] [glassfish 4.1] [INFO] [] [org.glassfish.admingui] [tid: _ThreadID=130 _ThreadName=admin-listener(6)] [timeMillis: 1433164519286] [levelValue: 800] [[Redirecting to /common/index.jsf]] [2015-06-01T15:15:19.301+0200] [glassfish 4.1] [INFO] [] [org.glassfish.admingui] [tid: _ThreadID=132 _ThreadName=admin-listener(8)] [timeMillis: 1433164519301] [levelValue: 800] [[ Admin Console: Initializing Session Attributes...]]

What could be the problem?The app did not change, its the environment.

After googling around I found the problem had to do with syntax.

For example on: Glassfish v3: Can't Deploy MessageDriven Bean - Missing Destination JNDI Name

I got the same error. The problem was: @ActivationConfigProperty(propertyName = "destination", propertyValue = "jms/SampleTopic") This need to be @ActivationConfigProperty(propertyName = "destination", propertyValue = "SampleTopic")

Whe´re can I set this property? Whe´re is the Glassfish configuration file?

I found the domain.xml file. ~/glassfish4/glassfish/domains/domain1/config/domain.xml In that file I wasn't able to find anything about the com.sun.appserv.*. packages. The app used to work with this default file (on Mac). With the asadmin terminal I tried to add custom Resources. And they whe're Listed. After restarting glassfish no different result.

The application deployment guide https://glassfish.java.net/docs/4.0/application-deployment-guide.pdf mentionned about glassfish-ejb-jar.xml and about ejb-jar.xml. I was only able to find these files for version 3.1. http://docs.oracle.com/cd/E26576_01/doc.312/e24929/dd-files.htm#GSDPG00080 But the app was capable on running with the default settings, so without these files.

Could someone guide me through this one?

Thanks in advance.

Peter,

1
So: Caused by: com.sun.appserv.connectors.internal.api.ConnectorRuntimeException: Invalid destination jms/NewMessage for MDB: JNDI name not foundPeter-TI

1 Answers

0
votes

SOLVED:

After I read the Glassfish manual https://glassfish.java.net/docs/4.0/application-deployment-guide.pdf And placed the glassfish-ejb-jar.xml into: App/Other Sources/src/main/resources/META-INF.

<!DOCTYPE glassfish-ejb-jar PUBLIC "-//GlassFish.org//
DTD GlassFish Application Server 3.1 EJB 3.1//EN" 
"http://glassfish.org/dtds/glassfish-ejb-jar_3_1-1.dtd">
<glassfish-ejb-jar>
<display-name>First Module</display-name>
<enterprise-beans>
<ejb>
    <ejb-name>ejbentities</ejb-name>
    <jndi-name>ejbEntities</jndi-name>
    <bean-pool>
        <steady-pool-size>10</steady-pool-size>
        <resize-quantity>10</resize-quantity>
        <max-pool-size>100</max-pool-size>
        <pool-idle-timeout-in-seconds>600</pool-idle-timeout-in-seconds>
    </bean-pool>
    <bean-cache>
        <max-cache-size>100</max-cache-size>
        <resize-quantity>10</resize-quantity>
        <removal-timeout-in-seconds>3600</removal-timeout-in-seconds>
        <victim-selection-policy>LRU</victim-selection-policy>
    </bean-cache>
</ejb>
<cmp-resource>
    <jndi-name>jdbc/__default</jndi-name>
    <create-tables-at-deploy>true</create-tables-at-deploy>
    <drop-tables-at-undeploy>true</drop-tables-at-undeploy>
</cmp-resource>
</enterprise-beans>
 <keep-state>true</keep-state>
</glassfish-ejb-jar>

This location wasn't in the manual but found it on: https://blogs.oracle.com/JagadishPrasath/entry/application_scoped_resources_in_glassfish

This Solved the error, and I finally got to understand Glassfish a bit better. Hope I can help someone in the future with this info.

But how did this App run on the Mac (Netbeans Glassfish installation) then?