-
1. Re: JBoss 3.2.5 Oracle Datasource Problem
adrian.brock Jul 15, 2004 8:08 AM (in response to kyriakost)There is a patch on sourceforge that includes the missing class:
http://prdownloads.sourceforge.net/jboss/jboss-common-jdbc-wrapper-bug988031.jar?download
See the updated release notes for more info. -
2. Re: JBoss 3.2.5 Oracle Datasource Problem
kyriakost Jul 15, 2004 8:14 AM (in response to kyriakost)I have already installed the patch. It solved the missing class error. What I have posted is another error...
-
3. Re: JBoss 3.2.5 Oracle Datasource Problem
adrian.brock Jul 15, 2004 8:18 AM (in response to kyriakost)You *replaced* the previous jar or do you now have two copies with different contents?
-
4. Re: JBoss 3.2.5 Oracle Datasource Problem
kyriakost Jul 15, 2004 8:20 AM (in response to kyriakost)I replaced it...
-
5. Re: JBoss 3.2.5 Oracle Datasource Problem
adrian.brock Jul 15, 2004 9:04 AM (in response to kyriakost)Ok, I see the problem.
I modified the BuildProxyAction to use a HashSet rather than an ArrayList.
This will eliminate duplicate interfaces.
The other alternative is to not install a security manager, then the
PrivilegedProxy isn't even used./* * JBoss, the OpenSource J2EE webOS * * Distributable under LGPL license. * See terms of license at gnu.org. * */ package org.jboss.resource.adapter.jdbc; import java.lang.reflect.InvocationHandler; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Proxy; import java.security.PrivilegedExceptionAction; import java.security.AccessController; import java.security.PrivilegedActionException; import java.util.HashSet; /** A PrivilegedExceptionAction that proxies whatever interfaces the target * object supports. When an invocation through an interface method is done, * the is executed via reflection in a PrivilegedExceptionAction to run * at the privilege level of this codebase. * * @author Scott.Stark@jboss.org * @version $Revison:$ */ public class PrivilegedProxy implements InvocationHandler, PrivilegedExceptionAction { private Object target; private Method method; private Object[] args; public Object run() throws Exception { Object value = null; try { value = method.invoke(target, args); } catch(InvocationTargetException e) { throw (Exception) e.getTargetException(); } return value; } PrivilegedProxy(Object target) { this.target = target; } Object getProxy() throws Exception { BuildProxyAction action = new BuildProxyAction(target, this); Object proxy = null; try { proxy = AccessController.doPrivileged(action); } catch(PrivilegedActionException e) { throw e.getException(); } return proxy; } public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { this.method = method; this.args = args; Object value = null; try { value = AccessController.doPrivileged(this); } catch(PrivilegedActionException e) { throw e.getException(); } return value; } private static class BuildProxyAction implements PrivilegedExceptionAction { Object target; InvocationHandler handler; BuildProxyAction(Object target, InvocationHandler handler) { this.target = target; this.handler = handler; } public Object run() throws Exception { HashSet tmp = new HashSet(); // Get all interfaces Class c = target.getClass(); do { Class[] ifaces = c.getInterfaces(); for(int i = 0; i < ifaces.length; i ++) tmp.add(ifaces); c = c.getSuperclass(); } while( c != null ); Class[] ifaces = new Class[tmp.size()]; tmp.toArray(ifaces); ClassLoader loader = Thread.currentThread().getContextClassLoader(); return Proxy.newProxyInstance(loader, ifaces, handler); } } }
-
6. Re: JBoss 3.2.5 Oracle Datasource Problem
kyriakost Jul 15, 2004 9:29 AM (in response to kyriakost)Hi again.
I just tried the version you posted, keeping the security manager.
It now gives the error :
16:15:18,764 INFO [STDOUT] java.lang.SecurityException: Failed to create Statement proxy: null
16:15:18,766 INFO [STDOUT] at org.jboss.resource.adapter.jdbc.WrappedStatement.(WrappedStatement.java:51)
16:15:18,766 INFO [STDOUT] at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.(WrappedPreparedStatement.java:45)
16:15:18,766 INFO [STDOUT] at org.jboss.resource.adapter.jdbc.WrappedConnection.prepareStatement(WrappedConnection.java:208)
16:15:18,767 INFO [STDOUT] at com.intracom.sw.adapters.messagehandle.utils.MessageHandler.testDatasourceRollback(MessageHandler.java:62)
Thank you very much for your time so far !! -
7. Re: JBoss 3.2.5 Oracle Datasource Problem
adrian.brock Jul 15, 2004 9:47 AM (in response to kyriakost)Now your security policy is incorrect.
I'd suggest you don't use a security manager.
An incorrectly configured security manager is far worse than no
security manager at all.
e.g. It allows clients to upload and run code on the server which will
let them to do horrible things unless your policy stops them.
No security manager means they cannot upload code at all.