PDA

View Full Version : Connection refused on port 8080


savia
05-17-2010, 03:08 PM
Hello,

I have an web application working fine on port 80 with resin as webserver.
My problem comes where I try to change port number, I edit resin.conf file and change:

<http address="*" port="80"/>

to

<http address="*" port="8080"/>

Application starts fine but when i enter in a servlet RESIN crash with :

com.caucho.hessian.client.HessianRuntimeException: java.net.ConnectException: Connection refused
at com.caucho.hessian.client.HessianProxy.sendRequest (HessianProxy.java:300)
at com.caucho.hessian.client.HessianProxy.invoke(Hess ianProxy.java:166)
at $Proxy14.create(Unknown Source)


Its like resin webServer couldnt connect with hessian repository with 8080 port.

Could you help me please

emil
05-17-2010, 06:04 PM
Hi savia,

You'll need to check the logs to see if Resin is actually opening the port and/or picking up the changes to made to the configuration. It could be that you're modifying the wrong configuration file or part of the configuration file, there could be a networking issue, or it could be something else, but the logs will show what it is.

Emil

savia
05-18-2010, 07:10 AM
Hi,

I dont think so, because I have a login screen and this is shown me using port 8080, but when I login me is the first time I use a servlet+ejb to connect a database. In resin.conf I had to modify this

<ejb-server config-directory="WEB-INF"/>
<jndi-link jndi-name="java:comp/env/ejb"
factory="com.caucho.ejb.hessian.HessianContextFactory">
<init-param java.naming.provider.url='http://iportal.local/hessian'/>
</jndi-link>

In the host config for this otre one

<ejb-server config-directory="WEB-INF"/>
<jndi-link jndi-name="java:comp/env/ejb"
factory="com.caucho.ejb.hessian.HessianContextFactory">
<init-param java.naming.provider.url='http://iportal.local:8080/hessian'/>
</jndi-link>

If not i receive the error

com.caucho.hessian.client.HessianRuntimeException: java.net.ConnectException: http://iportal.local/hessian Connection refused
at com.caucho.hessian.client.HessianProxy.sendRequest (HessianProxy.java:300)
at com.caucho.hessian.client.HessianProxy.invoke(Hess ianProxy.java:166)
at $Proxy14.create(Unknown Source)

with this change i receive

com.caucho.hessian.client.HessianRuntimeException: java.net.ConnectException: Connection refused
at com.caucho.hessian.client.HessianProxy.sendRequest (HessianProxy.java:300)
at com.caucho.hessian.client.HessianProxy.invoke(Hess ianProxy.java:166)
at $Proxy14.create(Unknown Source)


This error come from the source code line

Sp000iniH.create() <- this is where I create the EJB connection.

In the port 80 goes fine...

savia
05-18-2010, 07:33 AM
I,

I found the problem. In resin.conf I had to change 3 different places to change the port:

1.- <http address="192.168.65.15" port="8080"/>


2 y 3.- In the VirtualHost

<host id="iportal.local:8080" root-directory=".">
<web-app id="" document-directory="/webapps/iportal">

<!-- Base de datos de Savia ORACLE -->
<database>
<jndi-name>jdbc/gxpower</jndi-name>
<driver>
<type>oracle.jdbc.driver.OracleDriver</type>
<url>jdbc:oracle:thin:@127.0.0.1:1502:oracle9i</url>
<user>oracle</user>
<password>oracle</password>
</driver>
<spy>true</spy>
</database>


<ejb-server config-directory="WEB-INF"/>
<jndi-link jndi-name="java:comp/env/ejb"
factory="com.caucho.ejb.hessian.HessianContextFactory">
<init-param java.naming.provider.url='${app.url}:8080/hessian'/>
</jndi-link>
</web-app>
</host>

sblommers
05-18-2010, 10:43 AM
Thank you for sharing! ;)

fusion
06-13-2010, 03:48 AM
It's a good tip for me, thanks.