[JBoss-user] [EJB/JBoss] - Re: Applet and EJB
Last time I did something similar to this was in a rush so didn't get a chance to look into the problem too deeply. I think my solution in the end was to sign all jars used by the Applet, so that included the JBoss jars. View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3876251#3876251 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3876251 --- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [EJB/JBoss] - Re: Applet and EJB
I'm having a similar issue. When I invoke the create method on my bean, I get an error (see below). I have signed my applet and I'm looking up the context using the following code: Properties jndiProps = new Properties() ; String myServer = this.getCodeBase().getHost (); jndiProps.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory" ) ; jndiProps.setProperty("java.naming.provider.url", "127.0.0.1:1099" ) ; jndiProps.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces" ) ; participantHome = (DrawingParticipantSessionHome)PortableRemoteObject.narrow( new InitialContext(jndiProps).lookup( "ejb/chickenscratch/drawing/bus/ejb/DrawingParticipantSession" ), DrawingParticipantSessionHome.class) ; The server is hosted on my local machine (so 127.0.0.1 should be the correct IP). I've also validated that the JNDI name I'm passing is correct. Can anyone offer any suggestions? java.security.AccessControlException: access denied (java.lang.RuntimePermission accessDeclaredMembers) 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.checkMemberAccess(Unknown Source) at java.lang.Class.checkMemberAccess(Unknown Source) at java.lang.Class.getDeclaredMethods(Unknown Source) at org.jboss.invocation.MarshalledInvocation$DeclaredMethodsAction.run(MarshalledInvocation.java:571) at java.security.AccessController.doPrivileged(Native Method) at org.jboss.invocation.MarshalledInvocation.getFullInterfaceHashes(MarshalledInvocation.java:157) at org.jboss.invocation.MarshalledInvocation.calculateHash(MarshalledInvocation.java:303) at org.jboss.invocation.MarshalledInvocation.writeExternal(MarshalledInvocation.java:473) at java.io.ObjectOutputStream.writeExternalData(Unknown Source) at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source) at java.io.ObjectOutputStream.writeObject0(Unknown Source) at java.io.ObjectOutputStream.writeObject(Unknown Source) at sun.rmi.server.UnicastRef.marshalValue(Unknown Source) at sun.rmi.server.UnicastRef.invoke(Unknown Source) at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source) at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:118) at org.jboss.invocation.InvokerInterceptor.invokeInvoker(InvokerInterceptor.java:163) at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:103) at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46) at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:169) at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:91) at $Proxy0.create(Unknown Source) at chickenscratch.app.applet.DrawingApplet.init(Unknown Source) at sun.applet.AppletPanel.run(Unknown Source) at java.lang.Thread.run(Unknown Source) View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3876239#3876239 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3876239 --- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [EJB/JBoss] - Re: Applet and EJB
Lets focus on one thing at the time. You need to make other changes in your configuration in order to use RMI over HTTP (just using HttpNamingContextFactory wont do it). First of all, I assume that the ip of your JBoss box is not 127.0.0.1 since you say yoi run it on another box. Still it seems that you are trying to connect to localhost when doing the JNDI lookup. Do you use ip or hostname in "myip"? Check your host files and check that you dont use a hostname that resolves to localhost(127.0.0.1). View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3873710#3873710 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3873710 --- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [EJB/JBoss] - Re: Applet and EJB
By the way myip is the ip of the other machine which is hosting JBOSS View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3873620#3873620 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3873620 --- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [EJB/JBoss] - Re: Applet and EJB
Hi Just so you know this is how I am naming props: Properties jndiProps = new Properties() ; Context context = new InitialContext(jndiProps); jndiProps.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory" ) ; jndiProps.setProperty("java.naming.provider.url", myip:1099) ; jndiProps.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming:org.jboss.naming" ) ; jndiProps.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces" ) ; // The below statment is where the error is returned TestAppletHome home = (TestAppletHome)PortableRemoteObject.narrow( new InitialContext(jndiProps).lookup( "TestApplet" ), TestAppletHome.class) ; error: javax.naming.CommunicationExecption [Root execption is java.rmi.ConnectionExecption: Connection refused to host 127.0.0.1; nested execption is: java.net.ConnectionExecption: Connection refused: connect] I have in the java.policy file: permission java.net.SocketPermission "127.0.0.1:1098-", "accept, connect, listen, resolve"; permission java.net.SocketPermission "127.0.0.1:1099-", "accept, connect, listen, resolve"; and i still get this error. if I make this change below as you suggested: HttpNamingContextFactory. Am I using the correct class from the jar jbossall-client.jar? jndiProps.setProperty("java.naming.factory.initial", "org.jboss.naming.HttpNamingContextFactory" ) ; where else should changes be applied? Thanks for all the help... Austin View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3873619#3873619 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3873619 --- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [EJB/JBoss] - Re: Applet and EJB
A few ideas that might you in the right direction: 1. JNP I am not sure how you set the naming props in your applet. Try this for now: Properties env = new Properties(); | env.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory"); | env.setProperty("java.naming.provider.url", "YourServerIP:1099"); | Context ctx = new InitialContext(env); If you get this to work you can then change to get the IP of the server from the applet instead of hardwiring it. 2. Port 1099 The deafult port for the naming service is 1099. You need to allowed to connect to that port from the applet.(unless you have changed the port). 3. Signing the applet Another way to get the applet to make those network connection outside the sandbox is to sign it. That way you dont have to bother about the policy file. If you want to deploy this solution over the Internet you probably want to change the naming service to use the HttpNamingContextFactory to run it over HTTP and get through all those fws. View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3873563#3873563 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3873563 --- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user