Sample weblogic jndi.properties for 7.0...
I am looking for 2 things:
1. what weblogic jars are required on the client to make a jndi lookup ?
( jndi specific jars )
2. A sample jndi.properties file for weblogic.
Thanks
-- padhu
I use the following properties to connect to the jndi tree.
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");
env.put("java.naming.provider.url", "iiop://localhost:18002");But!
I don't see any of my jcd's when I walk this tree.
Can anyone tell me why? I'm expecting to see a list of jcds.
When I look into the sun-ejb-jar.xml file, I see that I should be able to lookup the deployed service with the following name;
ic.lookup("java:comp/env/ejb/local/stc/testHarness3Deployment1/deployedServices/CMap1_Collaboration_11")Are my assumptions correct, or is my jndi knowledge faulty?
Similar Messages
-
Why ican't I find jndi.properties for TopicConnectionFactory lookup?
I have a problem with IPlanetMessageQueue3.0 . Why i can't find jndi.properties for TopicConnectionFactory lookup ? Like this Context ctx = new
InitialContext();TopicConnectionFactory tcf = (TopicConnectionFactory)ctx.lookup("TopicConnectionFactory"); What is value of
Context.INITIAL_CONTEXT_FACTORY and Context.PROVIDER_URL ( I home jmqbroker://localhost:7676 ) for default configuration ?Have you used the object manager to create the ConnectionFactory object(s) in the JNDI store? If not, you need to use the tool to create the
object(s) and store them in the JNDI server before you may use them.
There is a simple help for this in the IPlanetMessageQueue3.0 installation bin directory. In the MQ installation bin directory, type the following
command:
imqobjmgr -H
you will get examples on how to create JNDI objects and the values that you need to set up JNDI Context. -
Hi I have installed the Logical Host of JCAPS .Also I can explore the different
MBeans of it using JConsole.
If I want to access those MBeans programmatically what would be the
JNDI properties ?
For examplke if I want to access JBoss 3.2.5 MBeans My sample code would be something like ....
InitialContext ctx = null;
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
env.put(Context.PROVIDER_URL, "jnp://localhost:1099");
env.put(Context.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces");
ctx = new InitialContext(env);
So what would be my INITIAL_CONTEXT_FACTORY,PROVIDER_URL,URL_PKG_PREFIXES etc
in this case ?
If somebody has any idea please reply . When I was working with JBoss 3.2.5, I got all the related information from JBoss Administration Guide .
Does JCAPS has any specific doc which can help me in this regard ?
Regards,
AyanI use the following properties to connect to the jndi tree.
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");
env.put("java.naming.provider.url", "iiop://localhost:18002");But!
I don't see any of my jcd's when I walk this tree.
Can anyone tell me why? I'm expecting to see a list of jcds.
When I look into the sun-ejb-jar.xml file, I see that I should be able to lookup the deployed service with the following name;
ic.lookup("java:comp/env/ejb/local/stc/testHarness3Deployment1/deployedServices/CMap1_Collaboration_11")Are my assumptions correct, or is my jndi knowledge faulty? -
Jndi.properties for WAR trouble
Hi All.
To access a remote enterprise bean, I have to populate the required JNDI properties in my web-tier code, when creating the context.
Trouble how to do this using jndi.properties file ? When I append path of file to CLASSPATH obviously it works (tested using simple session client) but when I deploy my war – properties file is invisible for my delegate. So question : How to include jndi.properties file in classpath for that WAR, or where I have to place it ?InitialContext takes care of that already.
Do you use InitialContext to connect to your own components in the same container too? If so, specify the content of jndi.properties explicitely.
--olaf -
Jndi properties for sasl, external mechanism
We're having trouble connecting to an LDAP server over SSL. We have created the client/trust keystores, but do not know what the jndi properties should be. We want the authentication to come from the certificate not simple name/password. Do we leave principals, credentials and authorizationId with null values?
If this to perform external authentication against Active Directory, have a look at the post titled "JNDI, Active Directory & Authentication (part 4) (SASL EXTERNAL)" available at
http://forum.java.sun.com/thread.jspa?threadID=641047&tstart=0
Good luck. -
Hi,
I've developed an EJB application and a WAR to access it with JBoss which uses the jndi.properties to lookup the "java.naming.provider.url". Everything works fine for now but I don't like including the jndi.properties file inside the War.
For ease of use I'd like to have as an extra deployment step so you deploy both the WAR and the jndi.properties file so I can change what server it looks at for the EJBs.
I'm sure this is simple to do through an XML file but I can't seem to find much online about how to go about it.
Could someone point me in the right direction?
Cheers,
Joe.Sorry, that was badly worded.
Basically I want to be able to do something similar to this deployment:
jboss/server/<instance>/deploy/myWebApp.war
jboss/server/<instance>/deploy/jndi.properties (for webapp)
So I can change the server listed in the jndi.properties easily.
What I have proposed above is obviously wrong as only XML and compressed files can exist in the deploy directory. This leads me to believe that there is an XML solution similar to the way DataSources can be deployed in the JBoss deploy directory.
At the moment I'm thinking about putting a homemade XML file somewhere are reading it off disk with the jndi information. I want to know if there is a more standard way of doing this.
Thanks for your response,
Joe. -
Using jndi.properties with weblogic 6.1
Apologies if this is a basic question - I am new to Weblogic.
I have successfully got a test EJB working with Weblogic 6.1 using a properties object to set up my JNDI InitialContext.
In the weblogic examples I've downloaded it says you can also use a jndi.properties file to do this. I have set up a jndi.properties file, which is in the classpath for my class calling the EJB. But when I do my jndi .lookup("ejbname") I get the error:
javax.naming.CommunicationException: Can't find SerialContextProvider
The weblogic documentation at:
http://e-docs.bea.com/wls/docs61///rmi_iiop/API_rmi_iiop.html
refers to using jndi.properties and says to look at:
http://edocs.bea.com/wls/docs61/jndi/jndi.html
But at this page there is no mention of the jndi.properties method.
I'd be grateful for any suggestions - in particular whether it is possible to use this method of configuring the JNDI setup.
I'm running wlserver6.1 on a Windows 2000 PC, using JDK 1.3.1
My jndi.properties file looks as follows:
java.naming.property.names=java.naming.factory.initial,java.naming.provider.url
java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory
java.naming.provider.url=t3://localhost:7001It is not WebLogic-specific. See
http://java.sun.com/j2se/1.3/docs/api/javax/naming/InitialContext.html
Alison Tunley <[email protected]> wrote:
Apologies if this is a basic question - I am new to Weblogic.
I have successfully got a test EJB working with Weblogic 6.1 using a properties object to set up my JNDI InitialContext.
In the weblogic examples I've downloaded it says you can also use a jndi.properties file to do this. I have set up a jndi.properties file, which is in the classpath for my class calling the EJB. But when I do my jndi .lookup("ejbname") I get the error:
javax.naming.CommunicationException: Can't find SerialContextProvider
The weblogic documentation at:
http://e-docs.bea.com/wls/docs61///rmi_iiop/API_rmi_iiop.html
refers to using jndi.properties and says to look at:
http://edocs.bea.com/wls/docs61/jndi/jndi.html
But at this page there is no mention of the jndi.properties method.
I'd be grateful for any suggestions - in particular whether it is possible to use this method of configuring the JNDI setup.
I'm running wlserver6.1 on a Windows 2000 PC, using JDK 1.3.1
My jndi.properties file looks as follows:
java.naming.property.names=java.naming.factory.initial,java.naming.provider.url
java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory
java.naming.provider.url=t3://localhost:7001--
Dimitri -
JNDI lookup for weblogic.management.MBeanHome
Tried to do JNDI lookup for MBeanHome. It could resolve
weblogic.management, but not MBeanHome.
Any idea? Thank you
T. Pei
PS
The statement and the error message:
MBeanHome mBeanHome = (MBeanHome) initialContext.lookup
("weblogic.management.MBeanHome.JNDI_NAME.MyServer");
javax.naming.NameNotFoundException:
Unable to resolve weblogic.management.MBeanHome.JNDI_NAME.MyServer
Resolved: 'weblogic.management'
Unresolved:'MBeanHome' ; remaining name 'JNDI_NAME.MyServer'I answered this in my last post, but to clarify your attempt below.
you can access MBeanHome through JNDI in any of three ways that I
currently know...
MBeanHome mBeanHome =
(MBeanHome)ctx.lookup("weblogic.management.adminhome");
MBeanHome mBeanHome =
(MBeanHome)ctx.lookup(MBeanHome.ADMIN_JNDI_NAME);
MBeanHome mBeanHome =
(MBeanHome)ctx.lookup(MBeanHome.JNDI_NAME+"."+yourservername);
typically yourservername = "myserver"
when I print MBeanHome.ADMIN_JNDI_NAME I get
"weblogic.management.adminhome"
when I print MBeanHome.JNDI_NAME I get
"weblogic.management.home"
so using MBeanHome.JNDI_NAME+"."+yourservername is the same as
"weblogic.management.home.myserver", if the server you are trying to access
is called myserver.
may be more information than you want.
"T. Pei" <[email protected]> wrote in message
news:3a7a1562$[email protected]..
>
Tried to do JNDI lookup for MBeanHome. It could resolve
weblogic.management, but not MBeanHome.
Any idea? Thank you
T. Pei
PS
The statement and the error message:
MBeanHome mBeanHome = (MBeanHome) initialContext.lookup
("weblogic.management.MBeanHome.JNDI_NAME.MyServer");
javax.naming.NameNotFoundException:
Unable to resolve weblogic.management.MBeanHome.JNDI_NAME.MyServer
Resolved: 'weblogic.management'
Unresolved:'MBeanHome' ; remaining name 'JNDI_NAME.MyServer' -
Which WebLogic XDoclet Properties to set for Entity Beans
I have no documentation about howto set the WebLogic XDoclet properties (in a EJB Project).
The Entity Beans used by me, are CMP's accessing an Oracle Data Source (allready setup by me in the WebLogic console).
If someone knows documentation about this, or some example of a CMP (with @weblogic tags) that is backed by an Oracle table, I will appreciate that very muchHi ,
Go through the following link,In that you will find the weblogic tags and will get some needfull information on this issue.
http://dev2dev.bea.com/pub/a/2002/03/243.html
Regards
Anilkumar kari -
Problem in Jndi lookup for ITaskService
HI,
I am trying to initiate oracle bpm Human task programatically by using Java remotely.
for this I am using following JNDI lookup for ITaskService.
Hashtable ht = new
Hashtable<IWorkflowServiceClientConstants.CONNECTION_PROPERTY,java.lang.String>();
ht.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
ht.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_PROVIDER_URL, "t3://localhost:7001");
ht.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_SECURITY_PRINCIPAL, "username");
ht.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_SECURITY_CREDENTIALS, "password");
Context ctx = new InitialContext(ht);
ITaskService taskService = (ITaskQueryService)ctx.lookup("ejb/bpel/services/workflow/TaskServiceBean");
taskService.initiateTask(task);
It the right approach or not.
Please help.To access human workflow api remotely try using the following code :
Map properties = new HashMap();
properties.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_PROVIDER_URL, "t3://localhost:8001");
properties.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_SECURITY_CREDENTIALS, "welcome1");
properties.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_SECURITY_PRINCIPAL, "weblogic");
IWorkflowServiceClient wfSvcClient =
WorkflowServiceClientFactory.getWorkflowServiceClient(WorkflowServiceClientFactory.REMOTE_CLIENT, properties, null);
//Get the task query service
ITaskQueryService querySvc = wfSvcClient.getTaskQueryService();
//Login as weblogic
IWorkflowContext ctx = querySvc.authenticate("weblogic","welcome1".toCharArray(),null);
after getting the workflow context, you can call any method like query task list. perform actions etc. just see the api doc.
Regards,
Anshul -
JNDI lookup() for a Resource Adapter fails
Hi guys,
I've deployed a Resource Adapter on Weblogic (v10.3.4). It's JNDI name is: jca/HelloAdapter
Moreover, in the Outbound Connection Pools tag, I've created a javax.resource.cci.ConnectionFactory entry with JNDI name: eis/HelloAdapter.
I want to write a simple Java test to lookup my Resource adapter. The code I am using is the following:
Hashtable<String, String> properties = new Hashtable<String, String>();
properties.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
properties.put(Context.PROVIDER_URL, "t3://localhost:8001");
properties.put(Context.SECURITY_PRINCIPAL, "weblogic");
properties.put(Context.SECURITY_CREDENTIALS, "weblogic1");
Context ctx = null;
try {
ctx = new InitialContext(properties);
javax.resource.cci.ConnectionFactory cf =
(javax.resource.cci.ConnectionFactory) ctx.lookup("jca/HelloAdapter");
} catch (NamingException e) {
e.printStackTrace();
}I get the following exception:
javax.naming.NameNotFoundException: No Object found: jca/HelloAdapter|null
at weblogic.connector.deploy.JNDIHandler.lookupObject(JNDIHandler.java:881)
at weblogic.connector.deploy.JNDIHandler.getObjectInstance(JNDIHandler.java:843)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:424)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:411)
at javax.naming.InitialContext.lookup(InitialContext.java:392)Any ideas please ? Thank you for your time
Regards,
GeorgeSorry guys,
I suppose my thread subject is out of the scope of the specific list.
Sorry for the inconvenience -
Application specific key-value pairs in jndi.properties
Hello,
Can I specify my application specific key-value pair in jndi.properties?
I tried something like this
java.naming.factory.initial=.jndi.WLInitialContextFactory
java.naming.provider.url=t3://localhost:7001
myVar=myVal
When i tried looking up "myVar" from my client program, I got an error.
The other parameters like weblogic.jndi.WLInitialContextFactory are picked up.
Anyhelp will be appreciated
VasimWe have a similar problem.
We would like to configure our PROVIDER_URL for a specific web application - not
for the entire server. Since the URL should be different in development, test
and production environments, we would prefer to just set it in the deployment
descriptor. And we have a lot of code that just uses
ctx = new InitialContext();
when looking up EJBs, queues etc.
Actually, to take the problem one step further, it should be expected that later
we will have EJB's deployed on different machines/clusters - so we will actually
need specific urls for each EJB.
Is there a good way to do this? Or will we have to custom-develop our own jndi
configuration standard using application parameters to set which JNDI provider
each EJB should be looked up with?
Alternativaely, can we "import" the JNDI trees of the app server in the JNDI tree
of the web servers?
So, how should we go about this?
Robert Patrick <[email protected]> wrote:
Vasim wrote:
Hi Robert,
You are right. But The object "myVar" which I am trying to look upis not in
the JNDI tree nor am I interesed in binding it . But my requirementis that
I have one application specific variable which I am trying to lookup and I
dont want to have a separare config file for this..and hence the question..So, put the properties you want in the jndi.properties file and load
the properties
file from your code by doing something like this:
Properties props = new Properties();
ClassLoader cl = Thread.currentThread().getContextClassLoader();
if (cl == null)
cl = System.getSystemClassLoader();
InputStream is = cl.getResourceAsStream("jndi.properties");
props.load(is);
Personally, I would not use this file and would create an application-specific
file
or, as Daniel suggested, define your properties as a System property
and use
System.getProperty("myVar").
btw, is jndi.properties only for those objects which are bound to jnditree?
jndi.properties is only used for creating the JNDI InitialContext. The
whole idea
of this file is that in remote client code (without the jndi.properties
file), you
need to do something like this to tell the JNDI classes how to connect
to the JNDI
provider:
Properties props = new Properties();
props.put(Context.PROVIDER_URL, "t3://myservername:7001");
props.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
InitialContext ctx = new InitialContext(props);
but inside the server, you only need to do this because the server is
the provider
and already knows how to connect to itself:
InitialContext ctx = new InitialContext();
Therefore, the jndi.properties file allows you to externalize this property-setting
code that sets up the properties to be passed to the InitialContext constructor
so
that the remote client code can now look exactly like the code inside
the server.
The InitialContext constructor will look for this jndi.properties file
in your
classpath and load it to get the necessary configuration information
to determine
how to connect to the JNDI provider.
Hope this helps,
Robert -
Weblogic & JNDI Data Source with proxy user.
We're trying to use Oracle proxy user authentication on a data source configured in WebLogic 10.3.6, however, we want to approach it in a programatic way. So we want to obtain the DataSource, and set the proxy related properties inside the application.
We came up with the following snippet:
Hashtable<String, Object> env = new Hashtable<String, Object>();
env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
env.put(Context.PROVIDER_URL, "t3://10.1.1.10:7003");
env.put(Context.SECURITY_PRINCIPAL, "weblogic");
env.put(Context.SECURITY_CREDENTIALS, "weblogic");
Context context = new InitialContext(env);
javax.sql.DataSource ds = (javax.sql.DataSource) context.lookup("ds_puser");
OracleConnection oconn = (OracleConnection) ds.getConnection();
The problem comes up when we try to cast the connection to OracleConnection, the thing is that the returned type is actually a 1036_WLStub.
How can we avoid that type or cast to it to something useful? I found this reference on Oracle forums and he's being able to cast it directly:
Re: My problem in using weblogic Datasource and proxy user
Can someone help us out?
Thanks a lot in advance!
Edited by: 990800 on 27-feb-2013 13:26A DataSource is an Interface. What the code gets from the jndi tree is some concrete object that
the code doesn't need to know the name of, or anything specific about it, as long as it implements
the DataSource Interface, which it successfully casts to, to allow calling the methods defined in the
DataSource Interface. If you call for a plumber, you don't need to know his name as long as you
can get a plumber, and can call the "Fix this leak" method, defined in the Plumber Interface. -
Configuring Weblogic's jDriver for Oracle to use in distributed transactions
Here is some errata to the instructions at "Configuring XA JDBC drivers" section of the online beta documentation:
http://www.weblogic.com/docs60/adminguide/managetx.html#1041268
The sample JDBC connection pool using Weblogic jDriver for Oracle should be:
<JDBCConnectionPool
Name="fundsXferAppPool"
Targets="myserver"
URL="jdbc:weblogic:oracle:localdb"
DriverName="weblogic.jdbc.oci.xa.XADataSource"
InitialCapacity="0"
MaxCapacity="5"
CapacityIncrement="1"
Properties="user=scott;password=tiger;server=localdb;rmid=0"
/>
<JDBCTxDataSource
Name="fundsXferDataSource"
Targets="myserver,server1"
JNDIName="myapp.fundsXfer"
PoolName="fundsXferAppPool"
/>
Here is an example of an additional XA connection pool for a second database instance:
<JDBCConnectionPool
Name="fundsXferAppPool2"
Targets="myserver"
URL="jdbc:weblogic:oracle:localdb2"
DriverName="weblogic.jdbc.oci.xa.XADataSource"
InitialCapacity="0"
MaxCapacity="5"
CapacityIncrement="1"
Properties="user=scott;password=tiger;server=localdb2;rmid=1"
/>
<JDBCTxDataSource
Name="fundsXferDataSource2"
Targets="myserver,server1"
JNDIName="myapp.fundsXfer2"
PoolName="fundsXferAppPool2"
/>
Please note the different "rmid" values for the 2 different database instances. Note also that the above sample only applies for Beta 1. Instructions may change in the future for Beta 2.
Also, all the names of the data source properties shown in "Table 8-2 Data Source Properties for WebLogic jDriver for Oracle" should start with lower case.
The Beta 1 online documentation will soon be updated to reflect the above. Our apologies for any inconvenience caused.
-- Priscilla Fung, BEA Systems, Inc.
Thanks
Mark
"Sree Bodapati" <[email protected]> wrote:
>Hi Mark,
>
>Yes you need 8.1.6 DB Server or higher for WebLogic's jDriver for Oracle/XA
>as well.
>
>/
>sree
>
>
>"Mark Cordobal" <[email protected]> wrote in message
>news:[email protected]..
>>
>> I read that XA features require version Oracle8i release 8.1.6 or later
>of
>the Oracle
>> server.
>> Does this apply only to Oracle JDBC drivers (which implement 2pc on top
>of
>JAVA_XA
>> package) or also to Weblogic's jDriver for Oracle/XA ?
>> I mean, if I have two Oracle 8.06 (or however < 8.1.6) jdbc Resource
>Manager, can
>> I implement (wlserver 6.1sp2) a distributed xa transaction using
>Weblogic's jDriver
>> for Oracle/XA ?
>> Or is it (jdriver) built also on top of JAVA_XA package, and so the db
>server XA
>> compliancy is a must ?
>>
>> Thanks in advance
>>
>> Mark
>
>
-
Looking up JNDI names for local client
Sir,
I have been trying to look up JNDI name for the local home interface in the client program.But I got only "javax.naming.NoInitialContextException".I want information about to give a JNDI name for EJB and its details.
Thanking you.
Yours,
R K RameshIt sounds like you are not specifying the right URL or username/credentials to get an initial context.
A typical example would be something like this:
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
p.put(Context.PROVIDER_URL, "t3://server:port");
InitialContext ic = new InitialContext(p);
(You can also use a properties file or system prpoerties to specify these.)
-- Rob
WLS Blog http://dev2dev.bea.com/blog/rwoollen/
Maybe you are looking for
-
OS 10.4 to G3 FireWire successful install then shows folder icon and halts
Seek your advice camrades. Googled for solution but found no clear answer. I have iBook G3 500MHz (Dual USB) 256 MB RAM with faulty CD-ROM. G3 had OS X crashed and totally unesponding. Safe boot, singleuser and other basic steps have not helped. I ha
-
Can you Change the Background Color of the Book from White.
When I read in the dark my computer screen is so bright it hurts my eyes. Is there a way to go to white letters on black or change the background to grey or another color when reading an epub book in ADE. Some of the reader software I use has a nig
-
Business area wise profit and loss account urgent
dear all According to business scenario we are going here purchase is made for business area AA purchase account is assigned to this business araea later in goods issue we are going to issue R/M for two different business areas. purchase one R/M for
-
Effects affecting font clarity
When I use a effect for any object on a page [shadow ect.] all text on that page lose some of their clarity. This problem remains with the document even after exporting to PDF. Any suggestions?
-
UnsupportedOperationException: list is not an instance of RidList or Readon
Hi, when i want to delete a document in km, i get following error message. we are on nw04 sps 14 patch 4. [code] #1.5#BEAF00007002001500000000000B502600041AA5A60A8EBE#1155198664478#com.sapportals.wcm.WcmException#sap.com/irj#com.sapportals.wcm.WcmExc