Any help appreciated.
Thanks, Patrik
Thanks, Patrik
Could you just change the app to defer initialization of this
singleton until the first time it is accessed?
Tom
What I'm really wondering is why the JMSFactory can't be located when the application
is started, if the AppServer deploys JMS before it deploys my application? Since
everything works alright if I redeploy the application after the server has started
or if I change the logging (it can be done in runtime by changing a file) to log
to console instead and then change back to use JMS.
This really implies that the app server deploys my application before the JMS
(or maybe the naming environment) is deployed.
Maybe it helps if I give the output from the app server during startup:
<Oct 10, 2002 9:14:41 AM CEST> <Notice> <Management> <140005> <Loading configuration
/xxx/./config.xml>
<Oct 10, 2002 9:18:19 AM CEST> <Notice> <Security> <090082> <Security initializing
using realm myrealm.>
<Oct 10, 2002 9:18:22 AM CEST> <Notice> <WebLogicServer> <000327> <Starting WebLogic
Admin Server "xxx" for domain "xxx">
log4j:ERROR Could not find name [xxx.LogFactory].
log4j:ERROR Error while activating options for appender named [A1].
javax.naming.NameNotFoundException: Unable to resolve 'xxx.LogFactory' Resolved:
'' Unresolved:'xxx' ; remaining name 'xxx.LogFactory'
at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:174)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:262)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:229)
at weblogic.jndi.internal.ServerNamingNode_WLStub.lookup(Unknown Source)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:338)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:333)
at javax.naming.InitialContext.lookup(InitialContext.java:345)
at org.apache.log4j.net.JMSQueueAppender.lookup(JMSQueueAppender.java:254)
at org.apache.log4j.net.JMSQueueAppender.activateOptions(JMSQueueAppender.java:214)
at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:247)
at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:123)
at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:87)
at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:645)
at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:603)
at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:500)
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:406)
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:307)
at org.apache.log4j.PropertyWatchdog.doOnChange(PropertyConfigurator.java:673)
at org.apache.log4j.helpers.FileWatchdog.checkAndConfigure(FileWatchdog.java:80)
at org.apache.log4j.helpers.FileWatchdog.<init>(FileWatchdog.java:49)
at org.apache.log4j.PropertyWatchdog.<init>(PropertyConfigurator.java:665)
at org.apache.log4j.PropertyConfigurator.configureAndWatch(PropertyConfigurator.java:373)
at org.apache.log4j.PropertyConfigurator.configureAndWatch(PropertyConfigurator.java:355)
<... my classes ...>
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Class.java:232)
at weblogic.ejb20.deployer.ClientDrivenBeanInfoImpl.prepare(ClientDrivenBeanInfoImpl.java:881)
at weblogic.ejb20.deployer.EJBDeployer.setupBeanInfo(EJBDeployer.java:1047)
at weblogic.ejb20.deployer.EJBDeployer.prepare(EJBDeployer.java:1251)
at weblogic.ejb20.deployer.EJBModule.prepare(EJBModule.java:235)
at weblogic.j2ee.J2EEApplicationContainer.prepareModule(J2EEApplicationContainer.java:1446)
at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:654)
at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:552)
at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:441)
at weblogic.management.deploy.slave.SlaveDeployer.prepareAllStagedApplications(SlaveDeployer.java:482)
at weblogic.management.deploy.slave.SlaveDeployer.initialize(SlaveDeployer.java:253)
at weblogic.management.deploy.DeploymentManagerServerLifeCycleImpl.initialize(DeploymentManagerServerLifeCycleImpl.java:150)
at weblogic.t3.srvr.ServerLifeCycleList.initialize(ServerLifeCycleList.java:54)
at weblogic.t3.srvr.T3Srvr.initialize1(T3Srvr.java:762)
at weblogic.t3.srvr.T3Srvr.initialize(T3Srvr.java:588)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:276)
at weblogic.Server.main(Server.java:31)
<Oct 10, 2002 9:26:54 AM CEST> <Notice> <Management> <141052> <Application Poller
started for development server.>
<Oct 10, 2002 9:27:01 AM CEST> <Notice> <Security> <090092> <SSL will load trusted
CAs from the JDK cacerts KeyStore: <...>
<Oct 10, 2002 9:27:02 AM CEST> <Notice> <Management> <141030> <Starting discovery
of Managed Server... This feature is on by default, you may turn this off by passing
-Dweblogic.management.discover=false>
<Oct 10, 2002 9:27:02 AM CEST> <Notice> <WebLogicServer> <000331> <Started WebLogic
Admin Server "xxx" for domain "xxx" running in Development Mode>
<Oct 10, 2002 9:27:03 AM CEST> <Notice> <WebLogicServer> <000365> <Server state
changed to RUNNING>
<Oct 10, 2002 9:27:03 AM CEST> <Notice> <WebLogicServer> <000360> <Server started
in RUNNING mode>
<Oct 10, 2002 9:27:03 AM CEST> <Notice> <WebLogicServer> <000360> <Server started
in RUNNING mode>
<Oct 10, 2002 9:27:03 AM CEST> <Notice> <WebLogicServer> <000360> <Server started
in RUNNING mode>
Patrik Oscarsson wrote:
> The singleton class is initialized as soon as it is accessed which will occur as
> soon as another class in the application is created. So changing the initialization
> of the logger class will not change anything.
What I meant is: if by "accessed" you mean "constructed", perhaps
as a work-around, move the init() code in the singleton class out
the class constructor or static initializer. eg, defer calling "init()" until
some method actually requires it. ( I'm wondering if the ejb is started after JMS, but
perhaps class-loaded before JMS?)
Otherwise, all I can suggest is posting to the ejb newsgroup.
Tom
/ Patrik
Tom Barnes <ple...@replyinnewsgroup.com> wrote:
>Hi Patrick,