Could not load properties



hi i am going to develop web-services in java (NetBeans) but have problems with get conection, i get the following error:



org.springframework.beans.factory.BeanInitializationException: Could not load properties; nested exception is java.net.UnknownHostException: C
Caused by: java.net.UnknownHostException: C
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.Socket.connect(Socket.java:589)
at java.net.Socket.connect(Socket.java:538)
at sun.net.ftp.impl.FtpClient.doConnect(FtpClient.java:957)
at sun.net.ftp.impl.FtpClient.tryConnect(FtpClient.java:917)
at sun.net.ftp.impl.FtpClient.connect(FtpClient.java:1012)
at sun.net.ftp.impl.FtpClient.connect(FtpClient.java:998)
at sun.net.http://www.protocol.ftp.FtpURLConnection.connect(FtpURLConnection.java:294)
at sun.net.http://www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnection.java:393)
at org.springframework.core.io.UrlResource.getInputStream(UrlResource.java:103)
at org.springframework.core.io.support.PropertiesLoaderSupport.loadProperties(PropertiesLoaderSupport.java:179)
at org.springframework.core.io.support.PropertiesLoaderSupport.mergeProperties(PropertiesLoaderSupport.java:158)
at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(Proper at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:68)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:467)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:334)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:122)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:76)
at com.rsa.ims.components.spring.SimpleApplicationLoader.loadBeanFactory(SimpleApplicationLoader.java:134)
at com.rsa.ims.components.spring.SimpleApplicationLoader.useBeanFactory(SimpleApplicationLoader.java:105)
at com.rsa.command.ConnectionFactory.getSpringBeanTarget(ConnectionFactory.java:183)
at com.rsa.command.ConnectionFactory.getTarget(ConnectionFactory.java:156)
at com.rsa.command.ConnectionFactory.getConnection(ConnectionFactory.java:238)
at com.rsa.command.ConnectionFactory.getConnection(ConnectionFactory.java:281)
at com.arame.rsa.cmdConnection.getConnection(cmdConnection.java:33)
at com.arame.rsa.ApiRsaTest.main(ApiRsaTest.java:49)
Exception in thread "main" java.lang.NullPointerException
at com.arame.rsa.cmdConnection.closeConnection(cmdConnection.java:59)
at com.arame.rsa.ApiRsaTest.main(ApiRsaTest.java:94)


I have the config.properties where is the URL and Context.xml this file processing to retrieve properties from a file config.properties also have log4j.xml/dtd all them in my classpath.


this is my con Context.xml



<beans default-lazy-init="true" xsi:schemaLocation="http://ift.tt/GArMu6
http://ift.tt/1cQAoMK"
xmlns:xsi="http://ift.tt/ra1lAU"
xmlns="http://ift.tt/GArMu6">

<bean name="PrimaryPropertyPlaceHolderPostProcessor" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">

<property name="order" value="10"/>
<property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE"/>
<property name="location" value="http://fileC:\\Users\\gerardo.granados\\Documents\\APITest\\build\\classes\\config.properties"/>
<property name="ignoreUnresolvablePlaceholders" value="false"/>
<property name="ignoreResourceNotFound" value="false"/>
</bean>

<bean name="ConnectionInfoProvider"
class="com.rsa.command.PropertiesConnectionInfoProvider"
lazy-init="false">
<property name="propertiesFile" value="config.properties"/>
</bean>


<alias alias="CommandAPIConnection" name="SOAPCommandTargetBasicAuth"/>


<bean name="ClusterTarget" lazy-init="true"
class="com.rsa.command.RemoteCommandTargetFactoryBean">
<property name="providerURL" value="http://t3snode1-address,node2-address:7002"/>
<property name="connectionInfoProvider" ref="ConnectionInfoProvider"/>
<property name="targetClass" value="com.rsa.command.EJBRemoteTarget"/>
<property name="cacheable" value="true"/>
</bean>


<bean name="SpecificNodeTarget" lazy-init="true"
class="com.rsa.command.RemoteCommandTargetFactoryBean">
<property name="providerURL" value="t3s://node2-address:7002"/>
<property name="connectionInfoProvider" ref="ConnectionInfoProvider"/>
<property name="targetClass" value="com.rsa.command.EJBRemoteTarget"/>
<property name="cacheable" value="true"/>
<property name="properties">
<props>

<prop key="com.rsa.naming.pin.to.primary.server">true</prop>
</props>
</property>
</bean>
</beans>


Any suggestion???? Thanks


No comments:

Post a Comment