Unable to create any JMS resource through Glassfish 4.1 web admin

I installed Glassfish 4 and tried to create some JMS resources to learn the JMS tutorial, but that is not possible. The text "java.lang.RuntimeException" always appears in the web interface, and a stack trace is displayed in the log console. This exception is always thrown, I click the Create ... link on the JMS Destination Resources page or on the connection factories page. Here is the stack trace:

[#|2015-11-16T09:15:24.090+0100|INFO|glassfish 4.1|org.glassfish.admingui|_ThreadID=48;_ThreadName=admin-listener(5);_TimeMillis=1447661724090;_LevelValue=800;| Exception Occurred :null|#] [#|2015-11-16T09:15:24.097+0100|INFO|glassfish 4.1|org.glassfish.admingui|_ThreadID=48;_ThreadName=admin-listener(5);_TimeMillis=1447661724097;_LevelValue=800;| Exception Occurred :null|#] [#|2015-11-16T09:15:24.100+0100|SEVERE|glassfish 4.1|javax.enterprise.resource.webcontainer.jsf.context|_ThreadID=48;_ThreadName=admin-listener(5);_TimeMillis=1447661724100;_LevelValue=1000;| java.lang.RuntimeException: java.lang.reflect.InvocationTargetException while attempting to process a 'beforeCreate' event for 'event166'. at com.sun.jsftemplating.layout.descriptors.LayoutElementBase.dispatchHandlers(LayoutElementBase.java:422) at com.sun.jsftemplating.layout.descriptors.LayoutElementBase.dispatchHandlers(LayoutElementBase.java:394) at com.sun.jsftemplating.layout.descriptors.LayoutComponent.beforeCreate(LayoutComponent.java:348) at com.sun.jsftemplating.layout.descriptors.LayoutComponent.getChild(LayoutComponent.java:288) at com.sun.jsftemplating.layout.LayoutViewHandler.buildUIComponentTree(LayoutViewHandler.java:556) at com.sun.jsftemplating.layout.LayoutViewHandler.buildUIComponentTree(LayoutViewHandler.java:551) at com.sun.jsftemplating.layout.LayoutViewHandler.buildUIComponentTree(LayoutViewHandler.java:507) at com.sun.jsftemplating.layout.LayoutViewHandler.buildUIComponentTree(LayoutViewHandler.java:507) at com.sun.jsftemplating.layout.LayoutViewHandler.createView(LayoutViewHandler.java:255) at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:256) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:123) at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:658) at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:344) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) at com.sun.webui.jsf.util.UploadFilter.doFilter(UploadFilter.java:233) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:316) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734) at org.apache.catalina.core.StandardPipeline.doChainInvoke(StandardPipeline.java:678) at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174) at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:416) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:283) 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:206) at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:180) 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:283) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200) at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:132) at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:111) at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77) at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:536) 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:591) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:571) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.GeneratedMethodAccessor156.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at com.sun.jsftemplating.layout.descriptors.handler.Handler.invoke(Handler.java:442) at com.sun.jsftemplating.layout.descriptors.LayoutElementBase.dispatchHandlers(LayoutElementBase.java:420) ... 46 more Caused by: java.lang.NullPointerException at com.sun.jsftemplating.handlers.UtilHandlers.mapPut(UtilHandlers.java:314) ... 51 more |#] 

I do not understand why the solution for this annoying error is not registered on the Internet. Can anybody help me?

+7
java-ee glassfish jms
source share
3 answers

I have the same issue with JDBC resources

Bypass

I managed to add resources using asadmin console using add-resources command

You can see the documentation here using the XML file: https://docs.oracle.com/cd/E19776-01/820-4497/6nfv6jlim/index.html

I also tried Glassfish 4.0 (not 4.1.1) and everything worked fine in the Web-Admin-GUI

Explanation of my case

I am using Glassfish 4.1.1 (build 1) in the Darwin kernel version 14.4.0 with java version "1.8.0_40" (Java 8u66)

I tried adding a new JDBC resource to admin-gui: -> menu on the left -> server -> Resources -> combobox 'new' JDBC resources

In fact, an error occurs in all parameters of this list. Also the same problem in: -> left menu → Resources → JDBC → JDBC Resources (or JDBC connection pools)

The Web GUI show "class java.lang.RuntimeException" and the log file says:

 [2015-11-18T09:34:46.529-0200] [glassfish 4.1] [SEVERE] [] [javax.enterprise.resource.webcontainer.jsf.context] [tid: _ThreadID=52 _ThreadName=admin-listener(3)] [timeMillis: 1447846486529] [levelValue: 1000 [[java.lang.RuntimeException: java.lang.reflect.InvocationTargetException while attempting to process a 'beforeCreate' event for 'event157'. at com.sun.jsftemplating.layout.descriptors.LayoutElementBase.dispatchHandlers(LayoutElementBase.java:422) at com.sun.jsftemplating.layout.descriptors.LayoutElementBase.dispatchHandlers(LayoutElementBase.java:394) at com.sun.jsftemplating.layout.descriptors.LayoutComponent.beforeCreate(LayoutComponent.java:348) .... [snip] Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) .... [snip] Caused by: java.lang.NullPointerException at com.sun.jsftemplating.handlers.UtilHandlers.mapPut(UtilHandlers.java:314) .... [snip] 
+3
source share

I was getting a similar error when creating JMS resource resources and connection queues / themes. But below the team worked for me on the asadmin command>

 asadmin> create-jms-resource --host localhost --port 4848 --restype javax.jms.TopicConnectionFactory --property Name=MyID jms/DurableTopicConnectionFactory 

The create-jms-resource command completed successfully.

 asadmin> create-jms-resource --host localhost --port 4848 --restype javax.jms.QueueConnectionFactory --property Name=MyQCF jms/QCF1 

The create-jms-resource command completed successfully.

 asadmin> create-jms-resource --host localhost --port 4848 --restype javax.jms.Topic --property Name=PhysicalTopic jms/MyTopic 

Deprecated syntax, use:
asadmin --host localhost --port 4848 create-jms-resource [options] ..
Created jms / MyTopic managed entity. The create-jms-resource command completed successfully.

 asadmin> create-jms-resource --host localhost --port 4848 --restype javax.jms.Queue --property Name=PhysicalQueue jms/MyQueue 

Created jms / MyQueue managed entity.

Note. You can safely ignore an outdated message. Just update the resources of the admin page and click "Create", you will see new resources.

hope this helps.

+3
source share

This problem was apparently resolved in Glassfish 4.1.2 , where you can create new JMS resources using the web admin interface.

+2
source share

All Articles