Weblogc - Deploy Jar File
Well kind of a crazy question and I may be off my rocker but here it goes. I have a Java project that is NOT and web application. It is basically a service that right now is started using the main method and a Spring Application context.
My desire in deploying this service into a Web Logic container is to have all the features that come with such a deployment, mainly JNDI datasources, etc.
So with t开发者_JAVA技巧hat said....am I crazy or is this even possible?
If the datasources are really all that you want, you can fetch weblogic initial context from a standalone application. Then get the pools from the context..
Hashtable<String, String> env = new Hashtable<String, String>();
env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
env.put(Context.PROVIDER_URL, "http://<host>:<port>");
env.put(Context.SECURITY_CREDENTIALS, <foo>);
env.put(Context.SECURITY_PRINCIPAL, <bar>);
InitialContext ic = new InitialContext(env);
精彩评论