This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Spring and the fly likes bean.xml ConnectException-Connection timed out: connect Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "bean.xml ConnectException-Connection timed out: connect" Watch "bean.xml ConnectException-Connection timed out: connect" New topic
Author

bean.xml ConnectException-Connection timed out: connect

sze sze chan
Greenhorn

Joined: Jul 27, 2011
Posts: 18
Hi everyone,
I'm very new to Spring and trying to enhance a Java program on Eclipse and connected to Oracle database.
This is my first time ever for posting on forums, any help is much appreciate!!!

I have a jobmgmt_beans.xml file and it's in the same package with all the other classes under src/net.JavaCodeEnhancement inside Eclipse.
There is always a red little cross mark on the jobmgmt_beans.xml file icon, and when open this file, it shows ConnectException-Connect timed out: connect at the bottom of eclips .Does anyone has any idea on what is causing the error ?

I'm currently using eclipse 3.3.1.1 and Spring framework 3.0.5

<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>mars-beans.properties</value>
<value>mars-password.properties</value>
</list>
</property>
</bean>

<bean id="PoolingDAO"
init-method="decrypt"
class="net.CodeEnhancement.jdbcDAO" >
<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver" />
<property name="key" value="${key}" />
<property name="url" value="${db.url}" />
<property name="username" value="${db.username}" />
<property name="password" value="${db.password}" />
<property name="connCache" value="true" />
<property name="connCacheProperties">
<props>
<prop key="MaxStatementsLimit">100</prop>
<prop key="PropertyCheckInterval">60</prop>
</props>
</property>
</bean>

<bean id="DBHelperBean" class="net.CodeEnhancement.DBHelper">
<property name="db"><ref local="PoolingDAO"/></property>
<property name="schemaName" value="${db.schema}" />
</bean>

</beans>

Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3826

Welcome to CodeRanch!

What "JobMgmt.JOBMGT_BEANS_FILE" referes to? And tell us how you run the application and your file structure etc...


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

make sure that the file "jobmgmt_beans.xml" is on classpath, i.e if you are using Eclipse then it should resides under "bin" dir.


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
sze sze chan
Greenhorn

Joined: Jul 27, 2011
Posts: 18
Vijitha Kumara wrote:Welcome to CodeRanch!

What "JobMgmt.JOBMGT_BEANS_FILE" referes to? And tell us how you run the application and your file structure etc...


Hi, thanks for your reply !

I've solved the file not exist error for calling "JobMgmt.JOBMGT_BEANS_FILE" inside the main, JOBMGT_BEANS_FILE was defined at the top of main:
public static final String JOBMGMT_BEANS_FILE = "jobmgmt_beans.xml";

but I'm still having that little red cross icon on my jobmgmt_beans.xml file
It still stated that is the ConnectException-connect time out: connect

I'm thinking could the problem caused by
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN //EN" "http://www.springframework.org/dtd/spring-beans.dtd">
inside the .xml file?
as I'm using sping 3x, is that the right dtd ?
sze sze chan
Greenhorn

Joined: Jul 27, 2011
Posts: 18
Sagar Rohankar wrote:make sure that the file "jobmgmt_beans.xml" is on classpath, i.e if you are using Eclipse then it should resides under "bin" dir.

Hi,
It works when it is in the bin, thanks
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

sze sze chan wrote:
I'm thinking could the problem caused by
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN //EN" "http://www.springframework.org/dtd/spring-beans.dtd">
inside the .xml file?
as I'm using sping 3x, is that the right dtd ?

This is the one I used in my project, try this:
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
OR I suspect the proxy problem if you're inside the network. The eclipse is trying tho access that DTD link but somehow not able to reach. Check you network connection in Eclipse.
sze sze chan
Greenhorn

Joined: Jul 27, 2011
Posts: 18
Sagar Rohankar wrote:
sze sze chan wrote:
I'm thinking could the problem caused by
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN //EN" "http://www.springframework.org/dtd/spring-beans.dtd">
inside the .xml file?
as I'm using sping 3x, is that the right dtd ?

This is the one I used in my project, try this:
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
OR I suspect the proxy problem if you're inside the network. The eclipse is trying tho access that DTD link but somehow not able to reach. Check you network connection in Eclipse.


Hi, i've tried the dtd link it still doesn't work.....
and I went to the eclipse network connection, it was set to "Direct connection to internet" and the proxy is by default, it's blank inside the manual proxy configuration. Do I need to set anything for proxy ?
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

sze sze chan wrote:Do I need to set anything for proxy ?

Only if you're inside the proxy network.
sze sze chan
Greenhorn

Joined: Jul 27, 2011
Posts: 18
Sagar Rohankar wrote:
sze sze chan wrote:Do I need to set anything for proxy ?

Only if you're inside the proxy network.


hi ,
i've set the HTTP proxy and SSL proxy, which are the proxy and port.
but everytime i set it it has error : org.eclipse.core.runtime.AssertionFailedException:assertion failed;
any idea on what it this? btw, the red cross of jobmgmt_beans.xml is still there

thanks for your help
Craig Walls
author
Ranch Hand

Joined: Sep 19, 2003
Posts: 301

The DTD is *so* Spring 1.0.

Start with the following, then fill in the blanks:



Spring in Action - Unleash POJO power in your applications!
Modular Java - Discover the secret weapon to modularity on the Java platform!
XDoclet in Action - Your complete guide to code generation with XDoclet.
sze sze chan
Greenhorn

Joined: Jul 27, 2011
Posts: 18
Craig Walls wrote:
The DTD is *so* Spring 1.0.

Start with the following, then fill in the blanks:



thank you for your reply, now the little cross mark is gone :jumpingjoy
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: bean.xml ConnectException-Connection timed out: connect