db-ojb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andres Felipe Rincon Zapata" <afel...@hotmail.com>
Subject IllegalArgumentException Error
Date Tue, 03 Feb 2004 21:47:03 GMT
I am an OJB newbie. I was working with EJB entity beans on Jboss and 
Websphere in my last projects.

I am working with ojb rc5.

This is my situation:

I created the persistent java classes and the repository files, I configured
the conection for MSSql Server database; then I ran a simple unit test that 
expected a single AtributoImpl object, but it returned an error.

I was searching the mail archive for similar questions but I didn´t find 
anything.

All I know is that the connection is Ok and the repository and properties 
files are in the classpath.

Any help will be appreciated.
Thanks in advance.

This is the repository_user.xml entry for the table I wanted to read:

<class-descriptor class="com.ecip.ojb.AtributoImpl"  table="ec_atributo">
  <field-descriptor autoincrement="true" primarykey="true" 
column="id_atributo" jdbc-type="INTEGER" name="idAtributo"/>
  <field-descriptor column="atributo" jdbc-type="VARCHAR" name="atributo"/>
  <field-descriptor column="descripcion" jdbc-type="VARCHAR" 
name="descripcion"/>
</class-descriptor>


This is the error I am getting:

[DEFAULT] ERROR: Error in [PersistentFieldPropertyImpl], 
java.lang.IllegalArgumentException

[DEFAULT] ERROR: Declaring class [com.ecip.ojb.AtributoImpl]

[DEFAULT] ERROR: Property Name [idAtributo]

[DEFAULT] ERROR: Property Type [java.lang.Integer]

[DEFAULT] ERROR: anObject was class [com.ecip.ojb.AtributoImpl]

[DEFAULT] ERROR: aValue was null

[DEFAULT] ERROR: Error invoking method:getIdAtributo in 
object:com.ecip.ojb.AtributoImpl

org.apache.ojb.broker.metadata.MetadataException: Error invoking 
method:getIdAtributo in object:com.ecip.ojb.AtributoImpl

at 
org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldIntrospectorImpl.doGet(Unknown 
Source)

at 
org.apache.ojb.broker.metadata.fieldaccess.AbstractPersistentField.get(Unknown 
Source)

at org.apache.ojb.broker.query.QueryByCriteria.buildCriteria(Unknown Source)

at org.apache.ojb.broker.query.QueryByCriteria.<init>(Unknown Source)

at com.ecip.example.OjbExample.readAtributoId(OjbExample.java:40)

at 
com.ecip.ojb.AtributoImplTest.testReadAtributoId1(AtributoImplTest.java:87)

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

at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

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

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

at junit.framework.TestCase.runTest(TestCase.java:154)

at junit.framework.TestCase.runBare(TestCase.java:127)

at junit.framework.TestResult$1.protect(TestResult.java:106)

at 
com.parasoft.eclipse.checker.java.unit.internal.core.test.RemoteTestRunner$1.runProtected(RemoteTestRunner.java:308)

at junit.framework.TestResult.run(TestResult.java:109)

at junit.framework.TestCase.run(TestCase.java:118)

at 
jtest.IndependentTestSuite$TestRunnerThread.run(IndependentTestSuite.java:249)

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

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

at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

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

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

... 17 more

[DEFAULT] ERROR: Error in [PersistentFieldPropertyImpl], 
java.lang.IllegalArgumentException

[DEFAULT] ERROR: Declaring class [com.ecip.ojb.AtributoImpl]

[DEFAULT] ERROR: Property Name [atributo]

[DEFAULT] ERROR: Property Type [java.lang.String]

[DEFAULT] ERROR: anObject was class [com.ecip.ojb.AtributoImpl]

[DEFAULT] ERROR: aValue was null

[DEFAULT] ERROR: Error invoking method:getAtributo in 
object:com.ecip.ojb.AtributoImpl

org.apache.ojb.broker.metadata.MetadataException: Error invoking 
method:getAtributo in object:com.ecip.ojb.AtributoImpl

at 
org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldIntrospectorImpl.doGet(Unknown 
Source)

at 
org.apache.ojb.broker.metadata.fieldaccess.AbstractPersistentField.get(Unknown 
Source)

at org.apache.ojb.broker.query.QueryByCriteria.buildCriteria(Unknown Source)

at org.apache.ojb.broker.query.QueryByCriteria.<init>(Unknown Source)

at com.ecip.example.OjbExample.readAtributoId(OjbExample.java:40)

at 
com.ecip.ojb.AtributoImplTest.testReadAtributoId1(AtributoImplTest.java:87)

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

at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

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

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

at junit.framework.TestCase.runTest(TestCase.java:154)

at junit.framework.TestCase.runBare(TestCase.java:127)

at junit.framework.TestResult$1.protect(TestResult.java:106)

at 
com.parasoft.eclipse.checker.java.unit.internal.core.test.RemoteTestRunner$1.runProtected(RemoteTestRunner.java:308)

at junit.framework.TestResult.run(TestResult.java:109)

at junit.framework.TestCase.run(TestCase.java:118)

at 
jtest.IndependentTestSuite$TestRunnerThread.run(IndependentTestSuite.java:249)

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

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

at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

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

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

... 17 more

[DEFAULT] ERROR: Error in [PersistentFieldPropertyImpl], 
java.lang.IllegalArgumentException

[DEFAULT] ERROR: Declaring class [com.ecip.ojb.AtributoImpl]

[DEFAULT] ERROR: Property Name [descripcion]

[DEFAULT] ERROR: Property Type [java.lang.String]

[DEFAULT] ERROR: anObject was class [com.ecip.ojb.AtributoImpl]

[DEFAULT] ERROR: aValue was null

[DEFAULT] ERROR: Error invoking method:getDescripcion in 
object:com.ecip.ojb.AtributoImpl

org.apache.ojb.broker.metadata.MetadataException: Error invoking 
method:getDescripcion in object:com.ecip.ojb.AtributoImpl

at 
org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldIntrospectorImpl.doGet(Unknown 
Source)

at 
org.apache.ojb.broker.metadata.fieldaccess.AbstractPersistentField.get(Unknown 
Source)

at org.apache.ojb.broker.query.QueryByCriteria.buildCriteria(Unknown Source)

at org.apache.ojb.broker.query.QueryByCriteria.<init>(Unknown Source)

at com.ecip.example.OjbExample.readAtributoId(OjbExample.java:40)

at 
com.ecip.ojb.AtributoImplTest.testReadAtributoId1(AtributoImplTest.java:87)

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

at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

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

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

at junit.framework.TestCase.runTest(TestCase.java:154)

at junit.framework.TestCase.runBare(TestCase.java:127)

at junit.framework.TestResult$1.protect(TestResult.java:106)

at 
com.parasoft.eclipse.checker.java.unit.internal.core.test.RemoteTestRunner$1.runProtected(RemoteTestRunner.java:308)

at junit.framework.TestResult.run(TestResult.java:109)

at junit.framework.TestCase.run(TestCase.java:118)

at 
jtest.IndependentTestSuite$TestRunnerThread.run(IndependentTestSuite.java:249)

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

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

at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

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

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

... 17 more

_________________________________________________________________
MSN Amor: busca tu ½ naranja http://latam.msn.com/amor/


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Mime
View raw message