0

I am using GlassFish (GlassFish 4) an application server for my JAVA Enterprise application.

Sometimes,i need to restart it, usually when the fames error appeared:

Could not find sub module [MyApp_webapp.war] as defined in application.xml

To resolve this error, i try to delete the cache of the Ear from the folder application located in the domaine folder of Glassfish. To delete the folder,i need to stop the server before.

Of course, a stopping of the server will not let the other application running! and this is not good especially when those application are in use!

I tried to create two different domain:

domain1 and domain2 with the following properties:

domain1: Glassfish Admin console url= localhost:4848 and

<network-listeners>
              <network-listener port="8080" protocol="http-listener-1" transport="tcp" name="http-listener-1" thread-pool="http-thread-pool"></network-listener>
              <network-listener port="8181" protocol="http-listener-2" transport="tcp" name="http-listener-2" thread-pool="http-thread-pool"></network-listener>
              <network-listener port="4848" protocol="admin-listener" transport="tcp" name="admin-listener" thread-pool="admin-thread-pool"></network-listener>
</network-listeners>

domain2: url= localhost:4242 and

 <network-listeners>
          <network-listener port="8081" protocol="http-listener-1" transport="tcp" name="http-listener-1" thread-pool="http-thread-pool"></network-listener>
          <network-listener port="8182" protocol="http-listener-2" transport="tcp" name="http-listener-2" thread-pool="http-thread-pool"></network-listener>
          <network-listener port="4242" protocol="admin-listener" transport="tcp" name="admin-listener" thread-pool="admin-thread-pool"></network-listener>
 </network-listeners>

Then i tried to deploy two EARs : app1.ear on domain1 and app2.ear on domain2.

the first app1.ear can be launched on localhost:8080/app1-web the second one app2.ear cannot be launched on localhost:8081/app2-web and i got this error on log file:

[2016-01-27T18:09:44.956+0100] [glassfish 4.1] [SEVERE] [AS-WEB-CORE-00037] [javax.enterprise.web.core] [tid: _ThreadID=123 _ThreadName=http-listener-1(5)] [timeMillis: 1453914584956] [levelValue: 1000] [[ An exception or error occurred in the container during the request processing java.lang.ClassCastException: org.glassfish.grizzly.config.ContextRootInfo cannot be cast to org.apache.catalina.Context at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:597) at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:353) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:282) 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) ]]

Am i missing something to configure on My different domains?

Thanks a lot

3
  • 1
    I'm stupid sometimes, but isn't that why Glassfish supports running multiple domains?
    – Gimby
    Jan 27, 2016 at 8:29
  • @Gimby Yes, that works! Also, multiple local nodes, so you can isolate local standalone instances in glassfish/nodes/$nodename/$instancename/
    – Mike
    Jan 27, 2016 at 9:02
  • i tried your Solution @Mike, May i have missing something because i'm new with Glassfish adminitration. So i edited my question, Can you, have another look to my question ..thx
    – Selma BA
    Jan 27, 2016 at 17:15

1 Answer 1

0

I think the solution is undeploy your ear archive. check this: https://docs.oracle.com/cd/E18930_01/html/821-2432/geyvr.html

It's for glassfish 3.1 but i think it's the same for GF4

1
  • Yes, the problem comes when trying to redeploy my EAR as mentioned in my question. I need to stop the server and delete all the related folder of the EAR from the application folder
    – Selma BA
    Jan 27, 2016 at 17:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.