使用 jms 连接到 activemq 时,小程序未在浏览器上初始化
我创建了一个 Java 小程序,它的作用类似于白板,并使用使用 Websphere 应用程序服务器连接到 activemq 代理的 jms 传输实时坐标。
当我在 Eclipse 的小程序查看器中运行小程序时,我的代码运行良好,并且当我将小程序嵌入到 html 文件中并尝试通过浏览器运行相同的程序时,接收端在白板上绘制坐标,
我收到错误“小程序未初始化”。 我尝试通过 sun 提供的 appletviewer 运行相同的内容(iam 使用 linux-fedora),iam 在终端中收到此错误:-
java.lang.ExceptionInInitializerError 在 org.apache.activemq.ActiveMQConnectionFactory.setBrokerURL(ActiveMQConnectionFactory.java:373) 在org.apache.activemq.ActiveMQConnectionFactory。(ActiveMQConnectionFactory.java:135) 在org.apache.activemq.ActiveMQConnectionFactory。(ActiveMQConnectionFactory.java:131) 在 jmspub.Pub.init(Pub.java:26) 在 sun.applet.AppletPanel.run(AppletPanel.java:436) 在 java.lang.Thread.run(Thread.java:636) 引起原因:java.security.AccessControlException:访问被拒绝(java.util.PropertyPermission *读、写) 在 java.security.AccessControlContext.checkPermission(AccessControlContext.java:342) 在 java.security.AccessController.checkPermission(AccessController.java:553) 在 java.lang.SecurityManager.checkPermission(SecurityManager.java:549) 在 java.lang.SecurityManager.checkPropertiesAccess(SecurityManager.java:1269) 在 java.beans.PropertyEditorManager.setEditorSearchPath(PropertyEditorManager.java:169) 在 org.apache.activemq.util.IntrospectionSupport。(IntrospectionSupport.java:57) ...
这行代码中还有 6 个错误:- ActiveMQConnectionFactoryfactory = new ActiveMQConnectionFactory("tcp://localhost:61616");
请帮我找到解决方案......
I have created a java applet which acts like a whiteboard and transmits realtime coordinates using jms connected to activemq broker using Websphere application Server.
While i run the applet in applet viewer of eclipse my code runs fine and the receiving end draws the coordinates on whiteboard
when i embed the applet in a html file and try running the same through the browser i get an error "applet not initialized".
I tried running the same through the appletviewer provided by sun (iam using linux-fedora), iam getting this error in the terminal :-
java.lang.ExceptionInInitializerError
at org.apache.activemq.ActiveMQConnectionFactory.setBrokerURL(ActiveMQConnectionFactory.java:373)
at org.apache.activemq.ActiveMQConnectionFactory.(ActiveMQConnectionFactory.java:135)
at org.apache.activemq.ActiveMQConnectionFactory.(ActiveMQConnectionFactory.java:131)
at jmspub.Pub.init(Pub.java:26)
at sun.applet.AppletPanel.run(AppletPanel.java:436)
at java.lang.Thread.run(Thread.java:636)
Caused by: java.security.AccessControlException: access denied (java.util.PropertyPermission * read,write)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:342)
at java.security.AccessController.checkPermission(AccessController.java:553)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
at java.lang.SecurityManager.checkPropertiesAccess(SecurityManager.java:1269)
at java.beans.PropertyEditorManager.setEditorSearchPath(PropertyEditorManager.java:169)
at org.apache.activemq.util.IntrospectionSupport.(IntrospectionSupport.java:57)
... 6 more
error is in this line of the code:-
ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory("tcp://localhost:61616");
Please Help me find a solution....
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
AccessControlExceptions 表明该小程序需要被信任。
OTOH 这个说法很可疑。
这个字符串是如何形成的?它是否指向“主”服务器?如果是这样,JRE 似乎会被混淆,并且小程序将不需要签名。
AccessControlExceptions are indicating this applet needs to be trusted.
OTOH this statement is suspicious.
How is that String formed? Does it point back to the 'home' server? If it does, the JRE seems to be confused and the applet will not need signing.
看起来 ActiveMQ 正在尝试注册小程序安全沙箱不允许的 PropertyEditor。我已打开错误报告 AMQ-3181。即使属性编辑器没有注册,每件事都应该正常工作,因此这是一个只需捕获异常的简单情况。
Looks like ActiveMQ is trying to register a PropertyEditor which is not allowed by the applet security sandbox. I've opened bug report AMQ-3181. Every thing should work fine even if the property editor does not get registered so it's a simple case of just having to trap the exception.