users@glassfish.java.net

Re: Loading log util bundle before the rest

From: <forums_at_java.net>
Date: Tue, 12 Jul 2011 02:25:37 -0500 (CDT)

Hi Sahoo,

I need to make an autodeploy folder with slf4j + log4j + my log utils
jars. 

For this:

1) moved these jars from "modules/autostart" to a new folder
"${com.sun.aas.instanceRoot}/my-autostart/".

2) Created a cfg file to make it autostart and placed it under
"modules/autostart" folder (attached to this message).

3) Added my util jar and slf4j + log4j jars in glassfish.auto.start
parameter (attached)

The problem is: I see that glassfish first tries to load my bundles from
modules/autostart, they fail because log4j jars are loaded afterwards. After
a second all the log files are loaded. But the question is: why glassfish
doesn't load first of all the bundles defined in "glassfish.auto.start"
parameter?

The exception is:

#|2011-07-12T10:13:07.426+0300|INFO|glassfish3.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=48;_ThreadName=Thread-1;|org.osgi.framework.BundleException:
Unresolved constraint in bundle my-app-jar [268]: Unable to resolve 268.0:
missing requirement [268.0] package;
(&(package=com.test.osgi.extender.annotations)(version>=1.0.0.SNAPSHOT))
[caused by: Unable to resolve 270.0: missing requirement [270.0] package;
(package=org.apache.log4j)]
    at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3443)
    at org.apache.felix.framework.Felix.startBundle(Felix.java:1727)
    at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:922)
    at
org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:1175)
    at
org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:1153)
    at
org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:458)
    at
org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:263)
|#]
[#|2011-07-12T10:13:09.113+0300|INFO|glassfish3.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=66;_ThreadName=Thread-1;|Installed
C:\glassfish\glassfish\domains\domain1\my-autostart\slf4j-api-1.5.11.jar|#]
[#|2011-07-12T10:13:09.301+0300|INFO|glassfish3.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=66;_ThreadName=Thread-1;|Installed
CC:\glassfish\glassfish\domains\domain1\my-autostart\log4j-1.2.15.jar|#]
[#|2011-07-12T10:13:09.332+0300|INFO|glassfish3.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=66;_ThreadName=Thread-1;|Installed
C:\glassfish\glassfish\domains\domain1\my-autostart\slf4j-log4j12-1.5.11.jar|#]
[#|2011-07-12T10:13:09.348+0300|INFO|glassfish3.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=66;_ThreadName=Thread-1;|Installed
C:\glassfish\glassfish\domains\domain1\my-autostart\btoa-utils-1.0.0-SNAPSHOT.jar|#]
[#|2011-07-12T10:13:09.348+0300|INFO|glassfish3.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=66;_ThreadName=Thread-1;|Started
bundle:
file:/C:/glassfish/glassfish/domains/domain1/my-autostart/log4j-1.2.15.jar|#]
[#|2011-07-12T10:13:09.348+0300|INFO|glassfish3.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=66;_ThreadName=Thread-1;|Started
bundle:
file:/C:/glassfish/glassfish/domains/domain1/my-autostart/slf4j-api-1.5.11.jar|#]
[#|2011-07-12T10:13:09.410+0300|INFO|glassfish3.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=66;_ThreadName=Thread-1;|Started
bundle:
file:/C:/glassfish/glassfish/domains/domain1/my-autostart/btoa-utils-1.0.0-SNAPSHOT.jar|#]
[#|2011-07-12T10:13:09.410+0300|INFO|glassfish3.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=66;_ThreadName=Thread-1;|Started
bundle:
file:/C:/glassfish/glassfish/domains/domain1/my-autostart/slf4j-api-1.5.11.jar|#]
[#|2011-07-12T10:13:09.410+0300|INFO|glassfish3.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=66;_ThreadName=Thread-1;|Started
bundle:
file:/C:/glassfish/glassfish/domains/domain1/my-autostart/log4j-1.2.15.jar|#]
[#|2011-07-12T10:13:09.410+0300|INFO|glassfish3.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=66;_ThreadName=Thread-1;|Started
bundle:
file:/C:/glassfish/glassfish/domains/domain1/my-autostart/btoa-utils-1.0.0-SNAPSHOT.jar|#]
[#|2011-07-12T10:13:16.816+0300|INFO|glassfish3.1|org.glassfish.osgijavaeebase|_ThreadID=20;_ThreadName=Thread-1;|Expanded
at file:/C:/DOCUME~1/ttt/LOCALS~1/Temp/osgiapp7753298450561899081/|#]

 


--
[Message sent by forum member 'okna2000']
View Post: http://forums.java.net/node/819498