DataSource information in Startup Class
Hi,
I have a startup class and I want to access the database using jdbc and get connection
using the datasource. In case of an EJB, the jndi name and datasource name can be
specified in the deployment descriptor. Is there a way to specify this information
in a startup class?
Thanks,
Patrick
Hi Patric,
You may use custom -Dmy.env.param=my.env.value when start
weblogic. Then you can use standart Java API to access system properties.
Regards,
Slava Imeshev
"Patrick" <[email protected]> wrote in message
news:3d2d241e$[email protected]..
>
Hi Sree,
Thanks. Actually, I do have a data access class which does thedatasource lookup
and gets the connection. The startup class just calls the methods in thisclass.
I would like to have the DSN string as an enviroment variable in thestartup class
which can then be accessed in the data access class, something like this
String dsn = "java:comp/env/jdbc/myds"
Any ideas on how to achieve this?
Thanks,
Patrick
"Sree Bodapati" <[email protected]> wrote:
Hi Patrick
here is how you do it.
import java.util.Hashtable;
import java.sql.*;
import javax.sql.*;
import javax.naming.*;
import weblogic.common.*;
import weblogic.jndi.*;
public class DoSQLStartup implements T3StartupDef {
private T3ServicesDef services;
public void setServices(T3ServicesDef services) {
this.services = services;
public String startup(String name, Hashtable args) throws Exception {
// Write your startup code here...
Context ctx = new InitialContext();
DataSource myds = (DataSource)ctx.lookup("myDataSource");
Connection conn = myds.getConnection();
System.out.println("Got connection!!!!!!!!!!!!!!!!!!!!");
// do some db work here
return "ok";
hth
sree
"Patrick" <[email protected]> wrote in message
news:3d2c7435$[email protected]..
Hi,
I have a startup class and I want to access the database using jdbcand get connection
using the datasource. In case of an EJB, the jndi name and datasourcename
can be
specified in the deployment descriptor. Is there a way to specify thisinformation
in a startup class?
Thanks,
Patrick
Similar Messages
-
OC4J Server startup classes and JNDI
Hi,
I have been using server startup classes in standalone OC4J provided with BPEL developer install to populate data from the server.xml into the JNDI server.
Now I am deploying the BP to 10gAS and am unable to identify the configuration files that affect the contents of the JNDI server which is accessible from BPEL.
Can anyone advise?
Thanks,
TobyClemens,
What we would like to do is to lookup configuration details in OC4J's JNDI server.
As an example, we have an ftp web service that is used for functionality not available in the FTP adapters, deleting files, executing remote commands etc.
We need to store the details of ftp connections somewhere centrally, and jndi looks like a good option. Something slightly different we would like to do here is to be able to access the configuration details that the FTP Adapters use, but if that's not possible, seperate entries in the jndi server would be good.
To populate the JNDI server, we have written a server startup class which loads our custom configuration details at OC4J startup.
This works fine under the OC4J supplied with a developer install, but when we deploy our code to a full blown 10g AS we cannot access the config information. -
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 -
Signer information does not match signer information of other classes
I'm getting the exception "java.lang.SecurityException: class "javax.persistence.Cacheable"'s signer information does not match signer information of other classes in the same package". It appeared after upgrading to EclipseLink 1.2.0 - JPA 2.0 Preview. JPA 1.0 worked nicely, and I can also get the new version running by installing JPA through Eclipse. However, I want to have the JPA jar in C:\mydir\ and include it as any other jar-file. I have never signed an application before and this exception doesn't really tell me what to do next.
Any help appreciated.
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'forgotPwdController': Autowiring of fields failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.daisy.pipeonline.services.UserManager org.daisy.pipeonline.web.ForgotPwdController.userMan; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userManager' defined in URL [jar:file:/C:/Users/jostein.NLB/workspaces/pipeonline/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/pipeonline-web/WEB-INF/lib/pipeonline-core.jar!/META-INF/config/services-config.xml]: Cannot resolve reference to bean 'userDao' while setting bean property 'dao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDao': Injection of persistence fields failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in URL [jar:file:/C:/Users/jostein.NLB/workspaces/pipeonline/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/pipeonline-web/WEB-INF/lib/pipeonline-core.jar!/META-INF/config/datalayer-config.xml]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: Exception [EclipseLink-28018] (Eclipse Persistence Services - 1.2.0.v20091016-r5565): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit [jpa] failed.
Internal Exception: java.lang.SecurityException: class "javax.persistence.Cacheable"'s signer information does not match signer information of other classes in the same package
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessAfterInstantiation(AutowiredAnnotationBeanPostProcessor.java:243)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:959)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3934)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4429)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)I don't know. You said that you got the problem when you upgraded "EclipseLink 1.2.0 - JPA 2.0 Preview", so it's possible that you should ask the guys who did that package.
-
How can I ensure the execution order of startup classes?? I want to run startupclass1
before startupclass2..Dimitri,
Upon second glance at my reply, I noticed I "mis-spoke" part of it. We want
the system administratord who control the directories to be able to change the
values in config.xml, not have control over the properties files.
We could use a higher priority startup-servlet for that, but then our system
administrators would have to edit the deployment descriptors of those servlets,
rebuild them, and redeploy them (and then the server has to be restarted anyway
to force all the deployed component to pick up the new values).
It just strikes me that the startup class provides this functionality much
more elegantly. They can just change the startup parameters in the console and
restart the server.
Jason
"Jason Titus" <[email protected]> wrote:
>
Dimitri,
Thanks for this information. Here are the details of my situation.
I am trying to set some values in the startup class that all applications
can
me use of, by putting them in a singleton. Currently we are using the
following
values: a directory from which configuration files can be read, a directory
into
which output files can be put.
The reason for this is that we are keeping our properties files out
of the
components so the components don't have to be rebuilt when we move from
test to
integration to production. We can simply get a different version of
the properties
files from configuration management as part of the deployment process.
This also
lets us expose just the properties files to the system administrators
who impact
those directories.
With this scheme in place, my servlet initialization can configure
itself by
loading its specific property file from the directory passed to the startup
class
based on the config.xml. Once it has the configuration, it can access
the database
and cache application general data before the first request is placed
to the servlet.
Does that sounds reasonable?
Jason
Dimitri Rakitine <[email protected]> wrote:
I think that startup classes are executed after applications etc are
deployed and
right before server starts servicing client requests.
Why do you need startup classes at all? load-on-startup servlets are
a much nicer
replacement, which solves lots of problems associated with startup classes.
Jason Titus <[email protected]> wrote:
According to this document, you should be able to set a startup deploymentorder
for your startup classes.
I have a servlet that is also initialized at startup, which seems
to
always get
initialized before the startup class methods are called. I've triedchanging
both the deployment order for the startup class in the console, aswell as the
servlet deployment descriptor value its priority. I can't get thestartup to
go first.
Any suggestions?
Thanks for your help.
Jason
"Michael Girdley" <[email protected]> wrote:
Check this out:
http://e-docs.bea.com/wls/docs61///////ConsoleHelp/startupclass.html
Michael Girdley
BEA Systems
Learning WebLogic? Buy the book:
http://www.learnweblogic.com/
At Amazon:
http://www.amazon.com/exec/obidos/ASIN/0130911119/learnweblogic/103-6817548-
3834229
"Rajan" <[email protected]> wrote in message
news:[email protected]...
How can I ensure the execution order of startup classes?? I want
to
run
startupclass1
before startupclass2..
Dimitri -
Startup class is not working in oc4j
hi
I have a servlet .In init of that servlet I will create an instance of a startup class .
In web.xml configuration I gave <load-on-startup></load-on-startup> .I created a war and an ear and deployed my application .The startup class is not called.
But when I configured the servlet in the default-web-app the startup class is running.
And furthur when I hot deploy my ear the startup class is running.
But when I restart my application server the startup class is not invoked.
can anybody help
Regards
Gajendran.Ghi
I had put auto-start=true in server.xml .then also it is not working.
when I redeploy my ear,the startup class is invoked,but when i restart the
server it does'nt
gaj -
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 -
Problems in startup class (MDB on Weblogic 7.0 / IBM MQ)
Hello friends,
I am trying to communicate with IBM MQ through Weblogic 7.0 SP2 and
using MDB.
This is a bit strange but I had to reinstall Weblogic and I tried to
deploy the Startup class . However I am getting this error:
The WebLogic Server did not start up properly.
Exception raised:
java.lang.NoSuchMethodError
at com.ibm.mq.jms.services.ConfigEnvironment.<clinit>(ConfigEnvironment.java:173)
at java.lang.Class.forName0(Native Method)
I am totally at loss to understand this as it was working before I
reinstalled the Weblogic. (Maybe I am skipping something which I had
earlier done :-().
All help appreciated.
Thanks in advance,
Milan Doshi
Since your simply running an MQ client in a startup class, you should
be able to reproduce the issue without WebLogic in the mix. Once
that is done, contact IBM for support. I continue to suspect
a command-line problem - IBM is expecting something on
the java JVM command-line that is missing.
Tom
Milan Doshi wrote:
> Hello Tom,
>
> Thanks for the reply. I did ensure that all the relevant IBM jars are
> in the classpath but I still get that error.Infact the claspath was
> allready in place.
>
> Please give me your suggestions as I am totally at sea.
>
>
> <May 23, 2003 5:31:17 PM EDT> <Emergency> <WebLogicServer> <000342>
> <Unable to initialize the server: Fatal initialization excepti
> on
> Throwable: java.lang.NoSuchMethodError
> java.lang.NoSuchMethodError
> at com.ibm.mq.jms.services.ConfigEnvironment.<clinit>(ConfigEnvironment.java:173)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:115)
> at com.ibm.mq.jms.MQConnection.<clinit>(MQConnection.java:149)
> at com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:142)
> at com.jpmc.ivr.middle.util.MQJMSStartup.startup(MQJMSStartup.java:112)
> at weblogic.t3.srvr.StartupClassService.invokeStartup(StartupClassService.java:158)
> at weblogic.t3.srvr.StartupClassService.invokeClass(StartupClassService.java:139)
> at weblogic.t3.srvr.StartupClassService.access$0(StartupClassService.java:130)
> at weblogic.t3.srvr.StartupClassService$1.run(StartupClassService.java:102)
> at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:780)
> at weblogic.t3.srvr.StartupClassService.invokeStartupClass(StartupClassService.java:97)
> at weblogic.t3.srvr.StartupClassService.initialize(StartupClassService.java:60)
> at weblogic.t3.srvr.ServerLifeCycleList.initialize(ServerLifeCycleList.java:54)
> at weblogic.t3.srvr.T3Srvr.initialize1(T3Srvr.java:782)
> at weblogic.t3.srvr.T3Srvr.initialize(T3Srvr.java:594)
> at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:282)
> at weblogic.Server.main(Server.java:32)
>
> ***************************************************************************
> The WebLogic Server did not start up properly.
>
> Thanks and regards,
>
> Milan Doshi
>
> Tom Barnes <[email protected]> wrote in message news:<[email protected]>...
>
>>Make sure that your MQ client classes are in
>>the classpath used to boot the WL JVM. If you
>>re-installed WL, and are using the installation's
>>WL boot scripts rather than your own, the JVM
>>will have a vanilla classpath - which, of course,
>>won't include IBM classes.
>>
>>Tom
>>
>>Milan Doshi wrote:
>>
>>>Hello friends,
>>>
>>>I am trying to communicate with IBM MQ through Weblogic 7.0 SP2 and
>>>using MDB.
>>>
>>>This is a bit strange but I had to reinstall Weblogic and I tried to
>>>deploy the Startup class . However I am getting this error:
>>>
>>>
>>>The WebLogic Server did not start up properly.
>>>Exception raised:
>>>java.lang.NoSuchMethodError
>>> at com.ibm.mq.jms.services.ConfigEnvironment.<clinit>(ConfigEnvironment.java:173)
>>> at java.lang.Class.forName0(Native Method)
>>>
>>>I am totally at loss to understand this as it was working before I
>>>reinstalled the Weblogic. (Maybe I am skipping something which I had
>>>earlier done :-().
>>>
>>>All help appreciated.
>>>
>>>Thanks in advance,
>>>
>>>Milan Doshi
>>
-
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 -
WLS 10.0 Mp1 - Weblogic startup class to initialize client's SSL channels
Hi,
Is it possible to use Weblogic startup class to initialize client's SSL channels?
Any pointers are appreciated.
Thanks in advance.Hey
If possible can you explain the issue in detail.
What do you mean by “initialize client's SSL channels”
Regards,
Hussain -
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] -
A startup class to enable MQ Queues to trigger MDBs in WLS 6.1(sp4)
Hi,
I am hoping for references to documentation or opinions on the following method
allowing the use of MQ queues to drive MDBs in WLS. The technique involves rebinding
the connection factory in jndi at "weblogic.jms.MessageDrivenBeanConnectionFactory"
with MQs connection factory.
I read in various newsgroup posts that replacing WLS' ConnectionFactory with MQ's
in a startup class will not allow MDBs to be linked to an MQ queue because startup
classes are run after MDB deployment during startup. However I found some unused
in-house code which appeared to do just that and it works.
Here is the code in abbreviated form:
public String startup(String str, Hashtable args) throws Exception
bindMQFactory();
bindMQQueues();
return "";
private void bindMQFactory() throws Exception
// Create MQ Factory and configure it
MQQueueConnectionFactory factory = new MQQueueConnectionFactory();
factory.setChannel(channel );
factory.setHostName(host);
factory.setPort(Integer.parseInt(port));
factory.setQueueManager(qmanager);
factory.setTransportType( JMSC.MQJMS_TP_CLIENT_MQ_TCPIP );
// bind connection factory into WLS JNDI for later use by clients
_wlsContext.bind( connectionFactoryJndi, factory );
// Force mq connection factory to be the one used for mdb's
_wlsContext.rebind("weblogic.jms.MessageDrivenBeanConnectionFactory", factory);
private void bindMQQueue() throws Exception
// create queue and configure it
MQQueue queue = new MQQueue();
queue.setTargetClient(JMSC.MQJMS_CLIENT_NONJMS_MQ );
queue.setBaseQueueName( mqQueueName );
// bind queue in WLS JNDI
_wlsContext.bind( wlsJndi, queue );
Thanks in advance for any comments or opinions on the above.
regards
Martin
Start with the white-paper:
"Using Foreign JMS Providers with WebLogic Server"
Note that to get transactional behavior you
will need to use the WebLogic Messaging Bridge feature.
Note that integrating MQ is easier in 8.1 - consider
using WL 8.1 if you can.
One more comment in-line.
Martin wrote:
> Hi,
>
> I am hoping for references to documentation or opinions on the following method
> allowing the use of MQ queues to drive MDBs in WLS. The technique involves rebinding
> the connection factory in jndi at "weblogic.jms.MessageDrivenBeanConnectionFactory"
> with MQs connection factory.
Not recommended. Highly not recommended. Do not use the same name
as the internal factory. Create your own name for a CF, and change the
weblogic ejb jar to reference your name. The above white-paper
states how to do this.
>
> I read in various newsgroup posts that replacing WLS' ConnectionFactory with MQ's
> in a startup class will not allow MDBs to be linked to an MQ queue because startup
> classes are run after MDB deployment during startup. However I found some unused
> in-house code which appeared to do just that and it works.
>
> Here is the code in abbreviated form:
> public String startup(String str, Hashtable args) throws Exception
> {
> bindMQFactory();
> bindMQQueues();
>
> return "";
> }
>
> private void bindMQFactory() throws Exception
> {
>
> // Create MQ Factory and configure it
> MQQueueConnectionFactory factory = new MQQueueConnectionFactory();
> factory.setChannel(channel );
> factory.setHostName(host);
> factory.setPort(Integer.parseInt(port));
> factory.setQueueManager(qmanager);
> factory.setTransportType( JMSC.MQJMS_TP_CLIENT_MQ_TCPIP );
>
> // bind connection factory into WLS JNDI for later use by clients
> _wlsContext.bind( connectionFactoryJndi, factory );
>
> // Force mq connection factory to be the one used for mdb's
> _wlsContext.rebind("weblogic.jms.MessageDrivenBeanConnectionFactory", factory);
> }
>
> private void bindMQQueue() throws Exception
> {
> // create queue and configure it
> MQQueue queue = new MQQueue();
> queue.setTargetClient(JMSC.MQJMS_CLIENT_NONJMS_MQ );
> queue.setBaseQueueName( mqQueueName );
>
> // bind queue in WLS JNDI
> _wlsContext.bind( wlsJndi, queue );
> }
>
> Thanks in advance for any comments or opinions on the above.
>
> regards
>
> Martin
-
How to define my startup class in an .ear package?
I am using WL6.0SP2 on solaris.
I plan to package my application as an .ear file and to put all necesarry class
files in there (it will has one .war file for the web tier and one .jar file for
the EJBs).
I want, when Weblogic loads my .ear file (i.e. my application), to execute my
special startup class, which initializes some caches, etc.
I do not want to define a startup/shutdown class in the console, because it is
only specific to my application and this startup class is not present in the weblogic
classpath during weblogic startup.
The correct place should be in application.xml, but I don't see such thing in
the DTD.
Thank you,
Ivaylo ZlatevThere is no way to do this on the EAR level - you can use load-on-startup
servlet(s) in your web component, or initial-beans-in-free-pool=1 EJB.
Ivaylo Zlatev <[email protected]> wrote:
I am using WL6.0SP2 on solaris.
I plan to package my application as an .ear file and to put all necesarry class
files in there (it will has one .war file for the web tier and one .jar file for
the EJBs).
I want, when Weblogic loads my .ear file (i.e. my application), to execute my
special startup class, which initializes some caches, etc.
I do not want to define a startup/shutdown class in the console, because it is
only specific to my application and this startup class is not present in the weblogic
classpath during weblogic startup.
The correct place should be in application.xml, but I don't see such thing in
the DTD.
Thank you,
Ivaylo Zlatev--
Dimitri -
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
-
Problems with Deployment, Startup classes and MBeanHome
Hello,
we have the following problem: How to initialize our application
correctly???
We are using MDBs as message consumers but have to guarantee the order of
incoming
messages. Due to a shortcoming in the JMS implementation (Order of
redelivered messages
is not guaranteed before WLS 8.1!!!) we are using a singleton class to keep
the health state
of the different message queues within the application (controlling whether
the MDBs are
supposed to proceed with processing or to discard any incoming messages).
Thus the MDBs
have to access this singleton, what implies latter has to be initialized
prior to the application
deployment. That's what we are using a startup class for, which is marked to
be loaded before
appplication deployment...
Fortunately the according bug is fixed with WLS 7.0.2.0, so the class is
loaded, but we are
not able to access the MBeanHome interface (We like to register MBean to
provide
adminstrative access to the health state)!!!
javax.naming.NameNotFoundException: Unable to resolve
'weblogic.management.home.localhome' Resolved: 'weblogic.management'
Unresolved:'home' ; remaining name 'home.localhome'
at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:174)
So when is the MBeanServer started???
Before application deployment??? After??? Is there any way to tell WLS not
to load the startup
class before the MBeanServer is available respectively the MBeanHome is
accessible via JNDI
but before application deployment???
Any hints are welcome!!!
Regards,
CKthis seems like a bug. the mbeanhome should be available for lookup in
startup classes. also posting to system management newsgroup.
"Carsten Kaiser" <[email protected]> wrote in message
news:[email protected]..
Hello,
we have the following problem: How to initialize our application
correctly???
We are using MDBs as message consumers but have to guarantee the order of
incoming
messages. Due to a shortcoming in the JMS implementation (Order of
redelivered messages
is not guaranteed before WLS 8.1!!!) we are using a singleton class tokeep
the health state
of the different message queues within the application (controllingwhether
the MDBs are
supposed to proceed with processing or to discard any incoming messages).
Thus the MDBs
have to access this singleton, what implies latter has to be initialized
prior to the application
deployment. That's what we are using a startup class for, which is markedto
be loaded before
appplication deployment...
Fortunately the according bug is fixed with WLS 7.0.2.0, so the class is
loaded, but we are
not able to access the MBeanHome interface (We like to register MBean to
provide
adminstrative access to the health state)!!!
javax.naming.NameNotFoundException: Unable to resolve
'weblogic.management.home.localhome' Resolved: 'weblogic.management'
Unresolved:'home' ; remaining name 'home.localhome'
at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:174)
So when is the MBeanServer started???
Before application deployment??? After??? Is there any way to tell WLS not
to load the startup
class before the MBeanServer is available respectively the MBeanHome is
accessible via JNDI
but before application deployment???
Any hints are welcome!!!
Regards,
CK
Maybe you are looking for
-
The photos in camera roll are not uploading to my photo stream.
The photos in my camera roll on my iPhone are not uploading to my Photo Stream. Both devices are logged in to the same apple account and both are connected to wifi.
-
Open in read / set save path
Hello, I would like to open an image in read only mode and then set the save path to save to a different directory, without actually saving the document. The former i can manage. When the user selects save I wish the save directory to be different fr
-
I'm running Vista 64, have Windows color scheme set to aero, not high contrast, and firefox background color is set to gray. I don't like this white font on black background I'm getting in Google and Wikipedia. These two websites are fine in explorer
-
Help please - I am getting error message 523 I also cannot connect to the desktop manager to try to fix this - it just says new device & initializing - this goes just hangs - any ideas please Solved! Go to Solution.
-
NetBeans 4.1 and projects with existing sources: NoSuchMethodError
I'm running NetBeans 4.1 with JDK 1.4.2_06 and I have a project that I've created with existing sources. I can compile everything without issues, however, when I try to run my file within the project for testing purposes, NetBeans recognizes that a m