Cannot create any JMS resource through Glassfish 4.1 web admin

I have installed Glassfish 4 and tried to create some JMS resources for following a tutorial on learning JMS, but it is impossible. On web interface it always is appearing the text "java.lang.RuntimeException" and on the log console it shows the stack trace. This exception is thrown always I push the link "New..." on the page "JMS Destination Resources" or in the page of the connection factories. 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 don't understand why the solution for this annoying bug is not registered on the Internet. Can someone help me?

Upvotes: 9

Views: 9502

Answers (4)

Pranav
Pranav

Reputation: 686

Just adding to what Porks said, if you specifically wanted to create a JMS resource, you can do so with the create-jms-resource command in asadmin.

create-jms-resource --restype javax.jms.Queue --property Name=myQueue jms/MyQueue

Also for those unsure about how to get at asadmin, there's a great answer here.

Source: https://docs.oracle.com/cd/E19879-01/820-4332/create-jms-resource-1/index.html

Upvotes: 0

Jose Tepedino
Jose Tepedino

Reputation: 1584

This problem seems to have been solved in Glassfish 4.1.2, where it is possible to create new JMS resources using the web admin interface.

Upvotes: 3

ramnyc
ramnyc

Reputation: 51

I was getting similar error while creating the JMS resource CF and Connection Queue/Topic. But below commands worked for me at command asadmin>

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

Command create-jms-resource executed successfully.

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

Command create-jms-resource executed successfully.

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

Deprecated syntax, instead use:
asadmin --host localhost --port 4848 create-jms-resource [options] ..
Administered object jms/MyTopic created. Command create-jms-resource executed successfully.

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

Administered object jms/MyQueue created.

Note: You can safely ignore the Deprecated message. Just refresh the admin page resources and click "New" you will see the new resources.

hope this helps.

Upvotes: 5

Porks
Porks

Reputation: 131

I am with the same problem here with JDBC Resources

Workaround

I was able to add resources using the asadmin console with the command add-resources

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

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

Explaining my case

I am using Glassfish 4.1.1 (build 1) on a Darwin Kernel Version 14.4.0 with java version "1.8.0_40" (Java 8u66)

I tried to add a new JDBC resource at the admin-gui: --> left menu --> server --> Resources --> combobox 'new' JDBC Resources

In fact the error occours in all options of this combobox. Also the same problem in the: --> 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]

Upvotes: 4

Related Questions