Jakarta ee 无法通过Glassfish 4.1 web管理员创建任何JMS资源

Jakarta ee 无法通过Glassfish 4.1 web管理员创建任何JMS资源,jakarta-ee,glassfish,jms,Jakarta Ee,Glassfish,Jms,我已经安装了GlassFish4,并尝试创建一些JMS资源,以便遵循学习JMS的教程,但这是不可能的。在web界面上,它总是显示文本“java.lang.RuntimeException”,在日志控制台上显示堆栈跟踪。当我在“JMS目标资源”页面或连接工厂页面上推送链接“New…”时,总会引发此异常。以下是堆栈跟踪: [#|2015-11-16T09:15:24.090+0100|INFO|glassfish 4.1|org.glassfish.admingui|_ThreadID=48;_Th

我已经安装了GlassFish4,并尝试创建一些JMS资源,以便遵循学习JMS的教程,但这是不可能的。在web界面上,它总是显示文本“java.lang.RuntimeException”,在日志控制台上显示堆栈跟踪。当我在“JMS目标资源”页面或连接工厂页面上推送链接“New…”时,总会引发此异常。以下是堆栈跟踪:

[#|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
|#]
我不明白为什么这个恼人的错误的解决方案没有在互联网上注册。
有人能帮我吗?

我在JDBC资源方面也遇到同样的问题

解决方法

我可以使用
asadmin控制台
addresources

您可以在此处看到文档,它使用xml文件:

我还尝试了Glassfish 4.0(而不是4.1.1),并且在Web管理GUI上运行良好

解释我的案例

我正在达尔文内核版本14.4.0上使用Glassfish 4.1.1(build 1),java版本为“1.8.0(Java8U66)

我尝试在管理gui中添加新的JDBC资源: -->左侧菜单-->服务器-->资源-->组合框“新建”JDBC资源

事实上,这个组合框的所有选项都会出现错误。同样的问题也出现在: -->左菜单-->资源-->JDBC-->JDBC资源(或JDBC连接池)

Web GUI显示“class java.lang.RuntimeException”,日志文件显示:

[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]

在创建JMS资源CF和连接队列/主题时,我遇到了类似的错误。但以下命令在command asadmin为我工作>

asadmin> create-jms-resource --host localhost --port 4848 --restype javax.jms.TopicConnectionFactory --property  Name=MyID jms/DurableTopicConnectionFactory
命令create-jms-resource已成功执行

asadmin> create-jms-resource --host localhost --port 4848 --restype javax.jms.QueueConnectionFactory --property  Name=MyQCF jms/QCF1
asadmin> create-jms-resource --host localhost --port 4848 --restype javax.jms.Topic --property Name=PhysicalTopic jms/MyTopic
asadmin> create-jms-resource --host localhost --port 4848 --restype javax.jms.Queue --property Name=PhysicalQueue jms/MyQueue
命令create-jms-resource已成功执行

asadmin> create-jms-resource --host localhost --port 4848 --restype javax.jms.QueueConnectionFactory --property  Name=MyQCF jms/QCF1
asadmin> create-jms-resource --host localhost --port 4848 --restype javax.jms.Topic --property Name=PhysicalTopic jms/MyTopic
asadmin> create-jms-resource --host localhost --port 4848 --restype javax.jms.Queue --property Name=PhysicalQueue jms/MyQueue
不推荐使用的语法,请改用:
asadmin--主机本地主机--端口4848创建jms资源[选项]…

已创建管理对象jms/MyTopic。 命令create-jms-resource已成功执行

asadmin> create-jms-resource --host localhost --port 4848 --restype javax.jms.QueueConnectionFactory --property  Name=MyQCF jms/QCF1
asadmin> create-jms-resource --host localhost --port 4848 --restype javax.jms.Topic --property Name=PhysicalTopic jms/MyTopic
asadmin> create-jms-resource --host localhost --port 4848 --restype javax.jms.Queue --property Name=PhysicalQueue jms/MyQueue
已创建管理对象jms/MyQueue

注意:您可以安全地忽略不推荐使用的消息。只需刷新管理页面资源并单击“新建”,您将看到新的资源


希望这有帮助。

这个问题似乎已经在Glassfish 4.1.2中解决了,在那里可以使用web管理界面创建新的JMS资源。

如果您特别想创建JMS资源,您可以使用asadmin中的create JMS resource命令来创建

创建jms资源--restype javax.jms.Queue--property Name=myQueue jms/myQueue

同样对于那些不确定如何获得asadmin的人,有一个很好的答案


来源:

解决方案可能是Payara。Glassfish是一个开源的、不受支持的参考实现,Payara虽然仍然是免费的、开源的,但实际上定期对服务器软件应用补丁。在我看来,再也没有理由安装Glassfish了。他们仍然在官方netbeans下载页面上提供4.1.1,这是一件微不足道的事情:(这是什么样的软件,如果他们向全世界发布了一个坏的应用程序?@VictorStafusa这个问题显然在5.0中得到了解决。现在Glassfish可以通过
git
使用Maven,应该可以构建一个开发版本并进行试用,即使这个bug表现出糟糕的软件质量并破坏了它的功能。)对于JavaEE参考实现的信任,关于这个问题的评论不言而喻。