Topic
  • 5 replies
  • Latest Post - ‏2012-09-24T13:30:02Z by Jacek_Laskowski
alicinar
alicinar
5 Posts

Pinned topic Was Liberty Profile getDisplayName() Error

‏2012-09-24T07:09:21Z |
Hello friends.
My was liberty profile started.
But I can not find a class.
ERROR: 09:48:06,499 : Error while executing the Runnable:
java.lang.NoClassDefFoundError: com/ibm/websphere/runtime/ServerName

Throw it into the %WASHOME%/plugins/com.ibm.ws.runtime.jar of the liberty lib.
But I still get the error.

err javax.naming.NoInitialContextException: Unable to find the InitialContextFactory com.ibm.websphere.naming.WsnInitialContextFactory.
err at org.apache.aries.jndi.ContextHelper.getInitialContext(ContextHelper.java:148)
err at org.apache.aries.jndi.OSGiInitialContextFactoryBuilder.getInitialContext(OSGiInitialContextFactoryBuilder.java:49)

Please Help.
  • Jacek_Laskowski
    Jacek_Laskowski
    133 Posts

    Re: Was Liberty Profile getDisplayName() Error

    ‏2012-09-24T12:55:52Z  
    Hi,

    How did you start the server? Could you give server start a shot and send logs in case of troubles?

    Jacek
    Japila :: verba docent, exempla trahunt
  • alicinar
    alicinar
    5 Posts

    Re: Was Liberty Profile getDisplayName() Error

    ‏2012-09-24T13:07:05Z  
    Hi,

    How did you start the server? Could you give server start a shot and send logs in case of troubles?

    Jacek
    Japila :: verba docent, exempla trahunt
    Log 1:
    Launching WLibSrv (wlp-1.0.0.20120428-1251/websphere-kernel_1.0.0) on IBM J9 VM, version pwa6470sr1-20120405_01 (SR1) (tr_TR)
    AUDIT CWWKE0001I: The server WLibSrv has been launched.
    AUDIT J2CA8004I: The dataSource DB_CONN_PROD is available as jdbc/DB_CONN_PROD.
    AUDIT J2CA8000I: The jdbcDriver OracleRef is available.
    AUDIT CWWKZ0058I: Monitoring dropins for applications.
    AUDIT CWWKT0016I: Web application available (default_host): http://localhost:9080/App/*
    AUDIT CWWKZ0001I: Application AppLiberEar started in 1.732 seconds.
    AUDIT CWWKF0011I: The server WLibSrv is ready to run a smarter planet.

    Log2: (Metod run)

    ERROR SRVE0283E: Exception caught while initializing context: java.lang.NoClassDefFoundError: com.ibm.websphere.runtime.ServerName
    at com.scheduling.JobHelper.<clinit>(JobHelper.java:187)
    at java.lang.J9VMInternals.initializeImpl(Native Method)
    at java.lang.J9VMInternals.initialize(J9VMInternals.java:228)
    at com.webservice.Starter.contextInitialized(Starter.java:108)
    at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:1975)
    at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:748)
    at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:5694)
    at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.createRunnableHandler(DynamicVirtualHost.java:220)
    at com.ibm.ws.http.internal.VirtualHostImpl.discriminate(VirtualHostImpl.java:165)
    at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink.ready(HttpDispatcherLink.java:157)
    at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:444)
    at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleNewRequest(HttpInboundLink.java:378)
    at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.processRequest(HttpInboundLink.java:278)
    at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.ready(HttpInboundLink.java:249)
    at com.ibm.ws.tcpchannel.internal.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:174)
    at com.ibm.ws.tcpchannel.internal.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:83)
    at com.ibm.ws.tcpchannel.internal.WorkQueueManager.requestComplete(WorkQueueManager.java:502)
    at com.ibm.ws.tcpchannel.internal.WorkQueueManager.attemptIO(WorkQueueManager.java:550)
    at com.ibm.ws.tcpchannel.internal.WorkQueueManager.workerRun(WorkQueueManager.java:899)
    at com.ibm.ws.tcpchannel.internal.WorkQueueManager$Worker.run(WorkQueueManager.java:981)
    at com.ibm.ws.threading.internal.Worker.executeWork(Worker.java:398)
    at com.ibm.ws.threading.internal.Worker.run(Worker.java:380)
    at java.lang.Thread.run(Thread.java:777)
    Caused by: java.lang.ClassNotFoundException: com.ibm.websphere.runtime.ServerName
    at com.ibm.ws.classloading.internal.AppClassLoader.findClassCommonLibraryClassLoaders(AppClassLoader.java:409)
    at com.ibm.ws.classloading.internal.AppClassLoader.findClass(AppClassLoader.java:253)
    at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:711)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:688)
    at com.ibm.ws.classloading.internal.AppClassLoader.loadClass(AppClassLoader.java:385)
    ... 23 more

    ERROR SRVE0777E: Exception thrown by application class 'java.lang.J9VMInternals.initialize():168'
    java.lang.NoClassDefFoundError: com.scheduling.JobHelper (initialization failure)
    at java.lang.J9VMInternals.initialize(J9VMInternals.java:168)
    at com.scheduling.JobManagement.listJob(JobManagement.java:155)
    at com.scheduling.JobManagement.service(JobManagement.java:49)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1221)
    at internal classes
  • SystemAdmin
    SystemAdmin
    590 Posts

    Re: Was Liberty Profile getDisplayName() Error

    ‏2012-09-24T13:12:58Z  
    Hi,

    The com.ibm.websphere.runtime.ServerName class is not a part of the API Liberty provides. Not all product APIs are available in Liberty. The subset which is provided can be seen by looking at the jars in the folders under the dev folder. The subset supported is also documented in the infocenter as children of this document: http://www14.software.ibm.com/webapp/wsbroker/redirect?version=phil&product=was-base-dist&topic=welc_ref_adm_pi

    The com.ibm.ws.runtime.jar is not a part of the Liberty profile, it is a part of the full profile runtime. Placing that jar in the Liberty profile lib folder does not have any effect on the Liberty profile server runtime behaviour.

    The Liberty profile does not support JNDI lookups using WsnInitialContextFactory. When doing a lookup in the local namespace it is not necessary to create an environment when creating the InitialContext instance.

    Thanks
    Alasdair
  • alicinar
    alicinar
    5 Posts

    Re: Was Liberty Profile getDisplayName() Error

    ‏2012-09-24T13:14:45Z  
    • alicinar
    • ‏2012-09-24T13:07:05Z
    Log 1:
    Launching WLibSrv (wlp-1.0.0.20120428-1251/websphere-kernel_1.0.0) on IBM J9 VM, version pwa6470sr1-20120405_01 (SR1) (tr_TR)
    AUDIT CWWKE0001I: The server WLibSrv has been launched.
    AUDIT J2CA8004I: The dataSource DB_CONN_PROD is available as jdbc/DB_CONN_PROD.
    AUDIT J2CA8000I: The jdbcDriver OracleRef is available.
    AUDIT CWWKZ0058I: Monitoring dropins for applications.
    AUDIT CWWKT0016I: Web application available (default_host): http://localhost:9080/App/*
    AUDIT CWWKZ0001I: Application AppLiberEar started in 1.732 seconds.
    AUDIT CWWKF0011I: The server WLibSrv is ready to run a smarter planet.

    Log2: (Metod run)

    ERROR SRVE0283E: Exception caught while initializing context: java.lang.NoClassDefFoundError: com.ibm.websphere.runtime.ServerName
    at com.scheduling.JobHelper.<clinit>(JobHelper.java:187)
    at java.lang.J9VMInternals.initializeImpl(Native Method)
    at java.lang.J9VMInternals.initialize(J9VMInternals.java:228)
    at com.webservice.Starter.contextInitialized(Starter.java:108)
    at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:1975)
    at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:748)
    at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:5694)
    at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.createRunnableHandler(DynamicVirtualHost.java:220)
    at com.ibm.ws.http.internal.VirtualHostImpl.discriminate(VirtualHostImpl.java:165)
    at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink.ready(HttpDispatcherLink.java:157)
    at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:444)
    at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleNewRequest(HttpInboundLink.java:378)
    at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.processRequest(HttpInboundLink.java:278)
    at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.ready(HttpInboundLink.java:249)
    at com.ibm.ws.tcpchannel.internal.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:174)
    at com.ibm.ws.tcpchannel.internal.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:83)
    at com.ibm.ws.tcpchannel.internal.WorkQueueManager.requestComplete(WorkQueueManager.java:502)
    at com.ibm.ws.tcpchannel.internal.WorkQueueManager.attemptIO(WorkQueueManager.java:550)
    at com.ibm.ws.tcpchannel.internal.WorkQueueManager.workerRun(WorkQueueManager.java:899)
    at com.ibm.ws.tcpchannel.internal.WorkQueueManager$Worker.run(WorkQueueManager.java:981)
    at com.ibm.ws.threading.internal.Worker.executeWork(Worker.java:398)
    at com.ibm.ws.threading.internal.Worker.run(Worker.java:380)
    at java.lang.Thread.run(Thread.java:777)
    Caused by: java.lang.ClassNotFoundException: com.ibm.websphere.runtime.ServerName
    at com.ibm.ws.classloading.internal.AppClassLoader.findClassCommonLibraryClassLoaders(AppClassLoader.java:409)
    at com.ibm.ws.classloading.internal.AppClassLoader.findClass(AppClassLoader.java:253)
    at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:711)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:688)
    at com.ibm.ws.classloading.internal.AppClassLoader.loadClass(AppClassLoader.java:385)
    ... 23 more

    ERROR SRVE0777E: Exception thrown by application class 'java.lang.J9VMInternals.initialize():168'
    java.lang.NoClassDefFoundError: com.scheduling.JobHelper (initialization failure)
    at java.lang.J9VMInternals.initialize(J9VMInternals.java:168)
    at com.scheduling.JobManagement.listJob(JobManagement.java:155)
    at com.scheduling.JobManagement.service(JobManagement.java:49)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1221)
    at internal classes
    There are other servers."com.ibm.ws.runtime.jar"

    System.out.println(com.ibm.websphere.runtime.ServerName.getDisplayName());
  • Jacek_Laskowski
    Jacek_Laskowski
    133 Posts

    Re: Was Liberty Profile getDisplayName() Error

    ‏2012-09-24T13:30:02Z  
    Hi,

    The com.ibm.websphere.runtime.ServerName class is not a part of the API Liberty provides. Not all product APIs are available in Liberty. The subset which is provided can be seen by looking at the jars in the folders under the dev folder. The subset supported is also documented in the infocenter as children of this document: http://www14.software.ibm.com/webapp/wsbroker/redirect?version=phil&product=was-base-dist&topic=welc_ref_adm_pi

    The com.ibm.ws.runtime.jar is not a part of the Liberty profile, it is a part of the full profile runtime. Placing that jar in the Liberty profile lib folder does not have any effect on the Liberty profile server runtime behaviour.

    The Liberty profile does not support JNDI lookups using WsnInitialContextFactory. When doing a lookup in the local namespace it is not necessary to create an environment when creating the InitialContext instance.

    Thanks
    Alasdair
    > {quote:title=Alasdair wrote:}{quote}
    > Placing that jar in the Liberty profile lib folder does not have any effect on the Liberty profile server runtime behaviour.

    Thanks Alasdair for the response! I wouldn't have guessed what's wrong - I completely disregarded the jar placing in the plugins directory. Some seem to get used to the promise of composing your own server so easily and quickly that they forget not all is possible with Liberty Profile...yet. :-) It's not that bad after all although some issues may surface.

    Jacek
    Japila :: verba docent, exempla trahunt