Propagating JAAS Subject for startup classes
Do startup classes have to login before they can access secured
resources in WLS 6.0? I notice that WLS 6.0 asks for a password before
starting the server. Is the "subject" created by that login somehow
propagated to startup class threads (and their thread offspring) or does
this have to be done manually?
I want to try to set up startup classes using a security style similar
to the Unix init process. It starts up as root and then starts its
services/daemons using something like:
su - foo-user foo-daemon
The foo-daemon runs as foo-user and, in Unix, so does every process
forked by the foo-daemon. I would like to use a parallel approach in
WLS. Can it be done?
Thanks,
Tim Taylor
Hi,
That's what I think too. I guess the only way to get the credentials is to
use a weblogic specific class that allows you to login an user from a servlet/jsp.
It does returns the Subject instead of a principal, so you can get the credentials...
seems like we'd need to change the J2EE api to further integrate JAAS with it.
Welll... back to handling security on my own :\
Regards,
Leonardo Bueno
"Utpal" <[email protected]> wrote:
I think EJBContext.getCallerPrincipal() and
HttpServletRequest.getRemoteUser() are the only method
to get the principal. I don't think subject can be accessed in the
EJB/Servlet using standard APIs.
-utpal
"Leonardo Bueno" <[email protected]> wrote in message
news:3ef74da0$[email protected]..
Hi,
I have to write a security framework for my J2EE application and ithas to
be
portable between appservers. I`m thinking about using JAAS andprogrammatic security.
I`ve written a LoginModule that does user authetication and loads alluser
credentials.
These credentials are app specific classes like WindowPermission.
How can I have access to these credentials from a servlet/EJB? Is therea
way
to get the Subject and not just the Principal from a servlet/EJB?
Thanks,
Leonardo
Similar Messages
-
Security settings for startup class
Hi,
I use WL6.1 (sp2) where the "guest" user is disabled and server starts up with
"system" user. All beans are permitted to be launched using other user "user1"
and not "system" user. And the jar file with beans and other staff is deployed
well, except of one thing:
I have startup class in the application and it doesn't work. When trigger method
is launched, the following exception is thrown:
<WispConfiguration: Can't connect to bean. No configuration avaiable java.rmi.AccessException:
Security violation: insufficient permission to access method; nested exception
is: java.lang.SecurityException: Security violation: insufficient permission
to access method>
As i understand this is the security problem. How could I configure weblogic
to make him to use "user1" instead of "system" when running startup class? Where
should I define it: in startup() method of startup class or in configuration files
of WL?
Any help/hint will be very appreciated.
THANKS
Orlyracb wrote:
i took all the folders out and restarted and the same message came up that the startupitems folder is insecure and a second message saying that folder DS_Store in the startupitems folder is disabled because of insecure settings. Now I can not see that folder in the startup items folder, any idea
Probably just as it says, DS_Store is corrupt. This stores the settings for a folder.
To see if we can find the invisible folder and remove it open Terminal in your Utilities folder and at the prompt copy and paste defaults write com.apple.finder AppleShowAllFiles True; killall Finder
If you can see the file now just delete it.
Then, switch back to visibles only and create a new folder called Startup Items.
defaults write com.apple.finder AppleShowAllFiles False; killall Finder
Or, simply creating a new Startup Items folder may be enough.
-mj
-
Lifecycle functionality for startup class at ear level
Hi,
I've searched and searched and read through a great deal of the R3 (10.1.3)documentation, looking for the ability to initialize a thread/class at application startup time at the ear level. I see where it is documented how to initialize a servlet at application startup using the "load-on-startup" tag, however, I have been unable to find any documentation outlining how to do so at the ear/EJB container level.
Is my only option to put together a servlet that calls/starts my ejb level class/thread and then configure that servlet for "load-on-startup"?Lest you thought nobody has looked at your post, here I am, with a negative answer though. I do not think there is a lifecycle functionality for startup/shutdown class at ear level in oc4j. There are startup/shutdown classes that are called after OC4J initializes or before OC4J terminates, which is not what you are looking for either.
-
Custom Service for Startup classes in SAP Netweaver
Hi All,
Can any one please let me know for some custom service in Java which can be used in place of startup class? I want to use it to start the RoleListener which will be registered in the RoleFactory of UMFactory?
Regards,
Smriti.Hello
maybe a ServletContextListener could help you
see [http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/ServletContextListener.html] and google for ServletContextListener
regards franz
reward points if useful -
Redundancy for startup class.
Hi,
I have a startup class in weblogic server. This class acts as a daemon inside
weblogic server. What happens if this class goes down due to an exception after
a while ? does the weblogic server brings it up again or can we configure it or
is it just lost?
-Kishan-It it runs in its own thread why don't you just do something like this:
public void run()
............ //initialization
while(!shouldStop)
try
catch(Throwable th)
th.printStackTrace();
and you wouldn't need anything like the functionality you are describing which I do
not believe BEA does.
Regards,
--dejan
Kishan wrote:
Hi,
I have a startup class in weblogic server. This class acts as a daemon inside
weblogic server. What happens if this class goes down due to an exception after
a while ? does the weblogic server brings it up again or can we configure it or
is it just lost?
-Kishan-[dejan_bektchiev.vcf] -
Null argument for startup classes when managered server starts
Hi Everyone,
We have a Weblogic 10.3.5 clustering environment. the environment seems to work fine. I am able to have the servers (both Admin and Managed) and deployed applications running without any problems. However, I just notice that, every time when I start the Managered servers, I got the following information in the system log. It appears that they are start-up classes, but with null argument. Are they normal or not?
Thanks in advance,
John
####<Feb 22, 2012 11:28:27 AM EST> <Info> <WebLogicServer> <entwl2u-vm.co.pinellas.fl.us> <Pinellas1uCluster1MS2> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1329928107258> <BEA-000256> <Invoking oracle.dms.wls.DMSShutdown.main(null)>
####<Feb 22, 2012 11:28:27 AM EST> <Info> <WebLogicServer> <entwl2u-vm.co.pinellas.fl.us> <Pinellas1uCluster1MS2> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1329928107769> <BEA-000256> <Invoking oracle.ias.cache.Shutdown.main(null)>
####<Feb 22, 2012 11:40:08 AM EST> <Info> <WebLogicServer> <entwl2u-vm.co.pinellas.fl.us> <Pinellas1uCluster1MS2> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1329928808600> <BEA-000256> <Invoking oracle.jrf.wls.JRFStartup.main(null)>
####<Feb 22, 2012 11:40:08 AM EST> <Info> <WebLogicServer> <entwl2u-vm.co.pinellas.fl.us> <Pinellas1uCluster1MS2> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1329928808682> <BEA-000256> <Invoking oracle.security.jps.wls.JpsWlsStartupClass.main(null)>
####<Feb 22, 2012 11:40:08 AM EST> <Info> <WebLogicServer> <entwl2u-vm.co.pinellas.fl.us> <Pinellas1uCluster1MS2> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1329928808790> <BEA-000256> <Invoking oracle.core.ojdl.weblogic.ODLConfiguration.main(null)>
####<Feb 22, 2012 11:40:17 AM EST> <Info> <WebLogicServer> <entwl2u-vm.co.pinellas.fl.us> <Pinellas1uCluster1MS2> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1329928817314> <BEA-000256> <Invoking oracle.jrf.AppContextStartup.main(null)>
####<Feb 22, 2012 11:40:17 AM EST> <Info> <WebLogicServer> <entwl2u-vm.co.pinellas.fl.us> <Pinellas1uCluster1MS2> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1329928817318> <BEA-000256> <Invoking oracle.as.jmx.framework.wls.spi.StartupListener.main(null)>
####<Feb 22, 2012 11:40:17 AM EST> <Info> <WebLogicServer> <entwl2u-vm.co.pinellas.fl.us> <Pinellas1uCluster1MS2> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1329928817432> <BEA-000256> <Invoking oracle.j2ee.ws.server.WebServiceServerStartup.main(null)>
####<Feb 22, 2012 11:40:17 AM EST> <Info> <WebLogicServer> <entwl2u-vm.co.pinellas.fl.us> <Pinellas1uCluster1MS2> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1329928817492> <BEA-000256> <Invoking oracle.ias.cache.Startup.main(null)>
####<Feb 22, 2012 11:40:17 AM EST> <Info> <WebLogicServer> <entwl2u-vm.co.pinellas.fl.us> <Pinellas1uCluster1MS2> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1329928817493> <BEA-000256> <Invoking oracle.dms.wls.DMSStartup.main(null)>
####<Feb 22, 2012 11:40:18 AM EST> <Info> <Management> <entwl2u-vm.co.pinellas.fl.us> <Pinellas1uCluster1MS2> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1329928818207> <BEA-141278> <Java entropy configuration is: System property "java.security.egd= null"; JRE's java.security file property "securerandom.source= file:/dev/urandom"; Blocking Config= false; JDK version= 1.6.0_26; Operating System= Linux.>
####<Feb 22, 2012 11:40:48 AM EST> <Info> <WebLogicServer> <entwl2u-vm.co.pinellas.fl.us> <Pinellas1uCluster1MS2> <[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1329928848987> <BEA-000256> <Invoking oracle.security.audit.ajl.loader.JEEAuditLoader.main(null)>Hi John,
This is Ok. Those are just info messages. Thery are not warnings or errors, so nothing to worry about.
If the classes are invoked with null arguments and no exception is thrown, then is means that the class is able to have a null argument, so nothing to worry about again.
Regards,
Cris -
How do I get the JAAS Subject for an authenticated user?
Hi
I searched through the site, but didn't find anything useful.
I came across many instances of using the javax.security.auth.login.LoginContext
to get the Subject, but am not sure how to get a handle for it, after the login process is completed and the usre is authenticated.
RG.WLS has a static method for returning the javax.security.auth.Subject :
http://e-docs.bea.com/wls/docs81/javadocs/weblogic/security/Security.html#getCurrentSubject() -
Failed to invoke startup class "MyStartup Class"
Hi,
I configured StartUpClass.java in Weblogic server through Admin Console . Also I set the required jar files in the classpath of the server in WL_HOME\server\bin\startWLS.cmd.
This StartUPClass is written to initialize and create the minimum number of objects in the pool, needed for URLConnection using ObjectPooling API.
I am getting Exceptions while starting the server after deployment of the application. I am pasting the full stack trace.
<Feb 1, 2007 9:49:55 AM IST> <Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with Java HotSpot(TM) Client VM Version 1.4.2_12-b03 from Sun Microsystems Inc.>
<Feb 1, 2007 9:50:10 AM IST> <Info> <Configuration Management> <BEA-150016> <This server is being started as the administration server.>
<Feb 1, 2007 9:50:10 AM IST> <Info> <Management> <BEA-141107> <Version: WebLogic Server 8.1 SP4 Mon Nov 29 16:21:29 PST 2004 471647
WebLogic XMLX Module 8.1 SP4 Mon Nov 29 16:21:29 PST 2004 471647 >
<Feb 1, 2007 9:50:11 AM IST> <Notice> <Management> <BEA-140005> <Loading domain configuration from configuration repository at D:\bea\user_projects\domains\nessdomain\.\config.xml.>
<Feb 1, 2007 9:50:15 AM IST> <Notice> <Log Management> <BEA-170019> <The server log file D:\bea\user_projects\domains\nessdomain\myserver\myserver.log is opened. All server side log events will be written to this file.>
<Feb 1, 2007 9:50:18 AM IST> <Notice> <Security> <BEA-090082> <Security initializing using security realm myrealm.>
<Feb 1, 2007 9:50:18 AM IST> <Notice> <WebLogicServer> <BEA-000327> <Starting WebLogic Admin Server "myserver" for domain "nessdomain">
<Feb 1, 2007 9:50:31 AM IST> <Warning> <HTTP> <BEA-101248> <[Application: 'D:\MSM\Workspace\MSM2.0Jan9', Module: 'MSM31']: Deployment descriptor "web.xml" is malformed. Check against the DTD: org.xml.sax.SAXParseException: The content of element type "web-app" must match "(icon?,display-name?,description?,distributable?,context-param*,filter*,filter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-local-ref*)". (line 96, column 11).>
<Feb 1, 2007 9:50:31 AM IST> <Warning> <HTTP> <BEA-101248> <[Application: 'D:\MSM\Workspace\MSM2.0Jan9', Module: 'MSM31']: Deployment descriptor "weblogic.xml" is malformed. Check against the DTD: org.xml.sax.SAXParseException: The content of element type "weblogic-web-app" must match "(description?,weblogic-version?,security-role-assignment*,run-as-role-assignment*,reference-descriptor?,session-descriptor?,jsp-descriptor?,auth-filter?,container-descriptor?,charset-params?,virtual-directory-mapping*,url-match-map?,preprocessor*,preprocessor-mapping*,security-permission?,context-root?,wl-dispatch-policy?,servlet-descriptor*,init-as*,destroy-as*)". (line 23, column 20).>
<Feb 1, 2007 9:50:35 AM IST> <Critical> <WebLogicServer> <BEA-000286> <Failed to invoke startup class "MyStartup Class", java.lang.ClassNotFoundException: com.helio.msm.ws.util.StartUpClass
java.lang.ClassNotFoundException: com.helio.msm.ws.util.StartUpClass
at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at weblogic.t3.srvr.StartupClassService.invokeClass(StartupClassService.java:156)
at weblogic.t3.srvr.StartupClassService.access$000(StartupClassService.java:36)
at weblogic.t3.srvr.StartupClassService$1.run(StartupClassService.java:121)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.t3.srvr.StartupClassService.invokeStartupClass(StartupClassService.java:116)
at weblogic.t3.srvr.PostDeploymentStartupService.resume(PostDeploymentStartupService.java:63)
at weblogic.t3.srvr.SubsystemManager.resume(SubsystemManager.java:131)
at weblogic.t3.srvr.T3Srvr.resume(T3Srvr.java:966)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:361)
at weblogic.Server.main(Server.java:32)
>
<Feb 1, 2007 9:50:36 AM IST> <Error> <Socket> <BEA-000438> <Unable to load performance pack. Using Java I/O instead. Please ensure that wlntio.dll is in: 'D:\j2sdk1.4.2_12\bin;.;C:\WINDOWS\system32;C:\WINDOWS;D:\j2sdk1.4.2_12\bin;c:\windows\system32;C:\apache-ant-1.6.5\bin;'
>
<Feb 1, 2007 9:50:36 AM IST> <Notice> <WebLogicServer> <BEA-000331> <Started WebLogic Admin Server "myserver" for domain "nessdomain" running in Development Mode>
<Feb 1, 2007 9:50:36 AM IST> <Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode>
<Feb 1, 2007 9:50:36 AM IST> <Notice> <WebLogicServer> <BEA-000355> <Thread "ListenThread.Default" listening on port 7001, ip address *.*>
<Feb 1, 2007 9:50:55 AM IST> <Warning> <Socket> <BEA-000402> <There are: 5 active sockets, but the maximum number of socket reader threads allowed by the configuration is: 4. You may want to alter your configuration.>
Please help me in resolving this problem. I need it asap
Thanks,
DharaniI should be more specific and have a bit more to add....
We have our app in an .ear file. I find that when I put the startup
classes in a seperate directory which is in the classpath specified in the
startWeblogic.cmd file they will be run on startup. I don't think I should
have to do this since these files exist in the ear file. I think this is
causing other problems too such as an illegalAccessError I get when an EJB
tries to load a class which was previously accessed by the startup classes.
Thanks,
Steve
Steve Snodgrass wrote:
Hi,
I am beggining to upgrade our app from Weblogic 5.1 to 6.0. So far it
has been progressing nicely and everything works with one exception. I
can not get the start up classes to run. I get the following exception:
<Failed to invoke startup class "MyStartup Class",
java.lang.ClassNotFoundException:
followed by my fully qualified class name. The class is reference
elsewhere in the code and works fine. Is a seperate classpath used for
startup classes? If not why might Weblogic have a hard time finding my
class?
Thanks,
Steve -
Startup Classes and JMS - Suggestions Please!
I'm in serious need of having several resources initialized before beans
start handling requests.
I tried implementing a Weblogic Startup Class, and it works fine - as long
as it's the first thing
to run! -- the problem is, when my Message Driven Beans deploy, if there are
messages waiting
for them in their durable subscriptions, they immediately start
processing... then about 30 seconds
later Weblogic (6.0sp1) gets around to starting my startup class. If I put
code in each MDB that
kicks off the initialization when they are invoked I still run into
problems, because my initialization
takes a LONG time (more than 2 minutes) - so I end up with lots of
transaction rollbacks... which
are very annoying and clutter up the log files, and scare customers of the
product.
Is there anyway to make a startup class/servlet/something that runs and
completes before any
other processing occurs?
Thanks,
JamesYes, Startup servlet has the same problem - it doesn't 'startup' until after
jms messages are already being delivered. :( aside from this, there are
class loader issues -servlet space and ejb space are not the same...
Thanks though,
James
"minjiang" <[email protected]> wrote in message
news:[email protected]...
Hi, did you ever try startup servlet? not startup class?
mj
James House wrote:
The only problem with creating a base class to extend is the fact that
Java only supports single inheritance, -- and I'm already inheriting...
>>
I've been involved with many projects that use WLServer, and in
almost every one of them, there has been a need for a startup class
that fires before the server starts handling requests.... strange that
I'd be the only one to need this, when the need has recurred so often.
James
"Raja Mukherjee" <[email protected]> wrote in message
news:[email protected]...
James,
If you have common initialization tasks to be shared by multiple MDBs,
I
would create an abstract class (a.k.a BeanAdapter class) where you canhave
all your initialization logics and have your MDB extend from it.
I am not convinced that the Startup class needs to run first. In fact,
I
have the same view that Startup class should run last. My only wishlist
for
startup class was that I should be able to specify order, which isaddressed
in 6.1.
I am also getting the feeling from different posts that MDB deploymentwould
have a re-try logic in 6.1, which I am beginning to look into. Check
(or
post) in JMS news group.
.raja
"James House" <[email protected]> wrote in message
news:[email protected]...
Thanks for the help... I like the pattern you pointed me to better
than
anything else... ... but in all cases (your method, Gene's, and whatI'm
currently doing) I still have to put some code in every MDB that
I deploy... : (
Put in a good word for me there at BEA and convince the appropriate
developer that startup classes should run first!
James
"Raja Mukherjee" <[email protected]> wrote in message
news:[email protected]...
James,
There are several ways to solve your problem. I normally use
setMessageDrivenContext to do all my initialization. There are two
types
of
initialization that I have performed here, first, reading theconfiguration
file and then load some utility classes in specific order. The
problem
with
the second was that you will have to use synchronized block
w/HotSpot
2.0
to
keep the order, which is ok. I don't use static block to do the
initialization, instead use an init() metod. Hopefully you got the
idea.
Recently, Gene Chuang created a pattern which esentially does the
same
and
I
liked the pattern because it was a nicer way of doing what I
needed to
do.
I
have changed all my examples to customer to use the new pattern.
You
can
find it in
http://theserverside.com/patterns/thread.jsp?thread_id=7270.
The
only think I do not use of this pattern is
initializeEveryContextSwap()
method. I am not convinced yet that I would need it (of course
that
might
change over the time).
Hope this helps, and thanks Gene.
.raja
"James House" <[email protected]> wrote in message
news:[email protected]...
Ok... here's some more detail:
The application is largely JMS based, and most of my Session
EJBs
are
invoked only my Message Driven Beans.
I have a large set of properties that need to be read from a
config
file,
and stored somewhere "globally". I also have a number of
utilities
that
need to get "warmed up" before I start doing any real processing(before
I start receiving messages from the JMS Topics). These
utilities
take
a
long time to warm up (a long time being about 45-60 seconds) -
because
they are loading hundereds of classes, and creating variousconnections
to external resources.
Currently I'm creating a Singleton object that reads the
configuration
file
name from an environment property, and it then parses the file,
and
starts
configuring all of these utilities. Since the "Startup Class"
didn't
work
(weblogic invokes it after I'm already receiving messages), I
put
code
at
the beginning of all of my MDB's onMessage() methods that calls
the
singleton's "getInstance()" method - which synchronizes on alock
object,
and does all of it's work.
I don't like this solution because:
1- I have to put code in EVERY message-driven bean that I
create -
if
I
forget one, everything is broken.
2- I have to increase the transaction time out of the entire
server
to
be over 60 seconds since the beans hang that long while theconfiguration
is
happening.
It seems very obvious that a "Startup Class" should be invoked
after
the
server has come completely up, but before it starts listening
for
requests -- isn't the whole point of a "startup class" to getthings
ready
that need to be done as soon as the server comes up? but alas,
the
person
who designed this at BEA apparently didn't agree with me on this
point!
Any suggestion on better solutions would be greatly appreciated.
James
"Raja Mukherjee" <[email protected]> wrote in message
news:[email protected]...
You can do it this way, but I would not recommend it, unless
that's
the
only
way to attack the problem at hand. But that's just me.
I have seen this problem with multiple clients and in most
cases
there
is
a
better way to handle it. If James give us a little more
information
on
what
type of configuration is he talking about and some background
of
his
application, we as a group can think and may be able to come
up
with
some
idea.
.raja
"Joel Nylund" <[email protected]> wrote in message
news:[email protected]...
you could wrap the starting of weblogic in your own class
and do
initialization
there. You have to be careful because of the way weblogic
classloaders
work, but
you may be able to do what you want. Weblogic is just a java
class,
so
you
can
start your class, then once your done initializing, just
call
weblogic.Server.main
-Joel
James House wrote:
I'm in serious need of having several resources
initialized
before
beans
start handling requests.
I tried implementing a Weblogic Startup Class, and it
works
fine -
as
long
as it's the first thing
to run! -- the problem is, when my Message Driven Beans
deploy,
if
there
are
messages waiting
for them in their durable subscriptions, they immediately
start
processing... then about 30 seconds
later Weblogic (6.0sp1) gets around to starting my startupclass.
If
I
put
code in each MDB that
kicks off the initialization when they are invoked I still
run
into
problems, because my initialization
takes a LONG time (more than 2 minutes) - so I end up with
lots
of
transaction rollbacks... which
are very annoying and clutter up the log files, and scarecustomers
of
the
product.
Is there anyway to make a startup class/servlet/something
that
runs
and
completes before any
other processing occurs?
Thanks,
James -
StartUp Class in WLS 6.0
Hi,
I am beggining to upgrade our app from Weblogic 5.1 to 6.0. So far it
has been progressing nicely and everything works with one exception. I
can not get the start up classes to run. I get the following exception:
<Failed to invoke startup class "MyStartup Class",
java.lang.ClassNotFoundException:
followed by my fully qualified class name. The class is reference
elsewhere in the code and works fine. Is a seperate classpath used for
startup classes? If not why might Weblogic have a hard time finding my
class?
Thanks,
SteveI should be more specific and have a bit more to add....
We have our app in an .ear file. I find that when I put the startup
classes in a seperate directory which is in the classpath specified in the
startWeblogic.cmd file they will be run on startup. I don't think I should
have to do this since these files exist in the ear file. I think this is
causing other problems too such as an illegalAccessError I get when an EJB
tries to load a class which was previously accessed by the startup classes.
Thanks,
Steve
Steve Snodgrass wrote:
Hi,
I am beggining to upgrade our app from Weblogic 5.1 to 6.0. So far it
has been progressing nicely and everything works with one exception. I
can not get the start up classes to run. I get the following exception:
<Failed to invoke startup class "MyStartup Class",
java.lang.ClassNotFoundException:
followed by my fully qualified class name. The class is reference
elsewhere in the code and works fine. Is a seperate classpath used for
startup classes? If not why might Weblogic have a hard time finding my
class?
Thanks,
Steve -
Startup Classes w/ Arguments and Startup Order
Hi,
I know we can control the order of startup classes by specifying them in a
comma delimited list like this:
weblogic.system.startupClass.a=class1,class2,class3
Now what if class1 and class2 have several startup arguments that I need to
pass??? I would hate to think that I'll have to write my own startup
manager just to do this one simple thing?
So... if anyone knows how to specify startup arguments AND control the order
of startup classes please let me know...
Thanks in advance,
Stephen Earl
SmartPoint, Inc.Hi Don,
I've attempted to mirror the functionality of the Weblogic startup system
with no success. Basically I have an xml document specifying the startup
specifications much like the WL startup system (ie. Description, ClassName,
Args). To mirror the WL system I apparently need access to StartupThread
which, like most other WL classes, is undocumented and unexposed for use.
How would you suggest implementing such functionality??? Considering that
I'd like to have similar functionality to the current system (ie.
T3StartupDefs, RMI Servers, etc.) how can I and any other BEA customer
achieve this short of rewriting the startup mechanism???
Stephen Earl
SmartPoint, Inc.
"Don Ferguson" <[email protected]> wrote in message
news:[email protected]...
I have looked over the source code for startup classes and how thearguments
are processed, and I'm afraid I don't see any mechanism to accomplish what
you want, i.e., to specify the order that startup classes are executed,
and provide names-value pairs that are associated with each class.
You might have to come up with your own mechanism for associating
arguments with startup classes.
Anne-Katrin Schroeder-Lanz wrote:
well, if you absolutely must have identically named args for each class,
then you're stumped. should you be able to extract any kind of support
from
BEA here, I'd appreciate a notification, since we've got the sameproblem to
deal with.
happy hacking, anne
Anne-Katrin Schroeder-Lanz
Development
memIQ AG
T: +49-89-45639-19385
F: +49-89-45639-33-385
mailto:[email protected]
"Stephen Earl" <[email protected]> wrote in message
news:[email protected]...
OK... and now say that I have a startup argument called RETRIES. This
argument needs to be 10 for startup class A and 20 for startup class
B.
Now
way I can see to handle this situation.
BEA... I've logged a production 3 case regarding this issue and have
not
even received an initial response from support. Hello... Hello...
Steve...
"Anne-Katrin Schroeder-Lanz" <[email protected]> wrote in message
news:[email protected]...
hi,
just use the startArgs as documented on the list of startup classes
and
pass
a collective list of args, e.g.:
weblogic.system.startupClass.<logical_name>= xxx.yyy.Foo,
xxx.yyy.Bar
weblogic.system.startupArgs.<logical_name>= arg4Foo=some_value,
arg4Bar=another_value
hth,
cheers, anne
Anne-Katrin Schroeder-Lanz
Development
memIQ AG
T: +49-89-45639-19385
F: +49-89-45639-33-385
mailto:[email protected]
"Stephen Earl" <[email protected]> wrote in message
news:[email protected]...
Hi,
I know we can control the order of startup classes by specifying
them
in
a
comma delimited list like this:
weblogic.system.startupClass.a=class1,class2,class3
Now what if class1 and class2 have several startup arguments that
I
need
to
pass??? I would hate to think that I'll have to write my own
startup
manager just to do this one simple thing?
So... if anyone knows how to specify startup arguments AND controlthe
order
of startup classes please let me know...
Thanks in advance,
Stephen Earl
SmartPoint, Inc. -
Startup class not found if included in a jar inside the ear
I have written a startup class, i have packed it in a jar file(along with some
other classes). This jar is then packed in side an ear file.(This way i get one
single distribution file). I have added the startup class in the config.xml using
weblogic console.But at start up weblogic is unable to find the class. How to
tell weblogic about the location of the class(classpath) which is inside the ear
file. Error i get is as follows
<Aug 21, 2003 8:07:23 PM IST> <Emergency> <WebLogicServer> <BEA-000342> <Unable
to initialize the server: weblogic.t3. srvr.FatalStartupException: Can't start
server due to startup class failure WISORCODES_SERVER - with nested exception:
[java.lang.ClassNotFoundException: com.wisor.common.wisorcodes.rmi.WisorCodesServer]>
*************************************************************************** The
WebLogic Server did not start up properly. Exception raised: 'weblogic.t3.srvr.FatalStartupException:
Can't start server due to startup class failure WISORCODES_ SERVER - with nested
exception: [java.lang.ClassNotFoundException: com.wisor.common.wisorcodes.rmi.WisorCodesServer]'
Reason: weblogic.t3.srvr.FatalStartupException: Can't start server due to startup
class failure WISORCODES_SERVER - wi th nested exception: [java.lang.ClassNotFoundException:
com.wisor.common.wisorcodes.rmi.WisorCodesServer] ***************************************************************************Shirish:
Classes that are scoped in the application are only visible within the
application, not to the system classloader.
If you want to have startup classses scoped inside an EAR then you need to
use Application lifecycle listeners to actually activate these startup
classes. Application lifecycle listeners are a replacement for startup
classes.
You can check out an example of this in 8.1:
$BEA_HOME/weblogic81/samples/server/examples/src/examples/splitdir/helloWorl
dEar
Docs for it are:
$BEA_HOME\weblogic81\samples\server\examples\src\examples\splitdir\helloWorl
dEar\javadoc\index.html
Check out:
$BEA_HOME\weblogic81\samples\server\examples\src\examples\splitdir\helloWorl
dEar\META-INF\weblogic-applcation.xml
<weblogic-application>
<listener>
<listener-class>examples.splitdir.hello.startup.ApplicationStartup</listener
-class>
</listener>
</weblogic-application>
and
$BEA_HOME\weblogic81\samples\server\examples\src\examples\splitdir\helloWorl
dEar
/appStartup/examples/splitdir/hello/startup/ApplicationStartup.java
Now if you have a "startup class" that needs to be accessible for the entire
Server for a set of applications, I suggest just writing a single EAR with a
dummy web-app (I think you may need a dummy module) and an applicaiton
lifecycle listener, and have this EAR deploy before any other apps.
Cheers
mbg
"Shirish" <[email protected]> wrote in message
news:[email protected]...
>
I have written a startup class, i have packed it in a jar file(along withsome
other classes). This jar is then packed in side an ear file.(This way iget one
single distribution file). I have added the startup class in theconfig.xml using
weblogic console.But at start up weblogic is unable to find the class. Howto
tell weblogic about the location of the class(classpath) which is insidethe ear
file. Error i get is as follows
<Aug 21, 2003 8:07:23 PM IST> <Emergency> <WebLogicServer> <BEA-000342><Unable
to initialize the server: weblogic.t3. srvr.FatalStartupException: Can'tstart
server due to startup class failure WISORCODES_SERVER - with nestedexception:
>
>
[java.lang.ClassNotFoundException:com.wisor.common.wisorcodes.rmi.WisorCodesServer]>
>
The
WebLogic Server did not start up properly. Exception raised:'weblogic.t3.srvr.FatalStartupException:
Can't start server due to startup class failure WISORCODES_ SERVER - withnested
exception: [java.lang.ClassNotFoundException:com.wisor.common.wisorcodes.rmi.WisorCodesServer]'
Reason: weblogic.t3.srvr.FatalStartupException: Can't start server due tostartup
class failure WISORCODES_SERVER - wi th nested exception:[java.lang.ClassNotFoundException:
com.wisor.common.wisorcodes.rmi.WisorCodesServer]***************************************************************************
>
>
>
>
>
>
>
>
>
>
> -
Class not found exception for the startup class defined.
iam using weblogic server 10 and bea jrockit 1.5.0.12.
i have created a startup class in the admin console for a web project and i have deployed the war file using the console in a user defined domains, user project directory.
when i start the server, iam getting class not found exception for the startup class.
But, the startup class is available in the web archive (war). how should we add the classes and jars in the war to the classpath in setDomainEnv.sh or is there any other setting available in the console to enable this.Hello Julius,
yes sure, we can move this post to the NW admin forum. I have already posted similar thread on sun forums. I was hoping that someone from SAP SDN already tackled this problem and if not someone specialized in J2EE Engine could troubleshoot me from the class problem I'm getting. I don't know if it's specific from the agent or if this ClassNotFound is a general SAP J2EE Engine error relating to a library not correclty defined.
Kind regards,
Tanguy Mezzano -
Startup class : Context lookup for a Home fails in a new thread
Hi All,
I am having a funny problem with Weblogic Startup class.In the startup method,
I am creating an instance of InitialContext. I called look up in this context
for a bean's home. It works and it retuns the proper Home interface.
But, when I use the same InitialContext instance in a new thread, and again if
I call look up for the same bean's home, the server fails with a SecurityException.
I don't have any Role based Security for this bean.
Btw, I am using Weblogic 5.1 & SP7.
Any ideas or help, appreciated..
Thanks in Advance
Srikanth Goli
Here is the code.
public String startup(String name, Hashtable args) throws Exception {
InitialContext initialContext = null;
try {
initialContext = new InitialContext();
UserPreferencesHome userPreferencesHome =
(UserPreferencesHome)initialContext.lookup
(UserPreferencesHome.DEFAULT_URL);
//This prints Properly
System.err.println("StartupTest: userPrefsHome is " + userPreferencesHome);
} catch(Exception e) {
e.printStackTrace();
Thread th = new Thread(new TestThread(initialContext));
th.start();
return "ok";
class TestThread implements Runnable {
Context context;
public TestThread(InitialContext ctx) {
context = ctx;
public void run() {
try {
//This is failing
UserPreferencesHome userPreferencesHome1 =
(UserPreferencesHome)context.lookup
(UserPreferencesHome.DEFAULT_URL);
System.err.println("UserPreferencesHome1 in the thread is " + userPreferencesHome1);
} catch(Exception e) {
e.printStackTrace();
Here is the exception, I am getting
java.lang.SecurityException: User "guest" does not have Permission "lookup" base
d on ACL "weblogic.jndi.com.capgroup.btps".
at weblogic.security.acl.Security.logAndThrow(Security.java:372)
at weblogic.security.acl.Security.checkPermission(Security.java:254)
at weblogic.jndi.internal.NamingSecurityManagerImpl.checkPermission(Nami
ngSecurityManagerImpl.java:98)
at weblogic.jndi.internal.NamingSecurityManagerImpl.checkLookup(NamingSe
curityManagerImpl.java:45)
at weblogic.jndi.toolkit.BasicWLContext.resolveName(BasicWLContext.java:
737)
at weblogic.jndi.toolkit.BasicWLContext.lookup(BasicWLContext.java:133)
at weblogic.jndi.toolkit.BasicWLContext.lookup(BasicWLContext.java:574)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at com.capgroup.btps.server.TestThread.run(StartupTest.java:49)
at java.lang.Thread.run(Thread.java:484)Hi All,
I am having a funny problem with Weblogic Startup class.In the startup method,
I am creating an instance of InitialContext. I called look up in this context
for a bean's home. It works and it retuns the proper Home interface.
But, when I use the same InitialContext instance in a new thread, and again if
I call look up for the same bean's home, the server fails with a SecurityException.
I don't have any Role based Security for this bean.
Btw, I am using Weblogic 5.1 & SP7.
Any ideas or help, appreciated..
Thanks in Advance
Srikanth Goli
Here is the code.
public String startup(String name, Hashtable args) throws Exception {
InitialContext initialContext = null;
try {
initialContext = new InitialContext();
UserPreferencesHome userPreferencesHome =
(UserPreferencesHome)initialContext.lookup
(UserPreferencesHome.DEFAULT_URL);
//This prints Properly
System.err.println("StartupTest: userPrefsHome is " + userPreferencesHome);
} catch(Exception e) {
e.printStackTrace();
Thread th = new Thread(new TestThread(initialContext));
th.start();
return "ok";
class TestThread implements Runnable {
Context context;
public TestThread(InitialContext ctx) {
context = ctx;
public void run() {
try {
//This is failing
UserPreferencesHome userPreferencesHome1 =
(UserPreferencesHome)context.lookup
(UserPreferencesHome.DEFAULT_URL);
System.err.println("UserPreferencesHome1 in the thread is " + userPreferencesHome1);
} catch(Exception e) {
e.printStackTrace();
Here is the exception, I am getting
java.lang.SecurityException: User "guest" does not have Permission "lookup" base
d on ACL "weblogic.jndi.com.capgroup.btps".
at weblogic.security.acl.Security.logAndThrow(Security.java:372)
at weblogic.security.acl.Security.checkPermission(Security.java:254)
at weblogic.jndi.internal.NamingSecurityManagerImpl.checkPermission(Nami
ngSecurityManagerImpl.java:98)
at weblogic.jndi.internal.NamingSecurityManagerImpl.checkLookup(NamingSe
curityManagerImpl.java:45)
at weblogic.jndi.toolkit.BasicWLContext.resolveName(BasicWLContext.java:
737)
at weblogic.jndi.toolkit.BasicWLContext.lookup(BasicWLContext.java:133)
at weblogic.jndi.toolkit.BasicWLContext.lookup(BasicWLContext.java:574)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at com.capgroup.btps.server.TestThread.run(StartupTest.java:49)
at java.lang.Thread.run(Thread.java:484) -
How to implement Startup class for OC4J
I'm in the process of converting my current J2EE application from weblogic 5.1 to OC4J.
I have startup class that would set application specific properties by reading property file. In addition, this class would also check for certain resource availability (like database) during weblogic startup. I could not find similar option in OC4J.
Any help to convert this startup class for OC4J would be highly appreciated.
Thanks
Sankaran.Hi Sankaran,
Your eMail address suggests you work for Oracle. Do you? Can't someone
at Oracle help you?
I imagine that Oracle would have some kind of agreement with Ironflare
as well. Can't someone at Ironflare help you?
But remember, with application servers (as with RDBMSs), no two are the
same. Each one offers the same functionality, but using different methods
to achieve that functionality. I don't know how to do it, but I'm sure
you can check database availability when starting up OC4J -- just not
the same way you do it in Weblogic.
Good Luck,
Avi.
Maybe you are looking for
-
How to update content of a file on server using a Java Applet?
Hi, I'm new to Java, and I have a task now to overwrite a text file on a server using an applet. I have written a piece of code which compiles but doesn't work. Can you please take a look at the code or give me another way to do it? Thanks. Code: imp
-
I am having trouble keeping a live stream working. I am streaming live video & audio using FMLE 3.2 and FMIS 3.5.5. When I start the encoder things appear okay at first - no apparent error messages at the encoder, and multiple clients can connect su
-
TAXINN- posting a sales entry from FI using out put tax code
Hi This client requires TAXINN and need to post a simple sales entry from FI ie cusotmer Dr Sales Cr and Sales Tax Cr. Can any one tell whether this is possible? If so, how. thanks a lot Sridevi
-
Need to install ORACLE 9i on solaris x86
Hi All, Can anyone tell me where I can get DB Oracle 9i for Solaris x86? If not, what can I use? Thanks. Marfy
-
I can't use the 4.0 without intel, how long can I use the older version?
My Mac is an OS X version 10.5.8 without intel. How long will I be able to use the Firefox 3.6 and what will happen if no longer supported....no more Firefox for me?