commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robert burrell donkin <robertburrelldon...@blueyonder.co.uk>
Subject Re: [Logging] Standalone App using BeanUtils getting wierd exception
Date Mon, 28 Apr 2003 15:53:03 GMT
i think that you've probably only got the commons-logging api's jar in 
your classpath rather than the jar containing the implementations as well 
as the api's.

- robert

On Monday, April 28, 2003, at 04:09 PM, Brandon Goodin wrote:

> Now I tried the app as a standalone using -java via a batch file.
>
> Got the following exception:
>
> Exception in thread "main" java.lang.ExceptionInInitializerError
>         at
> org.apache.commons.beanutils.PropertyUtils.getWriteMethod(PropertyUtils.java
> :1201)
>         at
> org.apache.commons.beanutils.PropertyUtils.setSimpleProperty
> (PropertyUtils.j
> ava:1780)
>         at
> ws.phase.xmlidx.conversion.Converter.callConverts(Converter.java:189)
>         at ws.phase.xmlidx.conversion.Converter.<init>(Converter.java:39)
>         at ws.phase.xmlidx.conversion.Converter.main(Converter.java:52)
> Caused by: org.apache.commons.logging.LogConfigurationException:
> java.lang.InstantiationException: 
> org.apache.commons.logging.impl.SimpleLog
>         at 
> org.apache.commons.logging.LogFactory$2.run(LogFactory.java:609)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at
> org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:561)
>         at
> org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:352)
>         at 
> org.apache.commons.logging.LogFactory.getLog(LogFactory.java:395)
>         at
> org.apache.commons.beanutils.MethodUtils.<clinit>(MethodUtils.java:103)
>         ... 5 more
> Caused by: java.lang.InstantiationException:
> org.apache.commons.logging.impl.SimpleLog
>         at java.lang.Class.newInstance0(Class.java:291)
>         at java.lang.Class.newInstance(Class.java:259)
>         at 
> org.apache.commons.logging.LogFactory$2.run(LogFactory.java:571)
>         ... 10 more
>
> It appears to be the same one as is displayed in eclipse :-)
>
> It says it is having problems instantiating the SimpleLog?
>
> Brandon Goodin
>
> -----Original Message-----
> From: Brandon Goodin [mailto:mail@phase.ws]
> Sent: Monday, April 28, 2003 7:54 AM
> To: Jakarta Commons Users List
> Subject: RE: [Logging] Standalone App using BeanUtils getting wierd
> exception
>
>
> I am very well versed in Log4j so I know I have that configured correct.
>
> However, I am NOT well versed with using commons-logging directly (just
> indirectly inside jakarta projects). I have never had this problem before.
> Usually I run my apps in a servlet container. I this case I need a
> standalone Cron run job.
>
> I am running this app in eclipse 2.1 at this point simply because it is
> still in development. Is eclipse interferring?
>
> Anyways, let's forget about Log4j and just try to get SimpleLog working.
> BTW I DO have the most current Commons-Logging and I have the most current
> BeanUtils (and Log4j 1.2.8 but, that doesn't matter at this point).
>
> I placed a properties file in my called commons-logging.properties where 
> it
> is visible to my app.
>
> I set this property in the commons-logging.properties:
> org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.Simple
> Log
>
> Commons-Logging picks up the properties file but throws the following
> exception:
>
> java.lang.ExceptionInInitializerError
> 	at
> org.apache.commons.beanutils.PropertyUtils.getWriteMethod(PropertyUtils.java
> :1201)
> 	at
> org.apache.commons.beanutils.PropertyUtils.setSimpleProperty
> (PropertyUtils.j
> ava:1780)
> 	at 
> ws.phase.xmlidx.conversion.Converter.callConverts(Converter.java:187)
> 	at ws.phase.xmlidx.conversion.Converter.<init>(Converter.java:37)
> 	at ws.phase.xmlidx.conversion.Converter.main(Converter.java:50)
> Caused by: org.apache.commons.logging.LogConfigurationException:
> java.lang.InstantiationException: 
> org.apache.commons.logging.impl.SimpleLog
> 	at org.apache.commons.logging.LogFactory$2.run(LogFactory.java:609)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at 
> org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:561)
> 	at 
> org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:352)
> 	at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:395)
> 	at 
> org.apache.commons.beanutils.MethodUtils.<clinit>(MethodUtils.java:103)
> 	... 5 more
> Caused by: java.lang.InstantiationException:
> org.apache.commons.logging.impl.SimpleLog
> 	at java.lang.Class.newInstance0(Class.java:291)
> 	at java.lang.Class.newInstance(Class.java:259)
> 	at org.apache.commons.logging.LogFactory$2.run(LogFactory.java:571)
> 	... 10 more
> Exception in thread "main"
>
> Again, the exception occurs on the following line of code:
>
> PropertyUtils.setSimpleProperty(convertObject, name, value);
>
> I am still confused?
>
> Brandon Goodin
>
> -----Original Message-----
> From: robert burrell donkin
> [mailto:robertburrelldonkin@blueyonder.co.uk]
> Sent: Monday, April 28, 2003 4:11 AM
> To: Jakarta Commons Users List
> Subject: Re: [Logging] Standalone App using BeanUtils getting wierd
> exception
>
>
> it seems likely to me that you need to deal with two problems. the
> exception being thrown is probably caused by version incompatibility
> between commons-logging and log4j. this could probably be solved by
> upgrading to a recent log4j release.
>
> the other problem is exactly why you're getting this exception in the
> first place. if you get this when you've set up commons-logging to use
> SimpleLog then there's something wrong - the log4k logger should never be
> instantiated. a good place to start is by double checking that the set up
> is correct.
>
> - robert
>
> On Monday, April 28, 2003, at 05:44 AM, Brandon Goodin wrote:
>
>> I am getting the following Logging exception when I try to use BeanUtils.
>>  I
>> have set up the commons-logging.properties to the
>> org.apache.commons.logging.impl.SimpleLog. I have tryed setting it to
>> org.apache.commons.logging.impl.Log4JLogger and including my
>> log4j.properties. It always seems to throw this exception. Can someone
>> give
>> me some insight as to what to do.
>>
>> The exception is being thrown in the following call:
>>
>> PropertyUtils.setSimpleProperty(convertObject, name, value);
>>
>> But the error also displayed when I used BeanUtils.setProperty and
>> copyProperty
>>
>> Here is the exception:
>>
>> java.lang.VerifyError: (class: org/apache/log4j/LogManager, method:
>> <clinit>
>> signature: ()V) Incompatible argument to function
>> 	at org.apache.log4j.Logger.getRootLogger(Logger.java:104)
>> 	at
>>
> org.apache.commons.logging.impl.Log4JLogger.initialize(Log4JLogger.java:127)
>> 	at
>> org.apache.commons.logging.impl.Log4JLogger.<init>(Log4JLogger.java:99)
>> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>> Method)
>> 	at
>> sun.reflect.NativeConstructorAccessorImpl.newInstance
>> (NativeConstructorAcces
>> sorImpl.java:39)
>> 	at
>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance
>> (DelegatingConstruc
>> torAccessorImpl.java:27)
>> 	at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
>> 	at java.lang.Class.newInstance0(Class.java:306)
>> 	at java.lang.Class.newInstance(Class.java:259)
>> 	at org.apache.commons.logging.LogFactory$2.run(LogFactory.java:571)
>> 	at java.security.AccessController.doPrivileged(Native Method)
>> 	at
>> org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:561)
>> 	at
>> org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:352)
>> 	at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:395)
>> 	at
>> org.apache.commons.beanutils.MethodUtils.<clinit>(MethodUtils.java:103)
>> 	at
>>
> org.apache.commons.beanutils.PropertyUtils.getWriteMethod(PropertyUtils.java
>> :1201)
>> 	at
>> org.apache.commons.beanutils.PropertyUtils.setSimpleProperty
>> (PropertyUtils.j
>> ava:1780)
>> 	at
>> ws.phase.xmlidx.conversion.Converter.callConverts(Converter.java:187)
>> 	at ws.phase.xmlidx.conversion.Converter.<init>(Converter.java:37)
>> 	at ws.phase.xmlidx.conversion.Converter.main(Converter.java:50)
>> Exception in thread "main"
>>
>> Brandon Goodin
>> Phase Web and Multimedia
>> PO Box 85
>> Whitefish MT 59937
>> P (406) 862-2245
>> F (406) 862-0354
>> mail@phase.ws
>> http://www.phase.ws
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>


Mime
View raw message