Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[J2EE] Wie aus EJB auf SOAP Webservice (Apache AXIS) zugreifen?

0 views
Skip to first unread message

Pascal Dihé

unread,
Oct 10, 2002, 6:59:37 AM10/10/02
to
Hallo,
ich habe ein Problem mit der J2EE & Apache Axis:

Alle Versuche, aus einer stateless Session Bean auf einen SOAP
Webservice (Apache Axis auf Tomcat 4.1) zuzugreifen, endeten bisher mit:


java.security.AccessControlException: access denied
(java.lang.RuntimePermission getClassLoader)
at
java.security.AccessControlContext.checkPermission(AccessControlContext.java:270)
at
java.security.AccessController.checkPermission(AccessController.java:401)
at
java.lang.SecurityManager.checkPermission(SecurityManager.java:542)
at java.lang.ClassLoader.getParent(ClassLoader.java:701)
at
org.apache.commons.discovery.tools.ManagedProperties$1.run(ManagedProperties.java:372)
at java.security.AccessController.doPrivileged(Native Method)
at
org.apache.commons.discovery.tools.ManagedProperties.getParent(ManagedProperties.java:370)
at
org.apache.commons.discovery.tools.ManagedProperties.getValueProperty(ManagedProperties.java:343)
at
org.apache.commons.discovery.tools.ManagedProperties.getValueProperty(ManagedProperties.java:343)
at
org.apache.commons.discovery.tools.ManagedProperties.getProperty(ManagedProperties.java:159)
at
org.apache.commons.discovery.tools.ManagedProperties.getProperty(ManagedProperties.java:134)
at
org.apache.axis.AxisProperties.getProperty(AxisProperties.java:137)
at org.apache.axis.client.Call.addTransportPackage(Call.java:1452)
at org.apache.axis.client.Call.initialize(Call.java:1420)
at org.apache.axis.utils.Options.getURL(Options.java:273)
at org.apache.axis.utils.Options.<init>(Options.java:104)


Ich habe auch versucht, Axis direkt in der J2EE zu deployen, so wie es
unter http://www.dev4net.com/soapinterop/j2ee-axis.htm beschrieben ist.
Jedoch erhalte ich dann beim Zugriff auf das AxisServlet auch eine
AccessControlException.

In der EJB 2.0 Spezifikation steht dazu:
"The enterprise bean must not attempt to create a class loader; obtain
the current class loader; set the context class loader; ..."

Hm, komme ich vieleicht mit Hilfe eines Resource Adapters (Java
Connector Architecture) weiter, oder gibt es eine einfachere Möglichkeit
Axis in einer EJB zu verwenden?

Gruß
Pascal

Thomas Poeschmann

unread,
Oct 10, 2002, 7:30:15 AM10/10/02
to
"Pascal Dihé" <pasca...@web.de> schrieb:

> Hallo,
> ich habe ein Problem mit der J2EE & Apache Axis:
>
> Alle Versuche, aus einer stateless Session Bean auf einen SOAP
> Webservice (Apache Axis auf Tomcat 4.1) zuzugreifen, endeten bisher mit:
>
>
> java.security.AccessControlException: access denied

[...]

> Hm, komme ich vieleicht mit Hilfe eines Resource Adapters (Java
> Connector Architecture) weiter, oder gibt es eine einfachere Möglichkeit
> Axis in einer EJB zu verwenden?

Du musst eine URL als Resource anlegen. So, wie Du
eine Datenbank als Resource anlegst.

JCA hilft Dir nicht weiter - oder brauchst Du eine
Integration in Transaktionen? Das was Du brauchst,
ist ein Zugriff auf eine URL - und das ist normalerweise
im Container verboten.


Pascal Dihé

unread,
Oct 10, 2002, 9:08:35 AM10/10/02
to
Thomas Poeschmann wrote:
>
> Du musst eine URL als Resource anlegen. So, wie Du
> eine Datenbank als Resource anlegst.
>
> JCA hilft Dir nicht weiter - oder brauchst Du eine
> Integration in Transaktionen? Das was Du brauchst,
> ist ein Zugriff auf eine URL - und das ist normalerweise
> im Container verboten.
>
>

Hallo,

ich habe die AXIS Servlet URL nun als Resource angelegt, es funktioniert
aber leider immer noch nicht. Die Exception ist die gleiche wie zuvor.

Hier der relavante Code:

InitialContext context = new InitialContext();
URL url = (URL)context.lookup("java:comp/env/url/AxisURL");
System.out.println("[SOAP EJB] AXIS URL: " + url);
System.out.println("[SOAP EJB] Create new CALL");
Call call = (Call)new Service().createCall();
System.out.println("[SOAP EJB] new CALL: " + call);
System.out.println("[SOAP EJB] CALL.setTargetEndpointAddress");
call.setTargetEndpointAddress(url);
call.setOperationName(new QName("urn:xmltoday-delayed-quotes", "getQuote"));
call.addParameter("symbol", XMLType.XSD_STRING, ParameterMode.IN);
call.setReturnType(XMLType.XSD_FLOAT);
call.setUsername("user1");
call.setPassword("pass1");
java.lang.Object ret = call.invoke(new java.lang.Object[] {symbol});
System.out.println("[SOAP EJB] CALL returns: " + ret);

Die Ausgabe sieht dann so aus:

[SOAP EJB] AXIS URL: http://localhost:8088/axis/servlet/AxisServlet
[SOAP EJB] Create new CALL
java.security.AccessControlException: access denied
(java.lang.RuntimePermission getClassL
oader)

Der Aufruf von
Call call = (Call)new Service().createCall();
verursacht also die AccessControlException.

Anscheinend ist AXIS inkompatibel zu EJBs?

Gruß
Pascal

0 new messages