axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yashwanth" <yraja...@cisco.com>
Subject AccessControlException from HttpClient - Causes ServiceClient instance to fail
Date Sun, 06 Sep 2009 21:18:50 GMT
Hi All: 

Have you used Axis2 web services on WebSphere with security turned on so you
have to use was.policy file to grant the required permissions? If so you
might be able to help. 

We have a Web Service (WS1) calling another WebService (WS2) using
ServiceClient. However we get the following exception when WS1 calls WS2. 

[8/27/09 19:18:55:774 EDT] 42e54fb1 SystemErr R Aug 27, 2009 7:18:55 PM
org.apache.axis2.deployment.ServiceDeployer deploy
INFO: Deploying Web service: PartnerService
[8/27/09 19:18:55:797 EDT] 42e54fb1 SystemErr R Aug 27, 2009 7:18:55 PM
org.apache.axis2.deployment.ServiceDeployer deploy
INFO: Deploying Web service: version-1.3.aar
[8/27/09 19:23:27:132 EDT] 66cbcfb1 SystemErr R
java.security.AccessControlException: access denied
(java.net.SocketPermission xxx.xx.xx.xxx:80 connect,resolve)
[8/27/09 19:23:27:132 EDT] 66cbcfb1 SystemErr R at
java.security.AccessControlContext.checkPermission(AccessControlContext.java
(Compiled Code))
[8/27/09 19:23:27:132 EDT] 66cbcfb1 SystemErr R at
java.security.AccessController.checkPermission(AccessController.java(Compile
d Code))
[8/27/09 19:23:27:133 EDT] 66cbcfb1 SystemErr R at
java.lang.SecurityManager.checkPermission(SecurityManager.java(Compiled
Code))
[8/27/09 19:23:27:133 EDT] 66cbcfb1 SystemErr R at
com.ibm.ws.security.core.SecurityManager.checkPermission(SecurityManager.jav
a(Compiled Code))
[8/27/09 19:23:27:133 EDT] 66cbcfb1 SystemErr R at
java.lang.SecurityManager.checkConnect(SecurityManager.java:1040)
[8/27/09 19:23:27:133 EDT] 66cbcfb1 SystemErr R at
java.net.Socket.connect(Socket.java:473)
[8/27/09 19:23:27:133 EDT] 66cbcfb1 SystemErr R at
java.net.Socket.connect(Socket.java:429)
[8/27/09 19:23:27:133 EDT] 66cbcfb1 SystemErr R at
java.net.Socket.<init>(Socket.java:336)
[8/27/09 19:23:27:133 EDT] 66cbcfb1 SystemErr R at
java.net.Socket.<init>(Socket.java:212)
[8/27/09 19:23:27:133 EDT] 66cbcfb1 SystemErr R at
org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSo
cket(DefaultProtocolSocketFactory.java:79)
[8/27/09 19:23:27:133 EDT] 66cbcfb1 SystemErr R at
org.apache.commons.httpclient.protocol.ControllerThreadSocketFactory$1.doit(
ControllerThreadSocketFactory.java:90)
[8/27/09 19:23:27:133 EDT] 66cbcfb1 SystemErr R at
org.apache.commons.httpclient.protocol.ControllerThreadSocketFactory$SocketT
ask.run(ControllerThreadSocketFactory.java:157)
[8/27/09 19:23:27:133 EDT] 66cbcfb1 SystemErr R at
java.lang.Thread.run(Thread.java:571)
[8/27/09 19:23:27:134 EDT] 65520fb0 SystemErr R
java.lang.NullPointerException
[8/27/09 19:23:27:134 EDT] 65520fb0 SystemErr R at
org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:720)
[8/27/09 19:23:27:134 EDT] 65520fb0 SystemErr R at
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnect
ionAdapter.open(MultiThreadedHttpConnectionManager.java:1321)
[8/27/09 19:23:27:134 EDT] 65520fb0 SystemErr R at
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethod
Director.java:386)
[8/27/09 19:23:27:134 EDT] 65520fb0 SystemErr R at
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDir
ector.java:170)
[8/27/09 19:23:27:134 EDT] 65520fb0 SystemErr R at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
[8/27/09 19:23:27:134 EDT] 65520fb0 SystemErr R at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
[8/27/09 19:23:27:134 EDT] 65520fb0 SystemErr R at
org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTT
PSender.java:520)
[8/27/09 19:23:27:134 EDT] 65520fb0 SystemErr R at
org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:191)
[8/27/09 19:23:27:134 EDT] 65520fb0 SystemErr R at
org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:77)
[8/27/09 19:23:27:134 EDT] 65520fb0 SystemErr R at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithC
ommons(CommonsHTTPTransportSender.java:327)
[8/27/09 19:23:27:134 EDT] 65520fb0 SystemErr R at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTT
PTransportSender.java:206)
[8/27/09 19:23:27:135 EDT] 65520fb0 SystemErr R at
org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:396)
[8/27/09 19:23:27:135 EDT] 65520fb0 SystemErr R at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperatio
n.java:374)
[8/27/09 19:23:27:136 EDT] 65520fb0 SystemErr R at
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisO
peration.java:211)
[8/27/09 19:23:27:136 EDT] 65520fb0 SystemErr R at
org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
[8/27/09 19:23:27:136 EDT] 65520fb0 SystemErr R at
org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:528)
[8/27/09 19:23:27:136 EDT] 65520fb0 SystemErr R at
org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:508)
[8/27/09 19:23:27:136 EDT] 65520fb0 SystemErr R at
com.cisco.ws.partnerService.PartnerService.pullAction(PartnerService.java:78
)
[8/27/09 19:23:27:136 EDT] 65520fb0 SystemErr R at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[8/27/09 19:23:27:136 EDT] 65520fb0 SystemErr R at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85
)
[8/27/09 19:23:27:136 EDT] 65520fb0 SystemErr R at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58
)
[8/27/09 19:23:27:136 EDT] 65520fb0 SystemErr R at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:60)
[8/27/09 19:23:27:136 EDT] 65520fb0 SystemErr R at
java.lang.reflect.Method.invoke(Method.java:391)
[8/27/09 19:23:27:136 EDT] 65520fb0 SystemErr R at
org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:165)
[8/27/09 19:23:27:137 EDT] 65520fb0 SystemErr R at
org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver.invokeBusinessLogic(
RPCInOnlyMessageReceiver.java:62)
[8/27/09 19:23:27:137 EDT] 65520fb0 SystemErr R at
org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageRe
ceiver.java:96)
[8/27/09 19:23:27:137 EDT] 65520fb0 SystemErr R at
org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:145)
[8/27/09 19:23:27:137 EDT] 65520fb0 SystemErr R at
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HT
TPTransportUtils.java:275)
[8/27/09 19:23:27:137 EDT] 65520fb0 SystemErr R at
org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:120)
[8/27/09 19:23:27:137 EDT] 65520fb0 SystemErr R at
javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
[8/27/09 19:23:27:137 EDT] 65520fb0 SystemErr R at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
[8/27/09 19:23:27:137 EDT] 65520fb0 SystemErr R at
com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServle
tInstance.java:110)
[8/27/09 19:23:27:137 EDT] 65520fb0 SystemErr R at
com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecy
cleServlet.java:174)
[8/27/09 19:23:27:140 EDT] 65520fb0 SystemErr R at
com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServ
let.java:313)
[8/27/09 19:23:27:140 EDT] 65520fb0 SystemErr R at
com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecyc
leServlet.java:116)
[8/27/09 19:23:27:140 EDT] 65520fb0 SystemErr R at
com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java
:283)
[8/27/09 19:23:27:140 EDT] 65520fb0 SystemErr R at
com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidSer
vletReferenceState.java:42)
[8/27/09 19:23:27:140 EDT] 65520fb0 SystemErr R at
com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletIns
tanceReference.java:40)
[8/27/09 19:23:27:140 EDT] 65520fb0 SystemErr R at
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(
WebAppRequestDispatcher.java:1036)
[8/27/09 19:23:27:140 EDT] 65520fb0 SystemErr R at
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppReques
tDispatcher.java:544)
[8/27/09 19:23:27:140 EDT] 65520fb0 SystemErr R at
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequest
Dispatcher.java:210)
[8/27/09 19:23:27:140 EDT] 65520fb0 SystemErr R at
com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:139)
[8/27/09 19:23:27:140 EDT] 65520fb0 SystemErr R at
com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker
.java:332)
[8/27/09 19:23:27:140 EDT] 65520fb0 SystemErr R at
com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(C
achedInvocation.java:71)
[8/27/09 19:23:27:140 EDT] 65520fb0 SystemErr R at
com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletReq
uestProcessor.java:254)
[8/27/09 19:23:27:140 EDT] 65520fb0 SystemErr R at
com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListene
r.java:334)
[8/27/09 19:23:27:140 EDT] 65520fb0 SystemErr R at
com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.jav
a:56)
[8/27/09 19:23:27:140 EDT] 65520fb0 SystemErr R at
com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:657)
[8/27/09 19:23:27:140 EDT] 65520fb0 SystemErr R at
com.ibm.ws.http.HttpConnection.run(HttpConnection.java:453)
[8/27/09 19:23:27:140 EDT] 65520fb0 SystemErr R at
com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:937)

I found a similar issue posted on the Web where the user was calling
HttpClient from a JavaScript in an Applet. After tweaking the policy file he
was able to get it working. I think the current issue could be due to one of
the following:
1. Missing was.policy file entries that would allow the WebService under
WEB-INF/services folder to use HttpClient. Or
2. We have not set some properties in WS1 on ServiceClient instance before
invoking WS2.
 
Would greatly appreciate any help.
thanks,
Yash

Mime
View raw message