1 2 Previous Next 15 Replies Latest reply on Jan 28, 2009 9:20 AM by poonamagarwal

    JMS client in a applet

    luca.xlb

      Hi.

      I'm trying to make an applet communicate with jboss messaging.
      The applet is signed and all jars it use are signed.

      When I try to create the queue connection, i get the following exception


      org.jboss.jms.exception.MessagingJMSException: Failed to invoke
       at org.jboss.jms.client.delegate.DelegateSupport.handleThrowable(DelegateSupport.java:271)
       at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.org$jboss$jms$client$delegate$ClientConnectionFactoryDelegate$createConnectionDelegate$aop(ClientConnectionFactoryDelegate.java:187)
       at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.invokeNext(ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.java)
       at org.jboss.jms.client.container.StateCreationAspect.handleCreateConnectionDelegate(StateCreationAspect.java:83)
       at org.jboss.aop.advice.org.jboss.jms.client.container.StateCreationAspect0.invoke(StateCreationAspect0.java)
       at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.invokeNext(ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.java)
       at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.createConnectionDelegate(ClientConnectionFactoryDelegate.java)
       at org.jboss.jms.client.JBossConnectionFactory.createConnectionInternal(JBossConnectionFactory.java:205)
       at org.jboss.jms.client.JBossConnectionFactory.createQueueConnection(JBossConnectionFactory.java:101)
       at org.jboss.jms.client.JBossConnectionFactory.createQueueConnection(JBossConnectionFactory.java:95)
       at it.necsy.voip.impl.message.JmsSenderImpl$1.run(JmsSenderImpl.java:73)
       at java.security.AccessController.doPrivileged(Native Method)
       at it.necsy.voip.impl.message.JmsSenderImpl.connect(JmsSenderImpl.java:69)
       at it.necsy.voip.impl.message.MessageSender.connect(MessageSender.java:61)
       at it.necsy.voip.impl.message.MessageSender.access$0(MessageSender.java:56)
       at it.necsy.voip.impl.message.MessageSender$InitTimerTask.run(MessageSender.java:163)
       at java.util.TimerThread.mainLoop(Unknown Source)
       at java.util.TimerThread.run(Unknown Source)
      Caused by: java.security.AccessControlException: access denied (java.util.PropertyPermission legacyParsing read)
       at java.security.AccessControlContext.checkPermission(Unknown Source)
       at java.security.AccessController.checkPermission(Unknown Source)
       at java.lang.SecurityManager.checkPermission(Unknown Source)
       at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
       at java.lang.System.getProperty(Unknown Source)
       at org.jboss.remoting.InvokerLocator.parse(InvokerLocator.java:203)
       at org.jboss.remoting.InvokerLocator.<init>(InvokerLocator.java:193)
       at org.jboss.jms.client.remoting.JMSRemotingConnection.<init>(JMSRemotingConnection.java:259)
       at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.org$jboss$jms$client$delegate$ClientConnectionFactoryDelegate$createConnectionDelegate$aop(ClientConnectionFactoryDelegate.java:152)
       ... 16 more
      


      How can I fix it?

      Luca



        • 1. Re: JMS client in a applet
          laurentk

          Hello,
          I met the same problem. Did anyone succeed in fixing it?

          Thanks for any help,

          LK

          • 2. Re: JMS client in a applet
            timfox

            JBM doesn't support clients in applets or other restricted sandboxes (like webstart), this is because JBoss Remoting (which JBM 1.x uses) doesn't support this.

            This is being fixed in JBoss remoting 2.4.0, see JIRA:

            http://jira.jboss.org/jira/browse/JBREM-978

            • 3. Re: JMS client in a applet
              laurentk

              Thanks for your answer !
              I did a test using the 2.4.0.RC2... Connection was OK, but the client could not receive messages. Instead, I had, for each message (that was quite a lot...)
              Is there any way to work around this problem? (I really would like to use JBoss Messaging for our applets :-))

              Laurent

              Exception in thread "Thread-13" java.security.AccessControlException: access denied (java.lang.RuntimePermission setContextClassLoader)
               at java.security.AccessControlContext.checkPermission(Unknown Source)
               at java.security.AccessController.checkPermission(Unknown Source)
               at java.lang.SecurityManager.checkPermission(Unknown Source)
               at java.lang.Thread.setContextClassLoader(Unknown Source)
               at org.jboss.messaging.util.JBMExecutor$TCLExecutor.run(JBMExecutor.java:75)
               at EDU.oswego.cs.dl.util.concurrent.QueuedExecutor$RunLoop.run(Unknown Source)
               at java.lang.Thread.run(Unknown Source)
              
              


              • 4. Re: JMS client in a applet
                laurentk

                After that test, I tried an http-tunnelled connection (which is, I must admit, my final goal...) and it did not succeed in establishing the connection, event with the last 2.4.0.RC2 library. Result was as shown below (all is perfectly working outside the applet jre, naturally...)

                Is there a workaround for that?

                Thanks again,

                Laurent

                10:12:25,264 WARN @AWT-EventQueue-2 [JMSRemotingConnection] JBM_clientMaxPoolSize not specified - defaulting to 200
                network: Connexion de http://127.0.0.1:4458/?callbackPollPeriod=102&clientLeasePeriod=10000&dataType=jms&marshaller=org.jboss.jms.wireformat.JMSWireFormat&unmarshaller=org.jboss.jms.wireformat.JMSWireFormat avec proxy=DIRECT
                network: Connexion de http://127.0.0.1:4458/?callbackPollPeriod=102&clientLeasePeriod=10000&dataType=jms&marshaller=org.jboss.jms.wireformat.JMSWireFormat&unmarshaller=org.jboss.jms.wireformat.JMSWireFormat avec proxy=DIRECT
                network: Connexion de http://127.0.0.1:4458/?callbackPollPeriod=102&clientLeasePeriod=10000&dataType=jms&marshaller=org.jboss.jms.wireformat.JMSWireFormat&unmarshaller=org.jboss.jms.wireformat.JMSWireFormat avec proxy=DIRECT
                network: Connexion de http://127.0.0.1:4458/?callbackPollPeriod=102&clientLeasePeriod=10000&dataType=jms&marshaller=org.jboss.jms.wireformat.JMSWireFormat&unmarshaller=org.jboss.jms.wireformat.JMSWireFormat avec proxy=DIRECT
                network: Connexion de http://127.0.0.1:4458/?callbackPollPeriod=102&clientLeasePeriod=10000&dataType=jms&marshaller=org.jboss.jms.wireformat.JMSWireFormat&unmarshaller=org.jboss.jms.wireformat.JMSWireFormat avec proxy=DIRECT
                network: Connexion de http://127.0.0.1:4458/?callbackPollPeriod=102&clientLeasePeriod=10000&dataType=jms&marshaller=org.jboss.jms.wireformat.JMSWireFormat&unmarshaller=org.jboss.jms.wireformat.JMSWireFormat avec proxy=DIRECT
                Exception occurred: org.jboss.jms.exception.MessagingNetworkFailureException
                org.jboss.jms.exception.MessagingNetworkFailureException
                 at org.jboss.jms.client.delegate.DelegateSupport.handleThrowable(DelegateSupport.java:240)
                 at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.org$jboss$jms$client$delegate$ClientConnectionFactoryDelegate$createConnectionDelegate$aop(ClientConnectionFactoryDelegate.java:187)
                 at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.invokeNext(ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.java)
                 at org.jboss.jms.client.container.StateCreationAspect.handleCreateConnectionDelegate(StateCreationAspect.java:83)
                 at org.jboss.aop.advice.org.jboss.jms.client.container.StateCreationAspect0.invoke(StateCreationAspect0.java)
                 at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.invokeNext(ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.java)
                 at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.createConnectionDelegate(ClientConnectionFactoryDelegate.java)
                 at org.jboss.jms.client.JBossConnectionFactory.createConnectionInternal(JBossConnectionFactory.java:205)
                 at org.jboss.jms.client.JBossConnectionFactory.createConnection(JBossConnectionFactory.java:87)
                 at org.jboss.jms.client.JBossConnectionFactory.createConnection(JBossConnectionFactory.java:82)
                 at fr.megiste.test.SimpleJBossTopicSubscriber.process(SimpleJBossTopicSubscriber.java:84)
                 at fr.megiste.test.JmsApplet$2.actionPerformed(JmsApplet.java:126)
                 at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
                 at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
                 at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
                 at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
                 at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
                 at java.awt.Component.processMouseEvent(Unknown Source)
                 at javax.swing.JComponent.processMouseEvent(Unknown Source)
                 at java.awt.Component.processEvent(Unknown Source)
                 at java.awt.Container.processEvent(Unknown Source)
                 at java.awt.Component.dispatchEventImpl(Unknown Source)
                 at java.awt.Container.dispatchEventImpl(Unknown Source)
                 at java.awt.Component.dispatchEvent(Unknown Source)
                 at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
                 at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
                 at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
                 at java.awt.Container.dispatchEventImpl(Unknown Source)
                 at java.awt.Component.dispatchEvent(Unknown Source)
                 at java.awt.EventQueue.dispatchEvent(Unknown Source)
                 at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
                 at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
                 at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
                 at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
                 at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
                 at java.awt.EventDispatchThread.run(Unknown Source)
                Caused by: org.jboss.remoting.CannotConnectException: Can not connect http client invoker.
                 at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java:346)
                 at org.jboss.remoting.transport.http.HTTPClientInvoker.transport(HTTPClientInvoker.java:146)
                 at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:177)
                 at org.jboss.remoting.Client.invoke(Client.java:1708)
                 at org.jboss.remoting.Client.addCallbackListener(Client.java:1739)
                 at org.jboss.remoting.Client.addListener(Client.java:999)
                 at org.jboss.remoting.Client.addListener(Client.java:878)
                 at org.jboss.remoting.Client.addListener(Client.java:861)
                 at org.jboss.jms.client.remoting.JMSRemotingConnection.addInvokerCallbackHandler(JMSRemotingConnection.java:235)
                 at org.jboss.jms.client.remoting.JMSRemotingConnection.start(JMSRemotingConnection.java:340)
                 at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.org$jboss$jms$client$delegate$ClientConnectionFactoryDelegate$createConnectionDelegate$aop(ClientConnectionFactoryDelegate.java:154)
                 ... 34 more
                Caused by: java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:4458 connect,resolve)
                 at java.security.AccessControlContext.checkPermission(Unknown Source)
                 at java.security.AccessController.checkPermission(Unknown Source)
                 at java.lang.SecurityManager.checkPermission(Unknown Source)
                 at java.lang.SecurityManager.checkConnect(Unknown Source)
                 at sun.net.www.http.HttpClient.New(Unknown Source)
                 at sun.net.www.http.HttpClient.New(Unknown Source)
                 at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
                 at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
                 at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
                 at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)
                 at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java:286)
                 ... 44 more
                
                


                • 5. Re: JMS client in a applet
                  timfox

                  Please see my previous comment, here it is again :)


                  JBM doesn't support clients in applets or other restricted sandboxes (like webstart), this is because JBoss Remoting (which JBM 1.x uses) doesn't support this.

                  This is being fixed in JBoss remoting 2.4.0, see JIRA:

                  http://jira.jboss.org/jira/browse/JBREM-978


                  • 6. Re: JMS client in a applet
                    laurentk

                    Sorry, I did misunderstand you... (I was a little tired, on friday...) If thought it was already fixed in the 2.4.0.CR2 and thought this was only a problem with jboss remoting.

                    I made all of this work by patching Jboss-remote (to fix this)

                    Caused by: org.jboss.remoting.CannotConnectException: Can not connect http client invoker.
                     at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java


                    and I did patch jboss-messaging too, in order to fix this point:

                    Exception in thread "Thread-13" java.security.AccessControlException: access denied (java.lang.RuntimePermission setContextClassLoa
                    der)
                     at java.security.AccessControlContext.checkPermission(Unknown Source)
                     at java.security.AccessController.checkPermission(Unknown Source)
                     at java.lang.SecurityManager.checkPermission(Unknown Source)
                     at java.lang.Thread.setContextClassLoader(Unknown Source)
                     at org.jboss.messaging.util.JBMExecutor$TCLExecutor.run(JBMExecutor.java:75)


                    In both cases, my patch was a quick and dirty one, adding some
                    AccessController.doPrivileged(PrivilegedAction) blocks.

                    Thanks for the quick answers,

                    LK

                    • 7. Re: JMS client in a applet
                      timfox

                      Not sure why you would need to patch JBM.

                      AFAIK this is a JBoss Remoting issue.

                      You should post this in the JBR forum so they are aware of this.

                      • 8. Re: JMS client in a applet
                        clebert.suconic

                         

                        "timfox" wrote:
                        Not sure why you would need to patch JBM.

                        AFAIK this is a JBoss Remoting issue.

                        You should post this in the JBR forum so they are aware of this.


                        Maybe Laurent is using an older TAG, since this seems fixed on Branch_CP.

                        org.jboss.messaging.util.JBMExecutor is already setting the classLoader using a Privileged block.

                        • 9. Re: JMS client in a applet

                          Hi Clebert,

                          I am facing a similar issue as Laurent.
                          I tried using jboss-remoting2.4GA.jar but I could only make the connections and was not able to receive messages.
                          I am trying to access the messages via a webstart application.
                          Can you send me the link from where I can download the jboss-remoting jar which has fixed this issue (both the connection and the receiveing of messages).

                          Your help is appreciated.

                          -Poonam.

                          • 10. Re: JMS client in a applet
                            clebert.suconic

                            Right before the release of JBoss 1.4.1, we've found/fixed a few issues regarding Security (or sandbox) on AOP and Remoting.


                            As discussed on this URL:
                            http://www.jboss.com/index.html?module=bb&op=viewtopic&t=145765&postdays=0&postorder=asc&start=40 (Page 5)


                            I suggest you use the versions available at JBoss5.

                            http://anonsvn.jboss.org/repos/jbossas/tags/JBoss_5_0_0_GA/component-matrix/pom.xml


                            JBossAOP had a few issues also, and they fixed it on JBossAOP 2.0.0.SP1 (I think.. double check on the pom above)


                            You could find the versions you need at http://repository.jboss.com.


                            You would be better on using Jboss5 I guess. Is that an option for you?


                            • 11. Re: JMS client in a applet
                              timfox

                              I don't recommend you using a mish-mash of versions of JBM and remoting.

                              We have only tested the versions as specified in the user guide.

                              • 12. Re: JMS client in a applet
                                clebert.suconic

                                 

                                "timfox" wrote:
                                I don't recommend you using a mish-mash of versions of JBM and remoting.

                                We have only tested the versions as specified in the user guide.


                                Me neither. My recommendation was JBoss5.

                                • 13. Re: JMS client in a applet

                                  Well Clebert,
                                  I had downloaded the latest version of jboss-remoting2.5.0SP2.jar from
                                  http://repository.jboss.com/jboss/remoting/
                                  along with Jboss 4.2.0 and JBM 1.4.0.

                                  Using this, I could only make connections to the server but I could not receive jms messages.
                                  For now as a temporary workaround, I have disabled java security policy and it works for a webstart client. But, this is not an acceptable solution.

                                  Alternatively,
                                  Jboss 5 also comes with version jboss-remoting2.5.0SP2.jar of jboss remoting which is same to what I am using with Jboss4.2.0GA. I have less hopes that migrating to Jboss5 will solve the problem of receiving jms messages but will surely give it a try.

                                  Thanks for your inputs.

                                  -Poonam.

                                  • 14. Re: JMS client in a applet
                                    clebert.suconic

                                    You can't use jboss-remoting2.5.0SP2.jar with JBM 1.4.0. We haven't tested that.


                                    My suggestion for the versions on JB5 was regarding to using JBoss5.

                                    1 2 Previous Next