You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by ivan_nikitsenka <ni...@gmail.com> on 2015/04/02 16:14:21 UTC

Log4j Error object is not assignable to a "org.apache.log4j.Appender" variable

Hello I have the next errors when Tomee 1.7.0 server starts with an ear
application.log4j:ERROR A "org.apache.log4j.RollingFileAppender" object is
not assignable to a "org.apache.log4j.Appender" variable.log4j:ERROR The
class "org.apache.log4j.Appender" was loaded bylog4j:ERROR
[org.apache.openejb.core.TempClassLoader@1c588c7] whereas object of
typelog4j:ERROR "org.apache.log4j.RollingFileAppender" was loaded by
[org.apache.openejb.util.classloader.URLClassLoaderFirst@ec66b5].log4j:ERROR
Could not instantiate appender named "networx".I have an ear application in
tomee/apps folder and log4j.jar is inside the ear file. No other log4j
classes exist in the application and server.When i add log4j.jar to
Tomee/lib folder it works fine and errors don't appear. However this is not
convenient and i need to include log4j in the ear application itself.
Changing RollingFileAppender to any other adapter doesn't fix the issus.
Adding openejb.log.factory=log4j doesn't fix the issue as well.



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Log4j-Error-object-is-not-assignable-to-a-org-apache-log4j-Appender-variable-tp4674248.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: Log4j Error object is not assignable to a "org.apache.log4j.Appender" variable

Posted by Romain Manni-Bucau <rm...@gmail.com>.
https://issues.apache.org/jira/browse/OPENJPA-2575
Le 7 avr. 2015 10:19, "ivan_nikitsenka" <ni...@gmail.com> a écrit :

> What is OPENJPA-2575? Could you provide a link?
>
> Thanks
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/Log4j-Error-object-is-not-assignable-to-a-org-apache-log4j-Appender-variable-tp4674248p4674308.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: Log4j Error object is not assignable to a "org.apache.log4j.Appender" variable

Posted by ivan_nikitsenka <ni...@gmail.com>.
What is OPENJPA-2575? Could you provide a link?

Thanks



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Log4j-Error-object-is-not-assignable-to-a-org-apache-log4j-Appender-variable-tp4674248p4674308.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: Log4j Error object is not assignable to a "org.apache.log4j.Appender" variable

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

this comes from the enhancement done for cmp beans, we can't do much in our
codebase, opened OPENJPA-2575


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>

2015-04-06 15:51 GMT+02:00 ivan_nikitsenka <ni...@gmail.com>:

> Unfortunately still have the errors
> Please find the example demo ear file to reproduce the issue.
> Simply drop it in apache-tomee-1.7.1-plus/apps folder and start the server.
> You will see the errors in the start logs.
>
> log4j:ERROR A "org.apache.log4j.RollingFileAppender" object is not
> assignable to a "org.apache.log4j.Appender" variable.
> log4j:ERROR The class "org.apache.log4j.Appender" was loaded by
> log4j:ERROR [org.apache.openejb.core.TempClassLoader@37ff4054] whereas
> object of type
> log4j:ERROR "org.apache.log4j.RollingFileAppender" was loaded by
> [org.apache.openejb.util.classloader.URLClassLoaderFirst@3383649e].
> log4j:ERROR Could not instantiate appender named "networx".
>
> demo-ear.ear
> <http://tomee-openejb.979440.n4.nabble.com/file/n4674295/demo-ear.ear>
>
>
>
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/Log4j-Error-object-is-not-assignable-to-a-org-apache-log4j-Appender-variable-tp4674248p4674295.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: Log4j Error object is not assignable to a "org.apache.log4j.Appender" variable

Posted by ivan_nikitsenka <ni...@gmail.com>.
Unfortunately still have the errors 
Please find the example demo ear file to reproduce the issue.
Simply drop it in apache-tomee-1.7.1-plus/apps folder and start the server.
You will see the errors in the start logs.

log4j:ERROR A "org.apache.log4j.RollingFileAppender" object is not
assignable to a "org.apache.log4j.Appender" variable.
log4j:ERROR The class "org.apache.log4j.Appender" was loaded by
log4j:ERROR [org.apache.openejb.core.TempClassLoader@37ff4054] whereas
object of type
log4j:ERROR "org.apache.log4j.RollingFileAppender" was loaded by
[org.apache.openejb.util.classloader.URLClassLoaderFirst@3383649e].
log4j:ERROR Could not instantiate appender named "networx".

demo-ear.ear
<http://tomee-openejb.979440.n4.nabble.com/file/n4674295/demo-ear.ear>  






--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Log4j-Error-object-is-not-assignable-to-a-org-apache-log4j-Appender-variable-tp4674248p4674295.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: Log4j Error object is not assignable to a "org.apache.log4j.Appender" variable

Posted by Romain Manni-Bucau <rm...@gmail.com>.
For class path support we need a xbean finder flag.

Putting it in ear/lib should work
Le 3 avr. 2015 17:01, "ivan_nikitsenka" <ni...@gmail.com> a écrit :

> Unfortunately absolutely the same errors with
> apache-tomee-plus-1.7.2-SNAPSHOT
>
> I have ear file with the next structure:
> myEar
> |-- myEjb2.jar
>     | -- MANIFEST.MF (Class-Path: log4j-1.2.8.jar)
> |-- myWebService.war
> |-- log4j-1.2.8.jar
>
> Is it a correct way? Also i've tried to add  log4j in the war/lib folder
> but
> it doesn't help.
> If it is not correct could you describe or provide a correct example with
> similar ear structure
>
> Thanks
> Ivan
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/Log4j-Error-object-is-not-assignable-to-a-org-apache-log4j-Appender-variable-tp4674248p4674256.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: Log4j Error object is not assignable to a "org.apache.log4j.Appender" variable

Posted by ivan_nikitsenka <ni...@gmail.com>.
Unfortunately absolutely the same errors with
apache-tomee-plus-1.7.2-SNAPSHOT

I have ear file with the next structure:
myEar
|-- myEjb2.jar
    | -- MANIFEST.MF (Class-Path: log4j-1.2.8.jar)
|-- myWebService.war
|-- log4j-1.2.8.jar

Is it a correct way? Also i've tried to add  log4j in the war/lib folder but
it doesn't help.
If it is not correct could you describe or provide a correct example with
similar ear structure

Thanks
Ivan



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Log4j-Error-object-is-not-assignable-to-a-org-apache-log4j-Appender-variable-tp4674248p4674256.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: Log4j Error object is not assignable to a "org.apache.log4j.Appender" variable

Posted by Romain Manni-Bucau <rm...@gmail.com>.
can you try with our snapshot please?
http://repository.apache.org/content/groups/snapshots/org/apache/openejb/apache-tomee/1.7.2-SNAPSHOT/


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>

2015-04-02 16:47 GMT+02:00 ivan_nikitsenka <ni...@gmail.com>:

> When i use openejb.classloader.forced-skip=org.apache.log4j in both 1.7.0
> and
> 1.7.1 it behaves like log4j classes not found
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/Log4j-Error-object-is-not-assignable-to-a-org-apache-log4j-Appender-variable-tp4674248p4674251.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: Log4j Error object is not assignable to a "org.apache.log4j.Appender" variable

Posted by ivan_nikitsenka <ni...@gmail.com>.
When i use openejb.classloader.forced-skip=org.apache.log4j in both 1.7.0 and
1.7.1 it behaves like log4j classes not found



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Log4j-Error-object-is-not-assignable-to-a-org-apache-log4j-Appender-variable-tp4674248p4674251.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: Log4j Error object is not assignable to a "org.apache.log4j.Appender" variable

Posted by Romain Manni-Bucau <rm...@gmail.com>.
openejb.log.factory is for container log so sounds normal it doesnt change
anything,

did you try 1.7.1? openejb.classloader.forced-skip=org.apache.log4j in
conf/system.properties?


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>

2015-04-02 16:14 GMT+02:00 ivan_nikitsenka <ni...@gmail.com>:

> Hello I have the next errors when Tomee 1.7.0 server starts with an ear
> application.log4j:ERROR A "org.apache.log4j.RollingFileAppender" object is
> not assignable to a "org.apache.log4j.Appender" variable.log4j:ERROR The
> class "org.apache.log4j.Appender" was loaded bylog4j:ERROR
> [org.apache.openejb.core.TempClassLoader@1c588c7] whereas object of
> typelog4j:ERROR "org.apache.log4j.RollingFileAppender" was loaded by
> [org.apache.openejb.util.classloader.URLClassLoaderFirst@ec66b5
> ].log4j:ERROR
> Could not instantiate appender named "networx".I have an ear application in
> tomee/apps folder and log4j.jar is inside the ear file. No other log4j
> classes exist in the application and server.When i add log4j.jar to
> Tomee/lib folder it works fine and errors don't appear. However this is not
> convenient and i need to include log4j in the ear application itself.
> Changing RollingFileAppender to any other adapter doesn't fix the issus.
> Adding openejb.log.factory=log4j doesn't fix the issue as well.
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/Log4j-Error-object-is-not-assignable-to-a-org-apache-log4j-Appender-variable-tp4674248.html
> Sent from the TomEE Users mailing list archive at Nabble.com.