Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Error finding JMS Factory during server startup

3 views
Skip to first unread message

Patrik Oscarsson

unread,
Oct 8, 2002, 7:52:11 AM10/8/02
to
Hi.
I'm having an application that uses Log4J to log information to a JMS queue that is specified in the Weblogic 7.0 server.
The problem occurs when I start the Weblogic server (single server), I get a 'NameNotFoundException' unable to resolve 'xxx.xxFactory', Resolved: ''.
It looks like it can't find the specified factory, but the thing is that if I start up the server with my application set to use another type of logger (console) and then changes to the JMS in run-time, everything works ok. Then the logging is sent to the JMS queue without problems. According to all documentation Weblogic should deploy JDBC, JMS and then Applications but in this case it looks like it's deploying the application before the JMS queue is done since it can't find it at startup but after everything is up it has no problems finding it.

Any help appreciated.
Thanks, Patrik

Tom Barnes

unread,
Oct 8, 2002, 12:41:16 PM10/8/02
to Patrik Oscarsson
How is the application packaged?
Is it always on the same server as the JMS server?

Patrik Oscarsson

unread,
Oct 9, 2002, 5:02:59 AM10/9/02
to

Yes, the application resides in a EAR file with a jar and a war file.
Almost all of the classes in these archives access the log class
that is a singleton class that gives away single instances of a
specific logger class.
As for now the JMS server resides on the same server as the application,
that might change in the future though.

Thanks, Patrik

Tom Barnes

unread,
Oct 9, 2002, 1:49:45 PM10/9/02
to Patrik Oscarsson
How is the singleton class that loads the factory initialized?

Could you just change the app to defer initialization of this
singleton until the first time it is accessed?

Tom

Patrik Oscarsson

unread,
Oct 10, 2002, 4:56:16 AM10/10/02
to

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'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>

Tom Barnes

unread,
Oct 10, 2002, 2:45:42 PM10/10/02
to Patrik Oscarsson
Hi Patrick,

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 Oscarsson

unread,
Oct 11, 2002, 4:16:21 AM10/11/02
to

Hi again.
Thanks alot for your help.
Unfortunately I've tried that and it didn't help, but many thanks for your help
anyway :)
I'll post in the EJB group instead and see if someone there might help me.

/ Patrik

Tom Barnes <ple...@replyinnewsgroup.com> wrote:
>Hi Patrick,

0 new messages