'not an instance of declaring class' on Weblogic-Oracle

View: New views
2 Messages — Rating Filter:   Alert me  

'not an instance of declaring class' on Weblogic-Oracle

by Parth Pandya-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

 

 

Hi Guys,

 

I'm getting "java.lang.IllegalArgumentException: object is not an
instance of declaring class" in a webapplication. I think it's something
to do with the way CLOB is handled in Cayenne 3.0M4. The full stack
trace is at the bottom. I tried the Jboss-Oracle combination and I don't
get this exception on Jboss.

 

The environment details are:

Database - 10g

App server - Weblogic 9.2.2 on Solaris 10

Driver - Oracle Thin driver

 

Can you guys please advise on what are the likely cause of this?

 

Thanks a lot in advance.

 

Cheers,
Parth

 

Exception:

 

####<Jul 7, 2008 12:01:19 PM EST> <Error> <HTTP> <sxde108> <Server1>
<[ACTIVE] ExecuteThread: '6' for queue: 'weblogic.kernel.Default
(self-tuning)'> <<WLS Kernel>> <> <> <1215396079795> <BEA-101020>
<[weblogic.servlet.internal.WebAppServletContext@1438298 - appName:
'fcl', name: 'fcl.war', context-path: '/fcl'] Servlet failed with
Exception

org.apache.cayenne.CayenneRuntimeException: [v.3.0M4 May 18 2008
15:29:33] Commit Exception

        at
org.apache.cayenne.access.DataContext.flushToParent(DataContext.java:119
2)

        at
org.apache.cayenne.access.DataContext.commitChanges(DataContext.java:106
6)

        at
com.avoka.fcl.service.ErrorLogService.logException(ErrorLogService.java:
89)

        at
com.avoka.fcl.servlet.BaseServlet.handleException(BaseServlet.java:144)

        at
com.avoka.fcl.servlet.BaseServlet.handleRequest(BaseServlet.java:130)

        at com.avoka.fcl.servlet.BaseServlet.doGet(BaseServlet.java:93)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

        at
weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(St
ubSecurityHelper.java:227)

        at
weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityH
elper.java:125)

        at
weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:2
83)

        at
weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)

        at
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:
42)

        at
com.avoka.fcl.servlet.RemoteUserFilter.doFilter(RemoteUserFilter.java:51
)

        at
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:
42)

        at
com.avoka.fcl.servlet.DataContextFilter.doFilter(DataContextFilter.java:
239)

        at
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:
42)

        at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.r
un(WebAppServletContext.java:3242)

        at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSu
bject.java:321)

        at
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121
)

        at
weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServ
letContext.java:2010)

        at
weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletCont
ext.java:1916)

        at
weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java
:1366)

        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)

        at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)

java.lang.IllegalArgumentException: object is not an instance of
declaring class

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)

        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)

        at java.lang.reflect.Method.invoke(Method.java:585)

        at
org.apache.cayenne.dba.oracle.OracleLOBBatchAction.writeClob(OracleLOBBa
tchAction.java:307)

        at
org.apache.cayenne.dba.oracle.OracleLOBBatchAction.processLOBRow(OracleL
OBBatchAction.java:197)

        at
org.apache.cayenne.dba.oracle.OracleLOBBatchAction.performAction(OracleL
OBBatchAction.java:127)

        at
org.apache.cayenne.access.DataNodeQueryAction.runQuery(DataNodeQueryActi
on.java:58)

        at
org.apache.cayenne.access.DataNode.performQueries(DataNode.java:230)

        at
org.apache.cayenne.access.DataDomainFlushAction.runQueries(DataDomainFlu
shAction.java:227)

        at
org.apache.cayenne.access.DataDomainFlushAction.flush(DataDomainFlushAct
ion.java:145)

        at
org.apache.cayenne.access.DataDomain.onSyncFlush(DataDomain.java:821)

        at
org.apache.cayenne.access.DataDomain$2.transform(DataDomain.java:788)

        at
org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:84
7)

        at
org.apache.cayenne.access.DataDomain.onSync(DataDomain.java:785)

        at
org.apache.cayenne.access.DataContext.flushToParent(DataContext.java:116
4)

        at
org.apache.cayenne.access.DataContext.commitChanges(DataContext.java:106
6)

        at
com.avoka.fcl.service.ErrorLogService.logException(ErrorLogService.java:
89)

        at
com.avoka.fcl.servlet.BaseServlet.handleException(BaseServlet.java:144)

        at
com.avoka.fcl.servlet.BaseServlet.handleRequest(BaseServlet.java:130)

        at com.avoka.fcl.servlet.BaseServlet.doGet(BaseServlet.java:93)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

        at
weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(St
ubSecurityHelper.java:227)

        at
weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityH
elper.java:125)

        at
weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:2
83)

        at
weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)

        at
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:
42)

        at
com.avoka.fcl.servlet.RemoteUserFilter.doFilter(RemoteUserFilter.java:51
)

        at
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:
42)

        at
com.avoka.fcl.servlet.DataContextFilter.doFilter(DataContextFilter.java:
239)

        at
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:
42)

        at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.r
un(WebAppServletContext.java:3242)

        at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSu
bject.java:321)

        at
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121
)

        at
weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServ
letContext.java:2010)

        at
weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletCont
ext.java:1916)

        at
weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java
:1366)

        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)

        at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)

>

 

 


Re: 'not an instance of declaring class' on Weblogic-Oracle

by Andrus Adamchik :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Parth,

So it works under JBoss, but not under Weblogic?

I have a few suspects - (1) some nested ClassLoader nastiness (Oracle  
Clob implementation is loaded more than once), and (2) DataSource  
wrapping objects, so that the java.sql.Clob available to Cayenne is  
not a oracle.sql.CLOB. Another thing worth checking is that the Oracle  
driver versions are the same on both app servers.

Anyways, I am inclined to believe that (2) is more likely. So I  
reworked the algorithm to avoid using reflection for CLOB updates  
under Oracle:

https://issues.apache.org/cayenne/browse/CAY-1085

This code is committed on trunk and should soon be available from the  
Hudson server:

http://hudson.zones.apache.org/hudson/job/Cayenne-trunk/lastBuild/
http://hudson.zones.apache.org/hudson/job/Cayenne-trunk/lastBuild/org.apache.cayenne$cayenne-server/

(check the build info per link above; build # should be 175 or higher).

Let me know if that fixed the problem.

Thanks,
Andrus


On Jul 7, 2008, at 5:15 AM, Parth Pandya wrote:

>
> Hi Guys,
>
>
>
> I'm getting "java.lang.IllegalArgumentException: object is not an
> instance of declaring class" in a webapplication. I think it's  
> something
> to do with the way CLOB is handled in Cayenne 3.0M4. The full stack
> trace is at the bottom. I tried the Jboss-Oracle combination and I  
> don't
> get this exception on Jboss.
>
>
>
> The environment details are:
>
> Database - 10g
>
> App server - Weblogic 9.2.2 on Solaris 10
>
> Driver - Oracle Thin driver
>
>
>
> Can you guys please advise on what are the likely cause of this?
>
>
>
> Thanks a lot in advance.
>
>
>
> Cheers,
> Parth
>