Fórumok

Nyitólap » Liferay Portal » English » 3. Development

Kombinált nézet Egyszerű nézet Fa-nézet
Szálak [ Előző | Következő ]
toggle
java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot be ca tony kerz 2011. március 7. 19:36
RE: java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot b Thiago Leão Moreira 2011. március 9. 14:28
RE: java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot b Arsh g 2011. április 30. 3:09
RE: java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot b Hitoshi Ozawa 2011. április 30. 5:08
RE: java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot b Thiago Leão Moreira 2011. április 30. 5:37
RE: java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot b Hitoshi Ozawa 2011. április 30. 6:52
RE: java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot b JoseManuel Garcia 2011. május 27. 0:32
RE: java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot b Bartlomiej Knabel 2011. június 7. 3:11
RE: java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot b Gaurang Sheladia 2011. június 15. 5:15
RE: java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot b Thiago Leão Moreira 2011. június 15. 10:14
RE: java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot b Gaurang Sheladia 2011. augusztus 3. 2:41
RE: java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot b Vincent Paranpan 2011. szeptember 11. 18:33
RE: java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot b Hector Leon Garay 2011. november 16. 11:36
RE: java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot b Gwowen Fu 2012. december 26. 10:33
tony kerz
java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot be ca
2011. március 7. 19:36
Válasz

tony kerz

Rangsorolás: New Member

Hozzászólások: 5

Csatlakozás dátuma: 2011. március 6.

Legújabb hozzászólások

anyone ever see this:


 1
 203:27:31,125 INFO  [HookHotDeployListener:394] Registering hook for liferay-custom-hook
 3log4j:ERROR Could not create an Appender. Reported error follows.
 4java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot be cast to org.apache.log4j.Appender
 5    at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:238)
 6    at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:171)
 7    at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:184)
 8    at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:502)
 9    at org.apache.log4j.xml.DOMConfigurator.parseRoot(DOMConfigurator.java:471)
10    at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:921)
11    at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:790)
12    at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:696)
13    at org.apache.log4j.xml.DOMConfigurator.configure(DOMConfigurator.java:821)
14    at com.liferay.util.log4j.Log4JUtil.configureLog4J(Log4JUtil.java:48)
15    at com.liferay.portal.deploy.hot.HookHotDeployListener.initLogger(HookHotDeployListener.java:1105)
16    at com.liferay.portal.deploy.hot.HookHotDeployListener.doInvokeDeploy(HookHotDeployListener.java:401)
17    at com.liferay.portal.deploy.hot.HookHotDeployListener.invokeDeploy(HookHotDeployListener.java:218)
18    at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._doFireDeployEvent(HotDeployUtil.java:109)
19    at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._fireDeployEvent(HotDeployUtil.java:182)
20    at com.liferay.portal.kernel.deploy.hot.HotDeployUtil.fireDeployEvent(HotDeployUtil.java:38)
21    at com.liferay.portal.kernel.servlet.HookContextListener.contextInitialized(HookContextListener.java:36)
22    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
23    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
24    at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1244)
25    at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1342)
26    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:303)
27    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
28    at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
29    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
30    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
31    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
32    at java.lang.Thread.run(Thread.java:619)
33log4j:ERROR Could not parse url [jar:file:/F:/product/liferay/liferay-portal-6.0.6/tomcat-6.0.29/webapps/liferay-custom-hook/WEB-INF/lib/portal-impl.jar!/META-INF/portal-log4j.xml].
34java.lang.NullPointerException
35    at java.util.Hashtable.put(Hashtable.java:394)
36    at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:172)
37    at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:184)
38    at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:502)
39    at org.apache.log4j.xml.DOMConfigurator.parseRoot(DOMConfigurator.java:471)
40    at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:921)
41    at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:790)
42    at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:696)
43    at org.apache.log4j.xml.DOMConfigurator.configure(DOMConfigurator.java:821)
44    at com.liferay.util.log4j.Log4JUtil.configureLog4J(Log4JUtil.java:48)
45    at com.liferay.portal.deploy.hot.HookHotDeployListener.initLogger(HookHotDeployListener.java:1105)
46    at com.liferay.portal.deploy.hot.HookHotDeployListener.doInvokeDeploy(HookHotDeployListener.java:401)
47    at com.liferay.portal.deploy.hot.HookHotDeployListener.invokeDeploy(HookHotDeployListener.java:218)
48    at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._doFireDeployEvent(HotDeployUtil.java:109)
49    at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._fireDeployEvent(HotDeployUtil.java:182)
50    at com.liferay.portal.kernel.deploy.hot.HotDeployUtil.fireDeployEvent(HotDeployUtil.java:38)
51    at com.liferay.portal.kernel.servlet.HookContextListener.contextInitialized(HookContextListener.java:36)
52    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
53    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
54    at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1244)
55    at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1342)
56    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:303)
57    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
58    at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
59    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
60    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
61    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
62    at java.lang.Thread.run(Thread.java:619)



i got it with 6.0.5 and currently with 6.0.6.

i didn't do anything fancy with a "hook" project i'm working on (e.g. add a log4j jar or anything). i have a liferay-plugin-package.properties that looks like:

 1
 2name=Liferay Custom
 3module-group-id=liferay
 4module-incremental-version=1
 5tags=
 6short-description=
 7change-log=
 8page-url=http://www.liferay.com
 9author=Liferay, Inc.
10licenses=LGPL
11portal-dependency-jars=\
12    portal-impl.jar,\
13    easyconf.jar,\
14    commons-lang.jar,\
15    commons-digester.jar,\
16    commons-configuration.jar,\
17    xstream.jar,\
18    commons-collections.jar,\
19    commons-beanutils.jar
Thiago Leão Moreira
RE: java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot b
2011. március 9. 14:28
Válasz

Thiago Leão Moreira

LIFERAY STAFF

Rangsorolás: Liferay Legend

Hozzászólások: 1195

Csatlakozás dátuma: 2007. október 10.

Legújabb hozzászólások

Hey Tony,

I noticed that you added portal-impl.jar to your classpath THIS IS FORBIDDEN! Adding this jar to you plugin will make Liferay behavior not properly like the problem that you are facing.
Arsh g
RE: java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot b
2011. április 30. 3:09
Válasz

Arsh g

Rangsorolás: New Member

Hozzászólások: 11

Csatlakozás dátuma: 2011. február 18.

Legújabb hozzászólások

Now i am not included portal-impl.jar then also it throws

java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot be cast to org.apache.log4j.Appender
Hitoshi Ozawa
RE: java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot b
2011. április 30. 5:08
Válasz

Hitoshi Ozawa

Rangsorolás: Liferay Legend

Hozzászólások: 8000

Csatlakozás dátuma: 2010. március 23.

Legújabb hozzászólások

Have you tried Googling this exception?
Check if you have any log4j settings in the WEB-INF\classes folder.
Thiago Leão Moreira
RE: java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot b
2011. április 30. 5:37
Válasz

Thiago Leão Moreira

LIFERAY STAFF

Rangsorolás: Liferay Legend

Hozzászólások: 1195

Csatlakozás dátuma: 2007. október 10.

Legújabb hozzászólások

Hey Tony,

This seems that you have two instances of log4j available in different classpaths. Probably one in the Global classpath and another in the Application classpath.
Hitoshi Ozawa
RE: java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot b
2011. április 30. 6:52
Válasz

Hitoshi Ozawa

Rangsorolás: Liferay Legend

Hozzászólások: 8000

Csatlakozás dátuma: 2010. március 23.

Legújabb hozzászólások

When doing a Liferay .war install, I think some application server may already have log4j in it's path. The one in the portlet's WEB-INF is usually the org.apache.log4j.ConsoleAppender
JoseManuel Garcia
RE: java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot b
2011. május 27. 0:32
Válasz

JoseManuel Garcia

Rangsorolás: New Member

Hozzászólások: 8

Csatlakozás dátuma: 2011. május 9.

Legújabb hozzászólások

Hi Tony Kerz,

I have the same problem that you. For one hand I have this error: log4j:ERROR Could not create an Appender. Reported error follows.
java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot be cast to org.apache.log4j.Appender.

And the other hand I have this problem: log4j:ERROR Could not parse url [jar:file:/C:/Liferay/liferay-portal-6.0.6/tomcat-6.0.29/webapps/UsuariosConectados-portlet/WEB-INF/lib/portal-impl.jar!/META-INF/portal-log4j.xml].
java.lang.NullPointerException.

Have you find solution for this problem?
Bartlomiej Knabel
RE: java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot b
2011. június 7. 3:11
Válasz

Bartlomiej Knabel

Rangsorolás: New Member

Hozzászólások: 8

Csatlakozás dátuma: 2011. január 30.

Legújabb hozzászólások

I have simmilar problem as JoseManuel - did You solve it?
Gaurang Sheladia
RE: java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot b
2011. június 15. 5:15
Válasz

Gaurang Sheladia

Rangsorolás: Regular Member

Hozzászólások: 158

Csatlakozás dátuma: 2009. február 15.

Legújabb hozzászólások

Hi All,

I am using Liferay 6.0.5 and i have migrated Struts Plugin portlet from Liferay 5.2.3 to 6.0.5 but still i am getting same error


log4j:ERROR Could not parse url [jar:file:/C:/Liferay/liferay-portal-6.0.6/tomcat-6.0.29/webapps/UsuariosConectados-portlet/WEB-INF/lib/portal-impl.jar!/META-INF/portal-log4j.xml].
java.lang.NullPointerException.


Does any one find any alternative solution?

Thanks in advance.

-- Gaurang
Thiago Leão Moreira
RE: java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot b
2011. június 15. 10:14
Válasz

Thiago Leão Moreira

LIFERAY STAFF

Rangsorolás: Liferay Legend

Hozzászólások: 1195

Csatlakozás dátuma: 2007. október 10.

Legújabb hozzászólások

Hey Gaurang,

The problem is that you have the portal-impl.jar on your portlet classpath. portal-impl.jar contains the core classes of Liferay and never should be referenced directly by portlet. It is explicit forbidden add this jar to your portlet's classpath. Unknown problems can be raised like the one that you are facing.
Gaurang Sheladia
RE: java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot b
2011. augusztus 3. 2:41
Válasz

Gaurang Sheladia

Rangsorolás: Regular Member

Hozzászólások: 158

Csatlakozás dátuma: 2009. február 15.

Legújabb hozzászólások

Yes Thiago, you are right. I have resolved that issue.

Thanks again for your response.
Vincent Paranpan
RE: java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot b
2011. szeptember 11. 18:33
Válasz

Vincent Paranpan

Rangsorolás: New Member

Hozzászólások: 17

Csatlakozás dátuma: 2010. október 13.

Legújabb hozzászólások

Thiago Leão Moreira:
Hey Gaurang,

The problem is that you have the portal-impl.jar on your portlet classpath. portal-impl.jar contains the core classes of Liferay and never should be referenced directly by portlet. It is explicit forbidden add this jar to your portlet's classpath. Unknown problems can be raised like the one that you are facing.



Hi Thiago,

I have the same problem, I wanted to copy the functionality of LogoutAction class in my customized hook plugin project, so I've used a part of Liferay's LogoutAction code in one of my classes, but whenever I tried deploying the hook plugin it gives me an error:

1java.lang.NoClassDefFoundError: com/liferay/portal/util/PropsValues


Since the class exists inside the portal-impl.jar I included the jar to my references, but once I redeployed my hook plugin I encountered the error discussed in this thread..

1ERROR Could not create an Appender. Reported error follows.
2java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot be cast to org.apache.log4j.Appender
3.
4.
5.
6ERROR Could not parse url [jar:file:/C:/Liferay/liferay-portal-6.0.5/tomcat-6.0.26/webapps/my-test-hook/WEB-INF/lib/portal-impl.jar!/META-INF/portal-log4j.xml].
7java.lang.NullPointerException


Would you have any advice on what I should do?

Cheers,
Vincent
Hector Leon Garay
RE: java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot b
2011. november 16. 11:36
Válasz

Hector Leon Garay

Rangsorolás: New Member

Hozzászólások: 15

Csatlakozás dátuma: 2011. július 14.

Legújabb hozzászólások

Hi Vincet,

Did you find the solution for your problem? I have the same issue as you have with a hook.

If you have any solution, can you please share it?

Regards.

HLG
Gaurang Sheladia
RE: java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot b
2012. január 12. 3:27
Válasz

Gaurang Sheladia

Rangsorolás: Regular Member

Hozzászólások: 158

Csatlakozás dátuma: 2009. február 15.

Legújabb hozzászólások

Hi Dianne,

The problem is that you have the portal-impl.jar on your portlet classpath. portal-impl.jar contains the core classes of Liferay and never should be referenced directly by portlet. It is explicit forbidden add this jar to your portlet's classpath. Unknown problems can be raised like the one that you are facing.
Joaquín Fernández
RE: java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot b
2012. február 8. 6:43
Válasz

Joaquín Fernández

Rangsorolás: Junior Member

Hozzászólások: 40

Csatlakozás dátuma: 2012. január 2.

Legújabb hozzászólások

Hi all

I have the same error:

log4j:ERROR Could not create an Appender. Reported error follows.
java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot be cast to org.apache.log4j.Appender
at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:248)



Where can i configure the portlet classpath? I don't have any jar added in the portal-dependency-jars in the liferay-plugin-package.properties

thanks
Gwowen Fu
RE: java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot b
2012. december 26. 10:33
Válasz

Gwowen Fu

Rangsorolás: Regular Member

Hozzászólások: 199

Csatlakozás dátuma: 2010. december 27.

Legújabb hozzászólások

Thiago Leão Moreira:
Hey Gaurang,

portal-impl.jar contains the core classes of Liferay and never should be referenced directly by portlet.


I need to import "com.liferay.portal.xml.QNameImpl" class that's in portal-impl.jar, if we cannot reference it directly, what's the alternative way?

Thanks!
Gwowen