Thursday, October 27, 2011

java.net.ConnectException: Connection refused



Problem:
This is one of the Common Exceptions which we come across daily in our lives. I encountered this issue when trying to publish few content instances of a particular type in CMS.

Exception i encountered was:
"ERROR | ting.cache.LogCacheProxyPolicy | 999-999-0706: Encountered Exception while expiring Object Cache in CacheWorker thread: "http://vda-02:8443/vgn-ext-templating", During job: "" [Cache Worker Thread_http://vda-02:/vgn-ext-templating] []
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.net.ConnectException: Connection refused
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:520)
at sun.reflect.GeneratedMethodAccessor248.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.axis.components.net.DefaultSocketFactory.create(DefaultSocketFactory.java:153)
at org.apache.axis.components.net.DefaultSocketFactory.create(DefaultSocketFactory.java:120)
at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191)
at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.vignette.ext.templating.cache.CacheWorker.run(CacheWorker.java:159)

{http://xml.apache.org/axis/}hostname:"

Solution:
The error was because, the CMS content was trying to invoke vda-01 server where as it had to invoke vda-02. Tried different possibilities with testing like making vda-01 down and running the code, which went fine and then made vda-02 down which triggered the error again. Since the vda servers where load balanced we had to go with single node server test and found the fault with vda-01 server. Notified the same to the network team eventually they rectified and resolved it :).

Please let me know if you still encounter this issue, mail me @ rahamat_234@yahoo.com

Similar Exceptions:

- java.net.ConnectException: Connection refused
- java.net.ConnectException: Connection timed out
- java.net.ConnectException: Connection refused: no further information


Monday, October 24, 2011

java.net.MalformedURLException: no protocol:



Problem:
This is one of the Common Exceptions which we come across daily in our lives. I encountered this issue when trying to create a xml out from a xsl template.

Exception i encountered was:
"ERROR | board.common.xml.CBXMLDocument | 999-999-0001: createTransformer: MalformedURLException: Error=java.net.MalformedURLException: no protocol: ; Message=no protocol: [[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] []
2011-10-23 17:41:59,564 | ERROR | .cda.render.CBRenderXmlPrinter | 999-999-0001: CBRenderXmlPrinter.getObjectInXMLFormat(): Exception: Error=java.lang.NullPointerException; Message=null [[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] []"

Solution:
The error was because i wasnt passing the protocol with the url. I appended the file protocol with the url and it worked fine. Do let me know if you too faced the same issue.
Please let me know if you still encounter this issue, mail me @ rahamat_234@yahoo.com


Similar Exceptions:

- java.net.MalformedURLException: no protocol:
- java.net.MalformedURLException: unknown protocol: ntp
- java.net.MalformedURLException