• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Client cannot connect to JBoss application server over internet

 
Ranch Hand
Posts: 159
Eclipse IDE C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Guys,
I have an application that wants to connect to my JBOSS 3.2.2 application server over the internet.
It all runs fine local, but when I run it from another computer, my client can not connect.
My application is a Jar file.
I removed 2 files from the meta-inf directory SUN_MICR.RSA and SUN_MICR.SF. This had to be done because otherwise I got security exceptions.
I think my ISP blocks all ports under the 2000, so I already tried to change ports in jboss-service.xml file. I changed the rmi port and listen port to something bigger, here is the sample...:
----------------------- jboss-service.xml -----------------
<!-- The listening port for the bootstrap JNP service. Set this to -1
to run the NamingService without the JNP invoker listening port.
-->
9099
<!-- The bootstrap JNP server bind address. This also sets the default
RMI service bind address. Empty == all addresses
-->
<!-- The port of the RMI naming service, 0 == anonymous -->
9098
<!-- The RMI service bind address. Empty == all addresses
-->
----------------------------------------------------------
and I connect in my client (and also in my application server, when beans are talking to each other)
-------------------- MyClient code: getInitialcontext ----
private Context getInitialContext(String ip,String port) throws NamingException
{
Hashtable environment = new Hashtable();
environment.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
environment.put(Context.URL_PKG_PREFIXES, "org.jboss.naming rg.jnp.interfaces");
environment.put(Context.PROVIDER_URL,ip+":"+port);
environment.put(Context.SECURITY_PRINCIPAL, "guest");
environment.put(Context.SECURITY_CREDENTIALS, "guest");
return new InitialContext(environment);
}
---------------------------------------------------------
I used to place jnp:// before the ip, but I read on a site that I should not do that when working over the internet.. don't know if its true, but anyway my exception changd by removing it (from CommunicationException to ConnectionException).
it goes wrong when I try to create the home interface of one to one of my beans = when I use the ctx for the first time...

Here is the exception...
java.rmi.ConnectException: Connection refused to host: (my ip address); nested exception is:
java.net.ConnectException: Connection timed out: connect
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:567)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185
)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:101)
at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Sour
ce)
at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvo
kerProxy.java:135)
at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.jav
a:96)
at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.
java:46)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:4
5)
at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:173)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:85)
at $Proxy0.create(Unknown Source)
at MoehahaClient.Login.jButtonConnect_actionPerformed(Login.java:168)
at MoehahaClient.Login_jButtonConnect_actionAdapter.actionPerformed(Logi
n.java:276)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:17
67)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
ctButton.java:1820)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
.java:419)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257
)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
istener.java:258)
at java.awt.Component.processMouseEvent(Component.java:5021)
at java.awt.Component.processEvent(Component.java:4818)
at java.awt.Container.processEvent(Container.java:1525)
at java.awt.Component.dispatchEventImpl(Component.java:3526)
at java.awt.Container.dispatchEventImpl(Container.java:1582)
at java.awt.Component.dispatchEvent(Component.java:3367)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3359
)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3074)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3004)
at java.awt.Container.dispatchEventImpl(Container.java:1568)
at java.awt.Window.dispatchEventImpl(Window.java:1581)
at java.awt.Component.dispatchEvent(Component.java:3367)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:445)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:191)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:144)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:130)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:98)
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:295)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:161)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:148)
at java.net.Socket.connect(Socket.java:425)
at java.net.Socket.connect(Socket.java:375)
at java.net.Socket.(Socket.java:290)
at java.net.Socket.(Socket.java:118)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirect
SocketFactory.java:22)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMaster
SocketFactory.java:122)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:562)
... 36 more
Could it have anythin to do with the rmi policy file (wich I don't have ?)
Can anyone help me please ?
Any hints, thoughts are highly appreciated..I'm already searching for 3 days on this and its driving me crazy.
Thnx!
 
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"themuppeteer",
Two things...
1) Thanks for joining JavaRanch, but could you take a quick look at the naming policy and edit your profile accordingly.
2) I am moving this thread to the JBoss forum...
 
Mark Uppeteer
Ranch Hand
Posts: 159
Eclipse IDE C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
and I was so glad I saw a 1 next to replies...
Anyway, I don't think this belongs under JBoss, I just put JBoss in
the description to be more descriptive. (its like putting it under TCP/IP because it uses tcp ip for communication..)
It is a problem of which I don't know where it lies.
 
Mark Uppeteer
Ranch Hand
Posts: 159
Eclipse IDE C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As predicted, it had nothing to do with jboss...
I forgot the portableRemoteObject.narrow funtion in my client.
reply
    Bookmark Topic Watch Topic
  • New Topic