Topic
  • 5 replies
  • Latest Post - ‏2013-01-03T13:43:21Z by SystemAdmin
ozair
ozair
4 Posts

Pinned topic Unable to deploy WL App on WAS 8

‏2012-12-21T05:03:03Z |
I am running WL 5.0.0.5

After deploying my WL application, I got a log4j error with classnotfound exception. I did find any instructions requiring the use of the log4j.jar file.

I tried adding it to my app WEB-INF/lib directory, but that did not work either, so I finally added it to the <WAS_INSTALL_DIR> lib directory and am now getting the following error:

12/20/12 23:56:30:925 EST 00000006 webapp E com.ibm.ws.webcontainer.webapp.WebApp notifyServletContextCreated SRVE0283E: Exception caught while initializing context: {0}
java.lang.RuntimeException: java.lang.NullPointerException
at com.worklight.server.bundle.project.JeeProjectActivator.contextInitialized(JeeProjectActivator.java:98)
at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:1680)
at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:410)
at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:88)
at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:169)
at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:749)
at com.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:634)
at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:422)
at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:714)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1160)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1369)
at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:639)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:967)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:766)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2153)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:445)
at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:388)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$500(CompositionUnitMgrImpl.java:116)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$CUInitializer.run(CompositionUnitMgrImpl.java:994)
at com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:349)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1690)
Caused by: java.lang.NullPointerException
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:387)
at org.apache.log4j.PropertyConfigurator.configure(PropertyConfigurator.java:340)
at com.worklight.server.bundle.project.JeeProjectActivator.contextInitialized(JeeProjectActivator.java:82)
... 21 more
  • ozair
    ozair
    4 Posts

    Re: Unable to deploy WL App on WAS 8

    ‏2012-12-21T17:57:00Z  
    Added log4jfile, log4j.properties to server/conf and resolved the issue. Here is sample taken from a previous post: http://www.ibm.com/developerworks/forums/thread.jspa?threadID=439138

    log4j.rootLogger=INFO, CONSOLE, FILE
    log4j.logger.com.worklight.builder = INFO, CONSOLE
    log4j.additivity.com.worklight.builder = false
    log4j.logger.development.developer=DEBUG

    log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
    log4j.appender.CONSOLE.layout=com.worklight.common.log4j.NoStackTracePatternLayout
    log4j.appender.CONSOLE.layout.ConversionPattern=%d{ABSOLUTE} %-5p %c{1} %m%n

    log4j.appender.FILE=org.apache.log4j.RollingFileAppender
    log4j.appender.FILE.File=${worklight.home}/log/server.log
    log4j.appender.FILE.maxFileSize=10MB
    log4j.appender.FILE.maxBackupIndex=10
    log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
    log4j.appender.FILE.layout.ConversionPattern=%d %-5p %c{1} (%t:%x) %m%n

    log4j.appender.ERRORLOG=org.apache.log4j.RollingFileAppender
    log4j.appender.ERRORLOG.File=${worklight.home}/log/error.log
    log4j.appender.ERRORLOG.maxFileSize=10MB
    log4j.appender.ERRORLOG.maxBackupIndex=10
    log4j.appender.ERRORLOG.layout=org.apache.log4j.PatternLayout
    log4j.appender.ERRORLOG.layout.ConversionPattern=%d %-5p %c{1} (%t:%x) %m%n

    log4j.appender.AUDITLOG=org.apache.log4j.RollingFileAppender
    log4j.appender.AUDITLOG.File=${worklight.home}/log/audit.log
    log4j.appender.AUDITLOG.maxFileSize=10MB
    log4j.appender.AUDITLOG.maxBackupIndex=10
    log4j.appender.AUDITLOG.layout=org.apache.log4j.PatternLayout
    log4j.appender.AUDITLOG.layout.ConversionPattern=%d %-5p %c{1} (%t:%x) %m%n

    log4j.logger.org.springframework=WARN
    log4j.logger.org.jboss=WARN

    log4j.logger.com.worklight=INFO

    log4j.logger.error=WARN, ERRORLOG
    log4j.additivity.error = false

    log4j.logger.audit=INFO, AUDITLOG
    log4j.additivity.audit = false
  • ozair
    ozair
    4 Posts

    Re: Unable to deploy WL App on WAS 8

    ‏2012-12-21T22:14:36Z  
    • ozair
    • ‏2012-12-21T17:57:00Z
    Added log4jfile, log4j.properties to server/conf and resolved the issue. Here is sample taken from a previous post: http://www.ibm.com/developerworks/forums/thread.jspa?threadID=439138

    log4j.rootLogger=INFO, CONSOLE, FILE
    log4j.logger.com.worklight.builder = INFO, CONSOLE
    log4j.additivity.com.worklight.builder = false
    log4j.logger.development.developer=DEBUG

    log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
    log4j.appender.CONSOLE.layout=com.worklight.common.log4j.NoStackTracePatternLayout
    log4j.appender.CONSOLE.layout.ConversionPattern=%d{ABSOLUTE} %-5p %c{1} %m%n

    log4j.appender.FILE=org.apache.log4j.RollingFileAppender
    log4j.appender.FILE.File=${worklight.home}/log/server.log
    log4j.appender.FILE.maxFileSize=10MB
    log4j.appender.FILE.maxBackupIndex=10
    log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
    log4j.appender.FILE.layout.ConversionPattern=%d %-5p %c{1} (%t:%x) %m%n

    log4j.appender.ERRORLOG=org.apache.log4j.RollingFileAppender
    log4j.appender.ERRORLOG.File=${worklight.home}/log/error.log
    log4j.appender.ERRORLOG.maxFileSize=10MB
    log4j.appender.ERRORLOG.maxBackupIndex=10
    log4j.appender.ERRORLOG.layout=org.apache.log4j.PatternLayout
    log4j.appender.ERRORLOG.layout.ConversionPattern=%d %-5p %c{1} (%t:%x) %m%n

    log4j.appender.AUDITLOG=org.apache.log4j.RollingFileAppender
    log4j.appender.AUDITLOG.File=${worklight.home}/log/audit.log
    log4j.appender.AUDITLOG.maxFileSize=10MB
    log4j.appender.AUDITLOG.maxBackupIndex=10
    log4j.appender.AUDITLOG.layout=org.apache.log4j.PatternLayout
    log4j.appender.AUDITLOG.layout.ConversionPattern=%d %-5p %c{1} (%t:%x) %m%n

    log4j.logger.org.springframework=WARN
    log4j.logger.org.jboss=WARN

    log4j.logger.com.worklight=INFO

    log4j.logger.error=WARN, ERRORLOG
    log4j.additivity.error = false

    log4j.logger.audit=INFO, AUDITLOG
    log4j.additivity.audit = false
    I got pass one hurdle and onto another ...

    Running WAS 8.0.5 with WL Enterprise edition, with DB2 9.7 ESE. I am able to deploy adapters without an issue, but cannot deploy any of my wlapps. After putting on the trace, I always get the following error:

    12/21/12 16:22:51:845 EST 0000002c WidgetService 1 com.worklight.gadgets.bean.WidgetServiceBean run() logger.deployment.info.end.run
    12/21/12 16:22:51:845 EST 0000002c RssBrokerUtil 1 com.worklight.core.util.RssBrokerUtils doInTransaction Unexpected exception during transaction, rollback: ERROR
    12/21/12 16:22:51:845 EST 0000002c RssBrokerUtil 1 com.worklight.core.util.RssBrokerUtils rollbackTransaction Transaction rollback: -1595389770 (new:true; completed:false; rollbackOnly:false)
    12/21/12 16:22:51:848 EST 0000002c Authenticatio 1 com.worklight.core.auth.impl.AuthenticationFilter doFilter request execution finished - cleanup the thread context
    12/21/12 16:22:51:848 EST 0000002c Authenticatio < com.worklight.core.auth.impl.AuthenticationFilter doFilter RETURN

    I don't see any console.log, my log4j.properties are probably not being picked up. Any help would be appreciated, been stuck on trying to get this to work.

    Thanks
  • raanan
    raanan
    1 Post

    Re: Unable to deploy WL App on WAS 8

    ‏2012-12-31T12:55:06Z  
    • ozair
    • ‏2012-12-21T22:14:36Z
    I got pass one hurdle and onto another ...

    Running WAS 8.0.5 with WL Enterprise edition, with DB2 9.7 ESE. I am able to deploy adapters without an issue, but cannot deploy any of my wlapps. After putting on the trace, I always get the following error:

    12/21/12 16:22:51:845 EST 0000002c WidgetService 1 com.worklight.gadgets.bean.WidgetServiceBean run() logger.deployment.info.end.run
    12/21/12 16:22:51:845 EST 0000002c RssBrokerUtil 1 com.worklight.core.util.RssBrokerUtils doInTransaction Unexpected exception during transaction, rollback: ERROR
    12/21/12 16:22:51:845 EST 0000002c RssBrokerUtil 1 com.worklight.core.util.RssBrokerUtils rollbackTransaction Transaction rollback: -1595389770 (new:true; completed:false; rollbackOnly:false)
    12/21/12 16:22:51:848 EST 0000002c Authenticatio 1 com.worklight.core.auth.impl.AuthenticationFilter doFilter request execution finished - cleanup the thread context
    12/21/12 16:22:51:848 EST 0000002c Authenticatio < com.worklight.core.auth.impl.AuthenticationFilter doFilter RETURN

    I don't see any console.log, my log4j.properties are probably not being picked up. Any help would be appreciated, been stuck on trying to get this to work.

    Thanks
    Hi.

    Worklight does not use log4j
    see http://pic.dhe.ibm.com/infocenter/wrklight/v5r0m5/index.jsp?topic=%2Fcom.ibm.worklight.help.doc%2Fadmin%2Fr_logging_and_monitoring_mechanisms.html&resultof%3D%2522%256c%256f%2567%2567%2569%256e%2567%2522%2520%2522%256c%256f%2567%2522%2520 for more information.

    About the error you are getting:
    What is the size of the application?
    Can you create a new empty application and try to deploy it and let us know what was the result?
  • ozair
    ozair
    4 Posts

    Re: Unable to deploy WL App on WAS 8

    ‏2013-01-03T03:37:01Z  
    • raanan
    • ‏2012-12-31T12:55:06Z
    Hi.

    Worklight does not use log4j
    see http://pic.dhe.ibm.com/infocenter/wrklight/v5r0m5/index.jsp?topic=%2Fcom.ibm.worklight.help.doc%2Fadmin%2Fr_logging_and_monitoring_mechanisms.html&resultof%3D%2522%256c%256f%2567%2567%2569%256e%2567%2522%2520%2522%256c%256f%2567%2522%2520 for more information.

    About the error you are getting:
    What is the size of the application?
    Can you create a new empty application and try to deploy it and let us know what was the result?
    I resolved the issue ... I was not using WL Studio 5.0.5 to deploy applications to WL 5.0.5.

    Perhaps, the older version had some dependency to log4j. Anyways, lesson learned is to use the same version. It would be nice to have a descriptive error message when a WL console deployment fails, or even a location where you can look at the console logs. I did not find anything to help debug this issue.
  • SystemAdmin
    SystemAdmin
    300 Posts

    Re: Unable to deploy WL App on WAS 8

    ‏2013-01-03T13:43:21Z  
    • ozair
    • ‏2013-01-03T03:37:01Z
    I resolved the issue ... I was not using WL Studio 5.0.5 to deploy applications to WL 5.0.5.

    Perhaps, the older version had some dependency to log4j. Anyways, lesson learned is to use the same version. It would be nice to have a descriptive error message when a WL console deployment fails, or even a location where you can look at the console logs. I did not find anything to help debug this issue.
    ozair,

    I've opened a defect to see if we can address this with a more descriptive error message.

    Barbara Hampson, Manager, IBM Worklight