db-ojb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andy Malakov" <a...@transdecisions.com>
Subject Re: IllegarlArgumentException Error
Date Tue, 03 Feb 2004 23:08:56 GMT
Check your OJB.properties (PersistentFieldClass). You seems to be using PersistentFieldIntrospectorImpl
which require
JavaBeans-style getters and setters.

#----------------------------------------------------------------------------------------
# Meta data / mapping settings
#----------------------------------------------------------------------------------------
# The PersistentFieldClass property defines the implementation class
# for PersistentField attributes used in the OJB MetaData layer.
# By default the best performing attribute/refection based implementation
# is selected (PersistentFieldDirectAccessImpl).
#
# - PersistentFieldDirectAccessImpl
#   is a high-speed version of the access strategies.
#   It does not cooperate with an AccessController,
#   but accesses the fields directly. Persistent
#   attributes don't need getters and setters
#   and don't have to be declared public or protected
# - PersistentFieldPrivilegedImpl
#   Same as above, but does cooperate with AccessController and do not
#   suppress the java language access check.
# - PersistentFieldIntrospectorImpl
#   uses JavaBeans compliant calls only to access persistent attributes.
#   No Reflection is needed. But for each attribute xxx there must be
#   public getXxx() and setXxx() methods.
# - PersistentFieldDynaBeanAccessImpl
#   implementation used to access a property from a
#   org.apache.commons.beanutils.DynaBean.

----- Original Message ----- 
From: "ANDRES FELIPE RINCON ZAPATA" <jurin@epm.net.co>
To: <ojb-user@db.apache.org>
Sent: Tuesday, February 03, 2004 4:11 PM
Subject: IllegarlArgumentException Error


I am a newbie in OJB. I was working with EJB entity beans and Jboss or Websphere in other
projects.

Last two weeks I was creating the persistent java classes and the repository files; I configured
the conection for MSSql Server database; then I ran a simple unit test expectig a single row
but it always returns an error.

I was searching in 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.

[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




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


---------------------------------------------------------------------
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