Hi Julian,<br>I took the trunk of mondrian and attempted to use the Olap4jXmlaServlet finding a couple more issues:<br><br>1. the method below needs to use "getDeclaringClass" and not getClass() <br><br> private static OlapConnection createDelegatingOlapConnection(<br>
final Connection connection,<br> final OlapConnection olapConnection)<br> {<br> return (OlapConnection) Proxy.newProxyInstance(<br> olapConnection.getClass().getClassLoader(),<br> new Class[] {OlapConnection.class},<br>
new InvocationHandler() {<br> public Object invoke(<br> Object proxy,<br> Method method,<br> Object[] args)<br> throws Throwable<br>
{<br> if (OlapConnection.class.isAssignableFrom(<br> method.getDeclaringClass()))<br> {<br> return method.invoke(olapConnection, args);<br>
} else {<br> return method.invoke(connection, args);<br> }<br> }<br> }<br> );<br> }<br>}<br><br>2. Even with the fix above the method call "unwrap" is sent to the wrapped commons-dbcp object which doesn't have it and that causes the Exception below.<br>
<br>2011-08-04 15:44:26,468 ERROR [mondrian.xmla.XmlaServlet] - <Errors when handling XML/A message><br>mondrian.xmla.XmlaException: Mondrian Error:XMLA Discover unparse results error<br> at mondrian.xmla.XmlaHandler.discover(XmlaHandler.java:2812)<br>
at mondrian.xmla.XmlaHandler.process(XmlaHandler.java:608)<br> at mondrian.xmla.impl.DefaultXmlaServlet.handleSoapBody(DefaultXmlaServlet.java:557)<br> at mondrian.xmla.XmlaServlet.doPost(XmlaServlet.java:315)<br>
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)<br> at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)<br> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)<br>
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)<br> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)<br> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)<br>
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)<br> at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)<br> at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)<br>
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)<br> at org.apache.coyote.http11.Http11NioProcessor.process(Http11NioProcessor.java:883)<br> at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:721)<br>
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:2258)<br> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)<br> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)<br>
at java.lang.Thread.run(Thread.java:662)<br>Caused by: java.lang.reflect.UndeclaredThrowableException<br> at $Proxy0.unwrap(Unknown Source)<br> at mondrian.xmla.XmlaHandler.getExtra(XmlaHandler.java:69)<br>
at mondrian.xmla.RowsetDefinition$DbschemaCatalogsRowset.populateImpl(RowsetDefinition.java:2169)<br> at mondrian.xmla.Rowset.populate(Rowset.java:220)<br> at mondrian.xmla.Rowset.unparse(Rowset.java:192)<br>
at mondrian.xmla.XmlaHandler.discover(XmlaHandler.java:2806)<br> ... 19 more<br>Caused by: java.lang.reflect.InvocationTargetException<br> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br>
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br> at java.lang.reflect.Method.invoke(Method.java:597)<br>
at mondrian.xmla.impl.Olap4jXmlaServlet$1.invoke(Olap4jXmlaServlet.java:453)<br> ... 25 more<br>Caused by: java.lang.AbstractMethodError: org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.unwrap(Ljava/lang/Class;)Ljava/lang/Object;<br>
... 30 more<br><br><br>A possible fix is to add that "catch (AbstractMethodException e)" clause to the method below in XmlaHandler.java line 2806<br><br><br> public static XmlaExtra getExtra(OlapConnection connection) {<br>
try {<br> final XmlaExtra extra = connection.unwrap(XmlaExtra.class);<br> if (extra != null) {<br> return extra;<br> }<br> } catch (SQLException e) {<br> // Connection cannot provide an XmlaExtra. Fall back and give a<br>
// default implementation.<br> } catch (AbstractMethodError e) {<br> // the connection does not implement the "unwrap" method<br> }<br> return new XmlaExtraImpl();<br>
}<br><br><br>What do you think?<br><br>thanks,<br>Michele<br>