JNDI lookup Issue
All,
I have this question in my head about JNDI lookups, but haven't received proper
information when i do research. The question is simple.
The setup is simple as well. Suppose that we have a typical WLS cluster setup,
with
WLS running in a JVM on a server host somewhere, with objects bound to its
JNDI tree, and we also have a WLS client Java application. The client connects
to WLS
and performs JNDI lookups on the server.
The question is, if the client uses JNDI to lookup an object that exists in a
separate JVM, it does load balancing and failover properly. Alternatively, if
client uses same JVM to lookup an object in failover case, we are encountering
application specific error. I just need to know what makes difference when you
lookup an object(RMI) from same JVM and separate JVM.
Any and all help appreciated,
-Senthil
No one?
Similar Messages
-
JNDI lookup issue in weblogic 10 server
Hi all,
I have a serious problem in getting the datasource lookup. My application uses EJB3 and JPA and it is deployed in weblogic10. I configured datasource in the domain (ex:mydomain) using weblogic 10 admin console. Now when i try to call from a client program, it is giving me javax.naming.NameNotFoundException. I use eclipse IDE to deploy the application. From the IDE, i can start the oracle 10.3 server and it automatically deploys the application into the server in mydomain. The admin console shows that the application deployed fine. And i can see the webcontent WAR file and EJB jar deployed. Coming back to the issue.... I verified user_projects\domains\mydomain\config\jdbc\datasource-jdbc.xml and user_projects\domains\mydomain\config\config.xml file enteries. My entries are present in those files.
When i start the server i am getting below error...
<< Stacktrace >>
javax.naming.NameNotFoundException: While trying to look up jdbc in /app.; remaining name 'jdbc'
at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1139)
at weblogic.jndi.internal.ApplicationNamingNode.lookup(ApplicationNamingNode.java:144)
at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:254)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:380)
at weblogic.deployment.PersistenceUnitInfoImpl.lookUpAppScopedDataSource(PersistenceUnitInfoImpl.java:529)
at weblogic.deployment.PersistenceUnitInfoImpl.reconfig(PersistenceUnitInfoImpl.java:549)
at weblogic.ejb.container.deployer.EJBModule.reconfigPersistenceUnits(EJBModule.java:529)
at weblogic.ejb.container.deployer.EJBModule.activate(EJBModule.java:515)
at weblogic.application.internal.flow.ModuleListenerInvoker.activate(ModuleListenerInvoker.java:107)
at weblogic.application.internal.flow.DeploymentCallbackFlow$2.next(DeploymentCallbackFlow.java:411)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
at weblogic.application.internal.flow.DeploymentCallbackFlow.activate(DeploymentCallbackFlow.java:74)
at weblogic.application.internal.flow.DeploymentCallbackFlow.activate(DeploymentCallbackFlow.java:66)
at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:635)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:212)
at weblogic.application.internal.EarDeployment.activate(EarDeployment.java:16)
at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:162)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:569)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:140)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:106)
at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:323)
at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:820)
at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1227)
at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:436)
at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:181)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:12)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:67)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
<< Client program snippet >>
Hashtable ht = new Hashtable();
ht.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
ht.put(Context.PROVIDER_URL, "t3://10.237.76.132:7001");
InitialContext ctx = null;
ctx = new InitialContext(ht);
Object obj = (Object)ctx.lookup(EmployeeBean.RemoteJNDIName);
EmployeeRemote empRemote = (EmployeeRemote)PortableRemoteObject.narrow(obj,com.acs.test.emp.EmployeeRemote.class);
List empList = empRemote.getEmployeeDetails(1);
System.out.println("SUCCESS"+empList.size());
<< Persistence.xml >>
<?xml version="1.0" encoding="UTF-8"?>
<!-- Persistence deployment descriptor for dev profile -->
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">
<persistence-unit name="cmsepool">
<jta-data-source>java:/mydatasource</jta-data-source>
<class>com.acs.test.emp.EmployeeVO</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.WeblogicTransactionManagerLookup"/>
</properties>
</persistence-unit>
</persistence>Make sure that this Datasource you created is Targetted to Admin Server and full Cluster (incase of cluster domain). From Admin Console, select your datasource and check for the Targets tab. Since its JNDI lookup error, most probably it may not be deployed properly.
HTH
Ravi Jegga -
EJB 3.0 and jndi lookup (simple question)
hi all,
i am newbie on Weblogic Application Server and i have some issues,
i have weblogic application server 10.0, also i have oracle timesten in-memory database, i have configured datasource and deploy my ejb 3.0 application, but i could not done jndi lookup?
here is my example:
1. one stateless session bean :
import javax.ejb.Remote;
@Remote
public interface InsertSubscriber {
public void insertSubscriber(SubscriberT subscriberT);
} 2. here is it's implementation :
@Remote(InsertSubscriber.class)
@Stateless
public class InsertSubscriberBean implements InsertSubscriber {
@PersistenceContext(unitName = "TimesTenDS")
private EntityManager oracleManager;
public void insertSubscriber(SubscriberT subscriber)
try {
System.out.println("started");
oracleManager.persist(subscriber);
System.out.println("end");
} catch (Exception e) {
e.printStackTrace();
}3 and my test client :
public class Client {
public static void main(String[] args) {
Context ctx = null;
Hashtable ht = new Hashtable();
ht.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
ht.put(Context.PROVIDER_URL, "t3://192.9.200.222:7001");
try {
ctx = new InitialContext(ht);
InsertSubscriber usagefasade = (InsertSubscriber) ctx
.lookup("ejb.InsertSubscriberBean");
} catch (NamingException e) {
e.printStackTrace();
} finally {
try {
ctx.close();
} catch (Exception e) {
e.printStackTrace();
}what i did incorrect ???
i got error like this : Name not fount exception
when i tried to view jndi tree on weblogic server application console i found this :
Binding Name:
TimestenExampleTimestenExample_jarInsertSubscriberBean_InsertSubscriber
Class:
test.InsertSubscriberBean_o7jk9u_InsertSubscriberImpl_1000_WLStub
Hash Code:
286
toString Results:
weblogic.rmi.internal.CollocatedRemoteRef - hostID: '2929168367193491522S::billing_domain:AdminServer', oid: '286', channel: 'null'what does it mean how i can done lookup to jndi ?
Regards,
Paata Lominadze,
Magticom LTD.
Georgia.Hi All,
I am using the weblogic cluster with session replication and EJB 2.0 with Local entity beans.
for fail-over session should be replicated to another server so we can achive the same session if 1st server fails.
Suppose i m using two managed server(server1,server2) in the cluster.I am storing the object of class ABC into session and object contains the instance of Local-EntityBean home but i put that as a transient.I have also override the readObject and write object method.
when write object is called on 1st server,readObject method should be called on second server so we will be sure that session is replicating properly.
pleaase find the code below : -
public IssuerPageBean() {
initEJB();
private void readObject(java.io.ObjectInputStream stream) throws IOException, ClassNotFoundException {
stream.defaultReadObject();
initEJB();
initializeCommonObject();
private void writeObject(java.io.ObjectOutputStream stream) throws IOException {
stream.defaultWriteObject();
private void initEJB() {
try {
ic = new InitialContext();
issuerHome = (LocalIssuerHome) ic.lookup("java:comp/env/Issuer");
} catch (NamingException e) {
e.printStackTrace();
in my case if i am calling the constructor IssuerPageBean(),it calls the initEJB() method and lookeup the entity local home properly but when readObject method is called on another server only initEJB() method is called directly and getting the exception below :
WARNING: Error during create -
javax.naming.NameNotFoundException: remaining name: env/ejb/Client
at weblogic.j2eeclient.SimpleContext.resolve(Ljavax/naming/Name;Z)Ljavax/naming/Context;(SimpleContext.java:35)
at weblogic.j2eeclient.SimpleContext.resolve(Ljavax/naming/Name;)Ljavax/naming/Context;(SimpleContext.java:39)
at weblogic.j2eeclient.SimpleContext.lookup(Ljavax/naming/Name;)Ljava/lang/Object;(SimpleContext.java:57)
at weblogic.j2eeclient.SimpleContext.lookup(Ljavax/naming/Name;)Ljava/lang/Object;(SimpleContext.java:57)
at weblogic.j2eeclient.SimpleContext.lookup(Ljava/lang/String;)Ljava/lang/Object;(SimpleContext.java:62)
at weblogic.jndi.factories.java.ReadOnlyContextWrapper.lookup(Ljava/lang/String;)Ljava/lang/Object;(ReadOnlyCont
extWrapper.java:45)
at weblogic.jndi.internal.AbstractURLContext.lookup(Ljava/lang/String;)Ljava/lang/Object;(AbstractURLContext.jav
a:130)
at javax.naming.InitialContext.lookup(Ljava/lang/String;)Ljava/lang/Object;(InitialContext.java:347)
at com.lb.equities.veda.tools.salesvault.jsp.ClientPageBean.initEJB()V(ClientPageBean.java:218)
at com.lb.equities.veda.tools.salesvault.jsp.ClientPageBean.readObject(Ljava/io/ObjectInputStream;)V(ClientPageB
ean.java:191)
at java.lang.LangAccessImpl.readObject(Ljava/lang/Class;Ljava/lang/Object;Ljava/io/ObjectInputStream;)V(Unknown
Source)
at java.io.ObjectStreamClass.invokeReadObject(Ljava/lang/Object;Ljava/io/ObjectInputStream;)V(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Ljava/lang/Object;Ljava/io/ObjectStreamClass;)V(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Z)Ljava/lang/Object;(Unknown Source)
at java.io.ObjectInputStream.readObject0(Z)Ljava/lang/Object;(Unknown Source)
at java.io.ObjectInputStream.readObject()Ljava/lang/Object;(Unknown Source)
at java.util.HashMap.readObject(Ljava/io/ObjectInputStream;)V(Unknown Source)
at java.lang.LangAccessImpl.readObject(Ljava/lang/Class;Ljava/lang/Object;Ljava/io/ObjectInputStream;)V(Unknown
Source)
at java.io.ObjectStreamClass.invokeReadObject(Ljava/lang/Object;Ljava/io/ObjectInputStream;)V(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Ljava/lang/Object;Ljava/io/ObjectStreamClass;)V(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Z)Ljava/lang/Object;(Unknown Source)
at java.io.ObjectInputStream.readObject0(Z)Ljava/lang/Object;(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Ljava/lang/Object;Ljava/io/ObjectStreamClass;)V(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Ljava/lang/Object;Ljava/io/ObjectStreamClass;)V(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Z)Ljava/lang/Object;(Unknown Source)
at java.io.ObjectInputStream.readObject0(Z)Ljava/lang/Object;(Unknown Source)
at java.io.ObjectInputStream.readObject()Ljava/lang/Object;(Unknown Source)
at weblogic.common.internal.ChunkedObjectInputStream.readObject()Ljava/lang/Object;(ChunkedObjectInputStream.jav
a:120)
at weblogic.rjvm.MsgAbbrevInputStream.readObject(Ljava/lang/Class;)Ljava/lang/Object;(MsgAbbrevInputStream.java:
121)
at weblogic.cluster.replication.ReplicationManager_WLSkel.invoke(ILweblogic/rmi/spi/InboundRequest;Lweblogic/rmi
/spi/OutboundResponse;Ljava/lang/Object;)Lweblogic/rmi/spi/OutboundResponse;(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(Lweblogic/rmi/extensions/server/RuntimeMethodDescriptor;Lweblogic
/rmi/spi/InboundRequest;Lweblogic/rmi/spi/OutboundResponse;)V(BasicServerRef.java:492)
Please help .
Thanks in Advance.
Edited by hforever at 03/04/2008 7:28 AM -
JNDI lookup for Crystal Reports at runtime
How to run a rpt to fetch data from database connection defined in Tomcat's JNDI resources ? We are using JDBC(JNDI) Data source while designing the report in the Crystal Report designer and we want to use 'Connection Name' at runtime for jndi lookup to Tomcats JNDI resources.
Hi,
Thanks, this helped in resolving the JNDI lookup problem. But we are not having an issue in connecting to DS as it fails with error "Unsupported JNDI Object".
Tried suggestions on this link: "http://www.theserverside.com/discussions/thread.tss?thread_id=37430", but no luck.
Here are the configuration files:
context.xml:
<Context>
<Resource name="jdbc/remedy" auth="Container" type="javax.sql.DataSource" driverClassName="oracle.jdbc.OracleDriver" url="jdbc:oracle:thin:@10.76.85.68:1521:dtv" maxActive="20" maxIdle="10" maxWait="-1" />
</Context>
web.xml:
<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/remedy</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
Log:
2009-10-30 06:38:05,804 DEBUG [com.crystaldecisions.reports.formatter.a.c] - Export Supervisor: number of destination exporters:1
2009-10-30 06:38:05,804 DEBUG [com.crystaldecisions.reports.formatter.a.c] - Export Supervisor: number of format exporters:4
2009-10-30 06:38:05,865 INFO [com.businessobjects.reports.sdk.JRCCommunicationAdapter] - JRCAgent1 received request: fetchReportPageRequest
2009-10-30 06:38:05,865 INFO [com.businessobjects.reports.sdk.JRCCommunicationAdapter] - JRCAgent1 attempting to acquire license
2009-10-30 06:38:05,865 INFO [com.businessobjects.reports.sdk.JRCCommunicationAdapter] - JRCAgent1 successfully acquired license
2009-10-30 06:38:05,867 DEBUG [com.businessobjects.reports.sdk.JRCCommunicationAdapter] - Requesting page 1
2009-10-30 06:38:05,879 INFO [com.crystaldecisions.reports.queryengine.driverImpl] - Logon: Connecting to database using local JNDI server ...
2009-10-30 06:38:05,888 DEBUG [com.crystaldecisions.reports.reportdefinition.datainterface] - Failed to open connection (Connection: databaseType=JDBC (JNDI) serverName=jdbc:oracle:thin:@10.76.85.68:1521:dtv state=closed databaseDriverName=crdb_jdbc.dll).
com.crystaldecisions.reports.queryengine.al: Unsupported JNDI Object (remedy)
at com.crystaldecisions.reports.queryengine.driverImpl.o.if(Unknown Source)
at com.crystaldecisions.reports.queryengine.av.new(Unknown Source)
at com.crystaldecisions.reports.queryengine.av.byte(Unknown Source)
at com.crystaldecisions.reports.reportdefinition.datainterface.b.a(Unknown Source)
at com.crystaldecisions.reports.reportdefinition.datainterface.b.a(Unknown Source)
at com.crystaldecisions.reports.reportdefinition.datainterface.b.a(Unknown Source)
at com.crystaldecisions.reports.reportdefinition.datainterface.b.if(Unknown Source)
at com.crystaldecisions.reports.reportdefinition.datainterface.j.a(Unknown Source)
at com.businessobjects.reports.sdk.b.i.if(Unknown Source)
at com.businessobjects.reports.sdk.b.i.a(Unknown Source)
at com.businessobjects.reports.sdk.b.i.byte(Unknown Source)
at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown Source)
at com.crystaldecisions.proxy.remoteagent.y.a(Unknown Source)
at com.crystaldecisions.proxy.remoteagent.r.a(Unknown Source)
at com.crystaldecisions.sdk.occa.report.application.cf.a(Unknown Source)
at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)
at com.crystaldecisions.sdk.occa.report.application.ReportSource.getPage(Unknown Source)
at com.crystaldecisions.sdk.occa.report.application.AdvancedReportSource.getPage(Unknown Source)
at com.crystaldecisions.sdk.occa.report.application.NonDCPAdvancedReportSource.getPage(Unknown Source)
at com.crystaldecisions.report.web.event.ac.a(Unknown Source)
at com.crystaldecisions.report.web.event.ac.a(Unknown Source)
at com.crystaldecisions.report.web.event.b2.a(Unknown Source)
at com.crystaldecisions.report.web.event.b7.broadcast(Unknown Source)
at com.crystaldecisions.report.web.event.av.a(Unknown Source)
at com.crystaldecisions.report.web.WorkflowController.do(Unknown Source)
Edited by: MuralidharS on Oct 30, 2009 8:46 AM -
JMS Wrappers can't cache JNDI lookups when using secured queues
Hi All!
We are working on a jms client, inside a webapp(servlets), using Weblogic 9.2 and Weblogic 10.3.
As we want to use secured queues and keep being efficient we tryed to use Weblogic JMS Wrappers, that should work according to the docs:
Enhanced Support for Using WebLogic JMS with EJBs and Servlets
http://download.oracle.com/docs/cd/E12840_01/wls/docs103/jms/j2ee.html
But we are facing a problem:
When we define a JMS Wrapper and try to cache JNDI lookups for the QueueConnectionFactory and Queue, as the docs recommend for efficiency, the connection to the queue is ignoring the user/pwd.
The JMS Wrapper is using <res-auth>Application</res-auth>.
We are creating the connection using createQueueConnection(user, pwd) from QueueConnectionFactory and after several tests it seems that the user and password are ingored unless a jndi lookup is made in the same thread, as if when there are not any thread credentials present user and password are ignored for the connection...
so the question is:
That behaviour goes against Weblogic JMS Wrapper documentation, doesn't it?
Is there then any other way to access efficiently secured queues using a servlet as a client? (iit's not an option for us to use mdbs, or ejbs).
If it helps, this seems related to this still opened spring-weblogic issue: SPR-2941 --> http://jira.springframework.org/browse/SPR-2941 and SPR-4720 --> http://jira.springframework.org/browse/SPR-4720
Thanxs
And here goes our DDs and code to reproduce:
First in pretty format:
web.xml --> http://pastebin.com/f5f85e8d4
weblogic.xml --> http://pastebin.com/f2fbe10cc
Client code --> http://pastebin.com/f586d32d9
And now emmebded in the msg:
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app
xmlns="http://www.bea.com/ns/weblogic/90"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.bea.com/ns/weblogic/90
http://www.bea.com/ns/weblogic/90/weblogic-web-app.xsd">
<description>WebLogic Descriptor</description>
<resource-description>
<res-ref-name>jms/QCF</res-ref-name>
<jndi-name>weblogic.jms.ConnectionFactory</jndi-name>
</resource-description>
</weblogic-web-app>weblogic.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name> QCFWrapperCredentialsTest </display-name>
<description> QCFWrapperCredentialsTest </description>
<servlet id="Servlet_1">
<servlet-name>QCFWrapperCredentialsTest</servlet-name>
<servlet-class>QCFWrapperCredentialsTest</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping id="ServletMapping_1">
<servlet-name>QCFWrapperCredentialsTest</servlet-name>
<url-pattern>/Test</url-pattern>
</servlet-mapping>
<resource-ref>
<res-ref-name>jms/QCF</res-ref-name>
<res-type>javax.jms.QueueConnectionFactory</res-type>
<res-auth>Application</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
</web-app>And our test client:
import java.io.*;
import java.util.Properties;
import javax.jms.*;
import javax.naming.*;
import javax.servlet.http.*;
public class QCFWrapperCredentialsTest extends HttpServlet {
QueueConnectionFactory factory = null;
Queue queue = null;
String jndiName = "java:comp/env/jms/QCF";
String queueName= "jms/ColaEntradaConsultas";
String user = "usuarioColas";
String pwd = "12345678";
String userjndi = "usuarioColas";
String pwdjndi = "12345678";
String serverT3URL="t3://127.0.0.1:7007";
public void init() {
setupJNDIResources();
private void setupJNDIResources(){
try {
Properties props = new Properties();
props.put("java.naming.factory.initial",
"weblogic.jndi.WLInitialContextFactory");
props.put("java.naming.provider.url",serverT3URL );
props.put("java.naming.security.principal", userjndi);// usr
props.put("java.naming.security.credentials", pwdjndi);// pwd
InitialContext ic = new InitialContext(props);
factory = (QueueConnectionFactory) ic.lookup(jndiName);
queue = (Queue) ic.lookup(queueName);
} catch (NamingException e) {
e.printStackTrace();
public void service(HttpServletRequest req, HttpServletResponse res) {
res.setContentType("text/html");
Writer wr = null;
try {
wr = res.getWriter();
//Comment this out, do a lookup for each request and it will work
//setupJNDIResources();
String user = this.user;
String pwd = this.pwd;
//read users and passwords from the request in case they are present
if (req.getParameter("user") != null) {
user = req.getParameter("user");
if (req.getParameter("pwd") != null) {
pwd = req.getParameter("pwd");
wr.write("JNDI User: *" + userjndi + "* y pwd: *" + pwdjndi + "*<p>");
wr.write("Queue User: *" + user + "* y pwd: *" + pwd + "*<p>");
//Obtain a connection using user/pwd
QueueConnection conn = factory.createQueueConnection(user, pwd);
QueueSession ses = conn.createQueueSession(true,
Session.SESSION_TRANSACTED);
QueueSender sender = ses.createSender(queue);
TextMessage msg = ses.createTextMessage();
msg.setText("Hi there!");
conn.start();
sender.send(msg);
ses.commit();
sender.close();
ses.close();
conn.close();
} catch (Exception e) {
e.printStackTrace();
try {
wr.write(e.toString());
} catch (Exception e2) {
e2.printStackTrace();
finally{
try {
wr.close();
} catch (IOException e) {
e.printStackTrace();
}Edited by: user2525402 on Feb 9, 2010 7:14 PMThanks Tom,
Quite a useful response .-)
Leaving aside the fact that weblogic behaviour with jms wrappers and secured queues seems to not be working as the docs says...
Talking about workarounds:
Both workarounds you suggest works, but as you already noted, creating a new JNDI context just to inject credentials into the threads is overkill when high performance is needed.
I also found more information about the same issue here: http://sleeplessinslc.blogspot.com/2009/04/weblogic-jms-standalone-multi-threaded.html
And he suggest the same workaround, injecting credentials
So I tried the second approach, successfully, injecting credentials into the thread using the security API.
This way, using JMS wrappers and injecting credentials into the thread we get the best performance available, caching resource using wrappers and using credentials in a somewhat efficient way.
Now the test snippet looks like this:
import java.io.*;
import java.security.PrivilegedAction;
import java.util.Properties;
import javax.jms.*;
import javax.naming.*;
import javax.security.auth.Subject;
import javax.security.auth.login.LoginException;
import javax.servlet.http.*;
import weblogic.jndi.Environment;
import weblogic.security.auth.Authenticate;
public class JMSWrapperCredentialsTest extends HttpServlet {
QueueConnectionFactory factory = null;
Queue queue = null;
String jndiName = "java:comp/env/jms/QCF";
String queueName= "jms/ColaEntradaConsultas";
String user = "usuarioColas";
String pwd = "12345678";
String userjndi = "usuarioColas";
String pwdjndi = "12345678";
String serverT3URL="t3://127.0.0.1:7007";
public void init() {
setupJNDIResources();
private void setupJNDIResources(){
try {
Properties props = new Properties();
props.put("java.naming.factory.initial",
"weblogic.jndi.WLInitialContextFactory");
props.put("java.naming.provider.url",serverT3URL );
props.put("java.naming.security.principal", userjndi);// usr
props.put("java.naming.security.credentials", pwdjndi);// pwd
InitialContext ic = new InitialContext(props);
factory = (QueueConnectionFactory) ic.lookup(jndiName);
queue = (Queue) ic.lookup(queueName);
} catch (NamingException e) {
e.printStackTrace();
public void service(HttpServletRequest req, HttpServletResponse res) {
final HttpServletRequest fReq=req;
final HttpServletResponse fRes=res;
PrivilegedAction action = new java.security.PrivilegedAction() {
public java.lang.Object run() {
performRequest(fReq,fRes);
return null;
try {
Subject subject=createSingleSubject(serverT3URL,user,pwd);
weblogic.security.Security.runAs(subject, action);
} catch (Exception e) {
e.printStackTrace();
public void performRequest(HttpServletRequest req, HttpServletResponse res) {
res.setContentType("text/html");
Writer wr = null;
try {
wr = res.getWriter();
//Comment this out, do a lookup for each request and it will work
//setupJNDIResources();
String user = this.user;
String pwd = this.pwd;
//read users and passwords from the request in case they are present
if (req.getParameter("user") != null) {
user = req.getParameter("user");
if (req.getParameter("pwd") != null) {
pwd = req.getParameter("pwd");
wr.write("JNDI User: *" + userjndi + "* y pwd: *" + pwdjndi + "*<p>");
wr.write("Queue User: *" + user + "* y pwd: *" + pwd + "*<p>");
//Obtain a connection using user/pwd
QueueConnection conn = factory.createQueueConnection(user, pwd);
QueueSession ses = conn.createQueueSession(true,
Session.SESSION_TRANSACTED);
QueueSender sender = ses.createSender(queue);
TextMessage msg = ses.createTextMessage();
msg.setText("Hi there!");
conn.start();
sender.send(msg);
ses.commit();
sender.close();
ses.close();
conn.close();
} catch (Exception e) {
e.printStackTrace();
try {
wr.write(e.toString());
} catch (Exception e2) {
e2.printStackTrace();
finally{
try {
wr.close();
} catch (IOException e) {
e.printStackTrace();
private Subject createSingleSubject(String providerUrl, String userName, String password) {
Subject subject = new Subject();
// Weblogic env class
Environment env = new Environment();
if(providerUrl!=null)
env.setProviderUrl(providerUrl);
env.setSecurityPrincipal(userName);
env.setSecurityCredentials(password);
try {
// Weblogic Authenticate class will populate and Seal the subject
Authenticate.authenticate(env, subject);
return subject;
catch (LoginException e) {
throw new RuntimeException("Unable to Authenticate User", e);
catch (Exception e) {
throw new RuntimeException("Error authenticating user", e);
}Thanks a lot for the help -
Failed in WD JNDI lookup in QA Portal
Hello Experts,
I am facing the issue in custom WD application in QA portal system, in dev portal the application is working fine and after transporting the objects into QA portal ,while on preview the iview its giving me error : "Failed in WD JNDI lookup ".
I have tested the WD application from Web dynpro console and its working fine , even i have created iview in QA portal and its working fine but while transporting the iview from DEV to QA Portal is not working . Can any one help me on that .
Your help will highly appreciated ..
Details error :
com.sapportals.portal.prt.runtime.PortalRuntimeException: Failed in WD JNDI lookup. javax.naming.NameNotFoundException: No child found in WebDynproContext with name home~eth_dis
at com.sap.portal.pcm.iview.admin.AdminBaseiView.createAttrSetLayersList(AdminBaseiView.java:357)
at com.sap.portal.pcm.iview.admin.AdminBaseiView.getAttrSetLayersList(AdminBaseiView.java:205)
at com.sap.portal.pcm.iview.admin.AdminBaseiView.getCustomImplementation(AdminBaseiView.java:148)
at com.sap.portal.pcm.admin.PcmAdminBase.getImplementation(PcmAdminBase.java:530)
at com.sapportals.portal.ivs.iviews.IviewServiceObjectFactory.getObjectInstance(IviewServiceObjectFactory.java:442)
... 40 moreHi Shanti,
Thanks for the quick response.
My portal version is EP 7 with SP21 .As I mention in my thread that I have tested custom application on QA Portal and its working fine. But the problem is only appearing with the transported iview into QA portal.
Regards
Rashi -
JNDI lookup problem in WAS 5.1
Hello all,
I have generated an EAR using XDoclet and MyEclipse. When I deploy this EAR on WAS 5.1, I get the following exception:
javax.naming.NameNotFoundException: Context: WarHog/nodes/WarHog/servers/server1, name: ejb/TEDIObjectManagerLocal: First component in name TEDIObjectManagerLocal not found. Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
at org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read(NotFoundHelper.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled Code))
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled Code))
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
at com.ibm.rmi.iiop.CDRInputStream.readBoxedIDLEntity(CDRInputStream.java:2112)
at com.ibm.rmi.iiop.CDRInputStream.readIDLValue(CDRInputStream.java:2177)
at com.ibm.rmi.iiop.CDRInputStream.fast_read_value(CDRInputStream.java:1734)
at com.ibm.rmi.io.IIOPInputStream.readValueType(IIOPInputStream.java:2085)
at com.ibm.rmi.io.IIOPInputStream.readObjectField(IIOPInputStream.java:2057)
at com.ibm.rmi.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:1765)
at com.ibm.rmi.io.IIOPInputStream.inputObjectUsingClassDesc(IIOPInputStream.java:1348)
at com.ibm.rmi.io.IIOPInputStream.continueSimpleReadObject(IIOPInputStream.java:420)
at com.ibm.rmi.io.IIOPInputStream.simpleReadObjectLoop(IIOPInputStream.java:404)
at com.ibm.rmi.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:347)
at com.ibm.rmi.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:200)
at com.ibm.rmi.iiop.CDRInputStream.read_value(CDRInputStream.java:1367)
at com.ibm.rmi.util.ProxyUtil.copyObject(ProxyUtil.java:450)
at com.ibm.CORBA.iiop.UtilDelegateImpl.copyObject(UtilDelegateImpl.java:789)
at javax.rmi.CORBA.Util.copyObject(Util.java:333)
at com.wdc.tedi.interfaces._TransformationEngine_Stub.transform(_TransformationEngine_Stub.java:268)
at com.wdc.tedi.web.TestHarnessBean.translate(TestHarnessBean.java:42)
at com.wdc.tedi.web.TestHarnessBean.setDataBlob(TestHarnessBean.java:80)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)First of all, I don't really understand what the error means. Is it that the JNDI lookup failed when one of my beans tried to do a lookup on 'ejb/TEDIObjectManagerLocal'? I believe there's some configuration that went wrong (EJB reference binding or something) when I deployed the EAR. The reason I don't think it's a faulty code is because the EAR runs like a charm when I deploy it on Oracle 10g and Weblogic.
I am really stuck on this problem and shall appreciate any help that I can get. I can send the code, xdoclet tags and configuration if that might assist someone.
Thanks
-ybh6336Hello all,
I'm still stuck on this issue. Following are the entries related to my
application when I do a 'dumpNameSpace':
28 (top)/nodes/WarHog/servers/server1/ejb/tedi/TEDIObjectManager
28
com.wdc.tedi.interfaces._TEDIObjectManagerHome_Stub
29 (top)/nodes/WarHog/servers/server1/ejb/tedi/DSValueLookup
29
com.wdc.tedi.interfaces._DSValueLookupHome_Stub
30 (top)/nodes/WarHog/servers/server1/ejb/tedi/TransformationEngine
30
com.wdc.tedi.interfaces._TransformationEngineHome_StubObservations:
- I only see the namespace entries for my Session beans. There's one
entity bean also which does not show up.
- I don't see anything for the Local Home interfaces, it shows only the
Home interfaces.
As additional information, I'm looking up 'TEDIObjectManagerLocal'
using 'ejb/TEDIObjectManagerLocal'. I also tried using 'local:ejb/ejb/TEDIObjectManagerLocal' (as Karthyk suggested) and
'java:comp/env/ejb/TEDIObjectManagerLocal', but that does not work
either.
Also, the XDoclet tags that I use to generate the interfaces for
TEDIObjectManager bean are as follows:
/* @ejb.bean name="TEDIObjectManager"
* display-name="TEDIObjectManager"
* description="TEDIObjectManager"
* jndi-name="ejb/tedi/TEDIObjectManager"
* local-jndi-name="ejb/TEDIObjectManagerLocal"
* type="Stateless"
* view-type="both"
* @ejb.util generate="physical"
* @ejb.ejb-ref ejb-name="TEDIObject"
* view-type = "local"
* ref-name = "ejb/TEDIObjectLocal"
* @oc4j.bean jndi-name="ejb/tedi/TEDIObjectManager"
*/My ejb-jar.xml looks like following for that bean:
<session >
<description><![CDATA[TEDIObjectManager]]></description>
<display-name>TEDIObjectManager</display-name>
<ejb-name>TEDIObjectManager</ejb-name>
<home>com.wdc.tedi.interfaces.TEDIObjectManagerHome</home>
<remote>com.wdc.tedi.interfaces.TEDIObjectManager</remote>
<local-home>com.wdc.tedi.interfaces.TEDIObjectManagerLocalHome</local-home>
<local>com.wdc.tedi.interfaces.TEDIObjectManagerLocal</local>
<ejb-class>com.wdc.tedi.ejb.TEDIObjectManagerSession</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<ejb-local-ref >
<ejb-ref-name>ejb/TEDIObjectLocal</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>com.wdc.tedi.interfaces.TEDIObjectLocalHome</local-home>
<local>com.wdc.tedi.interfaces.TEDIObjectLocal</local>
<ejb-link>TEDIObject</ejb-link>
</ejb-local-ref>
</session>AND following for the bean that is referencing it:
<session >
<description><![CDATA[TransformationEngine]]></description>
<display-name>TransformationEngine</display-name>
<ejb-name>TransformationEngine</ejb-name>
<home>com.wdc.tedi.interfaces.TransformationEngineHome</home>
<remote>com.wdc.tedi.interfaces.TransformationEngine</remote>
<local-home>com.wdc.tedi.interfaces.TransformationEngineLocalHome</local-home>
<local>com.wdc.tedi.interfaces.TransformationEngineLocal</local>
<ejb-class>com.wdc.tedi.ejb.TransformationEngineSession</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<ejb-local-ref >
<ejb-ref-name>ejb/TEDIObjectManagerLocal</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>com.wdc.tedi.interfaces.TEDIObjectManagerLocalHome</local-home>
<local>com.wdc.tedi.interfaces.TEDIObjectManagerLocal</local>
<ejb-link>TEDIObjectManager</ejb-link>
</ejb-local-ref>
</session>The entries in ibm-ejb-jar-bnd.xmi (generated using MyEclipse) are as
follows for the two beans:
<ejbBindings
xmi:id="Session_bnd_1"
jndiName="ejb/tedi/TransformationEngine">
<ejbRefBindings xmi:id="EJBRefBnd_1"
jndiName="ejb/TEDIObjectManagerLocal">
<bindingEjbRef href="META-INF/ejb-jar.xml#EJBLocalRef_1"/>
</ejbRefBindings>
<enterpriseBean
xmi:type="ejb:Session"
href="META-INF/ejb-jar.xml#Session_TransformationEngine" />
</ejbBindings>
<ejbBindings
xmi:id="Session_bnd_3"
jndiName="ejb/tedi/TEDIObjectManager">
<ejbRefBindings xmi:id="EJBRefBnd_2"
jndiName="ejb/TEDIObjectLocal">
<bindingEjbRef href="META-INF/ejb-jar.xml#EJBLocalRef_2"/>
</ejbRefBindings>
<enterpriseBean
xmi:type="ejb:Session"
href="META-INF/ejb-jar.xml#Session_TEDIObjectManager" />
</ejbBindings>I know I'm swamping the post with code, but please let me know if anyone finds something unusual.
NOTE: When deploying on WAS, in the 'Map EJB references to beans' step, I'm giving the following values for 'TransformationEngine' bean:
Reference binding: ejb/TEDIObjectManagerLocal
JNDI Name: ejb/tedi/TEDIObjectManager
There's one other similar binding that works for 'TEDIObjectManager'
bean:
Reference binding: ejb/TEDIObjectLocal
JNDI Name: ejb/TEDIObject
Everything in ejb-jar and ibm-ejb-jar-bnd.xmi look similar for this working bean, there is one difference though, I do the lookup on this one using 'java:comp/env/ejb/TEDIObjectLocal', but I've already tried that for the other one.
Really appreciate your time.
Thanks
-yogesh -
Hello everyone,
I developed a Web Service prototype accessing remote EJB using the EJB
control with special syntax in the jndi-name attribute: @jws:ejb
home-jndi-name="t3://10.10.245.70:7131/AccountDelegatorEJB"
Everything works fine, but I get an error when I restrict access to my web
service with a declarative security model by implementing steps provided in
help doc:
- Define the web resource you wish to protect
- Define which security role is required to access the web resource
- Define which users are granted the required security role
- Configure WebLogic Server security for my web service(Compatibility
Security/Users)
I launch the service by entering the address in a web browser. When prompted
to accept the digital certificate, click Yes, when prompted for network
authentication information, enter username and password, navigate to the
Test Form tab of Test View, invoke the method by clicking the button and I
get the following exception:
<error>
<faultcode>JWSError</faultcode>
<faultstring>Error during JNDI lookup from
jndi:t3://10.10.245.70:7131/AccountDelegatorEJB[Lookup failed for
name:t3://10.10.245.70:7131/AccountDelegatorEJB]</faultstring>
<detail>
<jwErrorDetail> weblogic.jws.control.ControlException: Error during JNDI
lookup from jndi:t3://10.10.245.70:7131/AccountDelegatorEJB[Lookup failed
for name:t3://10.10.245.70:7131/AccountDelegatorEJB] at
weblogic.knex.control.EJBControlImpl.acquireResources(EJBControlImpl.java:27
8) at
weblogic.knex.context.JwsInternalContext.acquireResources(JwsInternalContext
.java:220) at
weblogic.knex.control.ControlHandler.invoke(ControlHandler.java:260) at
ibas.AccountControl.getTransactionHistory(AccountControl.ctrl) at
ibas.GetSecure.retrieveVisaHistoryTxn(GetSecure.jws:64) </jwErrorDetail>
</detail>
</error>
I have a simple Hello method as well in my WebService (which is also
restricted) and it works fine, but remote EJB access doesn't. I tested my
prototype on Weblogic 7.2 and 8.1 platforms - same result.
Is that a bug or I am missing some additional configuration in order to get
that working. Has anyone seen similar behavior? Is there a known resolution?
Or a suggested way to work around the problem?
Thank you.
AndreAndre,
It would be best if this issue is handled as an Eval Support case. Please
BEA Customer Support at http://support.beasys.com along with the required
files, and request that an Eval support case be created for this issue.
Thanks
Raj Alagumalai
WebLogic Workshop Support
"Andre Shergin" <[email protected]> wrote in message
news:[email protected]...
Anurag,
I removed "t3", still get an error but a different one (Unable to create
InitialContext:null):
<error>
<faultcode>JWSError</faultcode>
<faultstring>Error during JNDI lookup from
jndi://secuser1:[email protected]:7131/AccountDelegatorEJB[Unable to
create InitialContext:null]</faultstring>
<detail>
<jwErrorDetail> weblogic.jws.control.ControlException: Error during JNDI
lookup from
jndi://secuser1:[email protected]:7131/AccountDelegatorEJB[Unable to
create InitialContext:null] at
weblogic.knex.control.EJBControlImpl.acquireResources(EJBControlImpl.java:27
8) at
weblogic.knex.context.JwsInternalContext.acquireResources(JwsInternalContext
.java:220) at
weblogic.knex.control.ControlHandler.invoke(ControlHandler.java:260) at
ibas.AccountControl.getTransactionHistory(AccountControl.ctrl) at
ibas.GetVisaHistoryTransactions.getVisaHistoryTxn(GetVisaHistoryTransactions
.jws:67) </jwErrorDetail>
</detail>
</error>
Note: inter-domain communication is configured properly. The Web Service to
remote EJB works fine without a declarative security.
Any other ideas?
Thank you for your help.
Andre
"Anurag" <[email protected]> wrote in message
news:[email protected]...
Andre,
It seems you are using the URL
jndi:t3://secuser1:[email protected]:7131/AccountDelegatorEJB
whereas you should not be specifying the "t3:" protocol.
The URL should be like
jndi://secuser1:[email protected]:7131/AccountDelegatorEJB
Please do let me know if you see any issues with this.
Note that this will only allow you to access remote EJBs in the same WLS
domain. For accessing EJBs on another domain, you need to configure
inter-domain communication by
following a few simple steps as mentioned at
http://e-docs.bea.com/wls/docs81/ConsoleHelp/jta.html#1106135. This link has
been provided in the EJB Control Workshop documentation.
Regards,
Anurag
"Andre Shergin" <[email protected]> wrote in message
news:[email protected]...
Raj,
I tried that before, it didn't help. I got similar error message:
<error>
<faultcode>JWSError</faultcode>
<faultstring>Error during JNDI lookup from
jndi:t3://secuser1:[email protected]:7131/AccountDelegatorEJB[Lookup
failed for
name:t3://secuser1:[email protected]:7131/AccountDelegatorEJB]</faultstr
ing>
<detail>
<jwErrorDetail> weblogic.jws.control.ControlException: Error during JNDI
lookup from
jndi:t3://secuser1:[email protected]:7131/AccountDelegatorEJB[Lookup
failed for
name:t3://secuser1:[email protected]:7131/AccountDelegatorEJB] at
weblogic.knex.control.EJBControlImpl.acquireResources(EJBControlImpl.java:27
8) at
weblogic.knex.context.JwsInternalContext.acquireResources(JwsInternalContext
.java:220) at
weblogic.knex.control.ControlHandler.invoke(ControlHandler.java:260) at
ibas.AccountControl.getTransactionHistory(AccountControl.ctrl) at
ibas.GetSecure.retrieveVisaHistoryTxn(GetSecure.jws:64) </jwErrorDetail>
</detail>
</error>
Anything else should I try?
P.S. AccountDelegatorEJB, the remote EJB my Web Service calls is NOTaccess
restricted.
I hope there is a solution.
Thanks,
Andre
"Raj Alagumalai" <[email protected]> wrote in message
news:[email protected]...
Andre,
Can you try using the following url with username and password
jndi://username:password@host:7001/my.resource.jndi.object ?
once you add webapp level security, the authenticated is the user who
invokes the EJB.
http://e-docs.bea.com/workshop/docs81/doc/en/workshop/guide/controls/ejb/con
CreatingANewEJBControl.html?skipReload=true
has more info on using remote EJB's.
Hope this helps.
Thanks
Raj Alagumalai
WebLogic Workshop Support
"Alla Resnik" <[email protected]> wrote in message
news:[email protected]...
Hello everyone,
I developed a Web Service prototype accessing remote EJB using the EJB
control with special syntax in the jndi-name attribute: @jws:ejb
home-jndi-name="t3://10.10.245.70:7131/AccountDelegatorEJB"
Everything works fine, but I get an error when I restrict access to my
web
service with a declarative security model by implementing steps
provided
in
help doc:
- Define the web resource you wish to protect
- Define which security role is required to access the web resource
- Define which users are granted the required security role
- Configure WebLogic Server security for my web service(Compatibility
Security/Users)
I launch the service by entering the address in a web browser. Whenprompted
to accept the digital certificate, click Yes, when prompted for
network
authentication information, enter username and password, navigate tothe
Test Form tab of Test View, invoke the method by clicking the buttonand
I
get the following exception:
<error>
<faultcode>JWSError</faultcode>
<faultstring>Error during JNDI lookup from
jndi:t3://10.10.245.70:7131/AccountDelegatorEJB[Lookup failed for
name:t3://10.10.245.70:7131/AccountDelegatorEJB]</faultstring>
<detail>
<jwErrorDetail> weblogic.jws.control.ControlException: Error during
JNDI
lookup from jndi:t3://10.10.245.70:7131/AccountDelegatorEJB[Lookupfailed
for name:t3://10.10.245.70:7131/AccountDelegatorEJB] at
weblogic.knex.control.EJBControlImpl.acquireResources(EJBControlImpl.java:27
8) at
weblogic.knex.context.JwsInternalContext.acquireResources(JwsInternalContext
.java:220) at
weblogic.knex.control.ControlHandler.invoke(ControlHandler.java:260)at
ibas.AccountControl.getTransactionHistory(AccountControl.ctrl) at
ibas.GetSecure.retrieveVisaHistoryTxn(GetSecure.jws:64)</jwErrorDetail>
</detail>
</error>
I have a simple Hello method as well in my WebService (which is also
restricted) and it works fine, but remote EJB access doesn't. I testedmy
prototype on Weblogic 7.2 and 8.1 platforms - same result.
Is that a bug or I am missing some additional configuration in order
to
get
that working. Has anyone seen similar behavior? Is there a knownresolution?
Or a suggested way to work around the problem?
Thank you.
Andre -
Hi All
Two separate webapps, have different names for Datasources, on the same host and port. Both application work fine independently.
When we deploy both applications on the same app server(websphere), whichever we executes first gets its datasource from JNDI lookup and works fine, but when we try second application it have problem in finding its data source from JNDI lookup. If we start this second application first, it will work fine, but now another will have the same problem in its JNDI lookup.
Any idea why.
Thanks
....RanvirHi All
Two separate webapps, have different names for
Datasources, on the same host and port. Both
application work fine independently.
When we deploy both applications on the same app
server(websphere), whichever we executes first gets
its datasource from JNDI lookup and works fine, but
when we try second application it have problem in
finding its data source from JNDI lookup. If we start
this second application first, it will work fine, but
now another will have the same problem in its JNDI
lookup.
Any idea why.
Thanks
....RanvirHi Ranvir,
Do you mean you try to reach the same datasource with different names or do you try to reach different datasources over the same port?
If you try the first issue you shouldn't get any trouble. At least it works fine with JBOSS for example.
But if you try to do the latter in my oppinion you don't have a JNDI problem but a problem with socket binding: the two different databases must be contacted over different ports.
What do WebSphere's logs tell?
Best regards
Andy -
Distributed Queue/JMX - JNDI lookup on startup fails
Hi,
I have a problem starting up Camel routes on a cluster via JMX. Although I have a NotificationListener registered that tries to startup the routes when the server sends a STATE=RUNNING lifecycle event, I cannot start the all Camel routes due to a "JMSException, Destination not found".
But, when I remote debug the application and put a breakpoint in, wait let's say 5 secs, then the JNDI lookup works and everything is fine.
I have unsuccessfully tried to play with the deployment order or my ear (by default the JMSServer is started with a priority of 1000), no luck. I have also put a poll method in, that waits until the JMSServer and the Destinations (=queues) are available, again no luck.
Anyone able to assist with that issue?
Best Regards,
SebastianI found the reason for the late binding. We are using "migratable target" in our cluster. When I remove the migratable target I have no issue whatsoever. Is there a way to either tweak the config or configure the Migratable targets in a way to by-pass this issue?
Regards,
Seb -
PortalRuntimeException: Failed in WD JNDI lookup.
Hi Experts
We are getting the following exception when we try to run our WD application in an iView :
com.sapportals.portal.prt.runtime.PortalRuntimeException: Failed in WD JNDI lookup. javax.naming.NameNotFoundException: No child found in WebDynproContext with name xxxxx.com
If we deploy and run our application as such on the server,it works fine.This issue comes only after we have integrated it in the iview.
Please provide some pointers.Hello Kunal
when you integrate it in an iView, pcd address/location should be there atttributes..i think it's missing
Bhudev -
Taking a long time to do JNDI lookup
Hi,
I have something like this for my JNDI lookup:
myEJBHome home = (myEJBHome) PortableRemoteObject.narrow(context.lookup("mybean") ,myEJBHome.class);
and
myEJB session = (myEJB)home.create();
Recently it's taking an EXTREMELY long time to do these 2 operations (before it took milliseconds, now it's like 10 minutes...but I haven't changed anything at all).
Any idea why?
ThanksIf the bean is in another machine more than likely the connection or firewall issue?
PC -
JNDI Lookup code for EntityMananger inside SessionBean
Hi ,
I am using JNDI look up inside my stateless session Bean for Thread Safety issues .
That is
@PersistenceContext(Unitname="someunit" name= "somename")
Context ctx = new InitialContext();
EntityManager em = (EntityManager)ctx.lookup("somename")Now i am having 4 methods for (CRUD) inside my sessionBean
Do i need to use this lookup code inside my every method that is in all my 4 methods
Please tell me this if i am having four methods inside my Session Bean do i need to do lookup inside each of my method.Thread safety issues? So you are saying that you actually had them, or you are assuming they will happen?
Because I have written multiple applications that simply inject an instance of the entity manager into the EJB and I have never had any problems. The whole idea of dependency injection is to minimize the need for manual JNDI lookups; why are you trying to swim against the current? -
Hi all,
I have 3 ear projects and 1 utility project.
1- utility jar
1- EJB
1- Web UI client for ejb
1 - MDB client for ejb
i am able to compile with out errors and started the server successfully.
As i go through the application and when i look up for the ejb bean i am getting the following error.
[10/12/07 16:41:27:035 CDT] 00000021 ServiceLogger I com.ibm.ws.ffdc.IncidentStreamImpl initialize FFDC0009I: FFDC opened incident stream file C:\Program Files\ibm\SDP70\runtimes\base_v61\profiles\AppSrv02\logs\ffdc\server1_7dc27dc2_07.10.12_16.41.27_0.txt
[10/12/07 16:41:27:051 CDT] 00000021 ServiceLogger I com.ibm.ws.ffdc.IncidentStreamImpl resetIncidentStream FFDC0010I: FFDC closed incident stream file C:\Program Files\ibm\SDP70\runtimes\base_v61\profiles\AppSrv02\logs\ffdc\server1_7dc27dc2_07.10.12_16.41.27_0.txt
[10/12/07 16:41:27:066 CDT] 00000021 BeanMetaData E CNTR0075E: The user-provided class "com.bcbsmn.claims.perconf.ejb.EJSStatelessPerConfinementServiceHomeBean_fcba446f" needed by the EnterpriseBean could not be found or loaded.
[10/12/07 16:41:27:332 CDT] 00000021 ServiceLogger I com.ibm.ws.ffdc.IncidentStreamImpl open FFDC0009I: FFDC opened incident stream file C:\Program Files\ibm\SDP70\runtimes\base_v61\profiles\AppSrv02\logs\ffdc\server1_7dc27dc2_07.10.12_16.41.27_1.txt
[10/12/07 16:41:27:379 CDT] 00000021 ServiceLogger I com.ibm.ws.ffdc.IncidentStreamImpl resetIncidentStream FFDC0010I: FFDC closed incident stream file C:\Program Files\ibm\SDP70\runtimes\base_v61\profiles\AppSrv02\logs\ffdc\server1_7dc27dc2_07.10.12_16.41.27_1.txt
[10/12/07 16:41:27:691 CDT] 00000021 ServiceLogger I com.ibm.ws.ffdc.IncidentStreamImpl open FFDC0009I: FFDC opened incident stream file C:\Program Files\ibm\SDP70\runtimes\base_v61\profiles\AppSrv02\logs\ffdc\server1_7dc27dc2_07.10.12_16.41.27_2.txt
[10/12/07 16:41:27:707 CDT] 00000021 ServiceLogger I com.ibm.ws.ffdc.IncidentStreamImpl resetIncidentStream FFDC0010I: FFDC closed incident stream file C:\Program Files\ibm\SDP70\runtimes\base_v61\profiles\AppSrv02\logs\ffdc\server1_7dc27dc2_07.10.12_16.41.27_2.txt
[10/12/07 16:41:27:723 CDT] 00000021 EJBContainerI E WSVR0068E: Attempt to start EnterpriseBean PerConfinementEARProject#PerConfinementEJBProject.jar#PerConfinementService failed with exception: com.ibm.ejs.container.ContainerException: Failed to initialize BeanMetaData instance; nested exception is:
java.lang.ClassNotFoundException: com.bcbsmn.claims.perconf.ejb.EJSStatelessPerConfinementServiceHomeBean_c3c0b315
at com.ibm.ejs.container.BeanMetaData.<init>(BeanMetaData.java:1433)
at com.ibm.ws.runtime.component.EJBContainerImpl.createBeanMetaData(EJBContainerImpl.java:1956)
at com.ibm.ws.runtime.component.EJBContainerImpl.createDeferredBeanMetaData(EJBContainerImpl.java:4600)
at com.ibm.ws.runtime.component.EJBContainerImpl.access$000(EJBContainerImpl.java:435)
at com.ibm.ws.runtime.component.EJBContainerImpl$3.run(EJBContainerImpl.java:4399)
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
at com.ibm.ws.runtime.component.EJBContainerImpl.initializeDeferredEJB(EJBContainerImpl.java:4396)
at com.ibm.ejs.container.HomeOfHomes.getHome(HomeOfHomes.java:345)
at com.ibm.ejs.container.HomeOfHomes.internalCreateWrapper(HomeOfHomes.java:481)
at com.ibm.ejs.container.EJSContainer.createWrapper(EJSContainer.java:4278)
at com.ibm.ejs.container.WrapperManager.faultOnKey(WrapperManager.java:528)
at com.ibm.ejs.util.cache.Cache.findAndFault(Cache.java:496)
at com.ibm.ejs.container.WrapperManager.keyToObject(WrapperManager.java:481)
at com.ibm.ejs.oa.EJSOAImpl.keyToObject(EJSOAImpl.java:553)
at com.ibm.ejs.oa.EJSRootOAImpl.keyToObject(EJSRootOAImpl.java:271)
at com.ibm.rmi.corba.ObjectManager.lookupServant(ObjectManager.java:104)
at com.ibm.CORBA.iiop.ServerDelegate.getServant(ServerDelegate.java:302)
at com.ibm.rmi.iiop.ORB.lookupLocalObject(ORB.java:591)
at com.ibm.CORBA.iiop.ORB.lookupLocalObject(ORB.java:1446)
at com.ibm.rmi.iiop.CDRInputStream.newObjRef(CDRInputStream.java:1298)
at com.ibm.rmi.iiop.CDRInputStream.read_Object(CDRInputStream.java:1275)
at com.ibm.rmi.iiop.CDRInputStream.read_Object(CDRInputStream.java:1239)
at com.ibm.rmi.corba.IorURL.iorbytesToObjref(IorURL.java:107)
at com.ibm.rmi.corba.IorURL.resolve(IorURL.java:95)
at com.ibm.rmi.corba.ORB.objectURLToObject(ORB.java:3677)
at com.ibm.CORBA.iiop.ORB.objectURLToObject(ORB.java:3227)
at com.ibm.rmi.corba.ORB.string_to_object(ORB.java:3578)
at com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.resolveUnresolvedBinding(WsnOptimizedNamingImpl.java:2154)
at com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.resolve_binding(WsnOptimizedNamingImpl.java:1895)
at com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.do_resolve_complete_info(WsnOptimizedNamingImpl.java:599)
at com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase.resolve_complete_info(WsnOptimizedNamingImplBase.java:2215)
at com.ibm.WsnOptimizedNaming._NamingContextStub.resolve_complete_info(_NamingContextStub.java:536)
at com.ibm.ws.naming.jndicos.CNContextImpl.cosResolve(CNContextImpl.java:4351)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1901)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1862)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt(CNContextImpl.java:1552)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:1354)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:172)
at javax.naming.InitialContext.lookup(InitialContext.java:363)
at com.bcbsmn.claims.perconf.managedbean.SearchBean.search(SearchBean.java:315)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:615)
at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:127)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:73)
at javax.faces.component.UICommand.broadcast(UICommand.java:312)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:298)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:412)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:77)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:220)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:91)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3129)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:238)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811)
at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1433)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:93)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:394)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:152)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:213)
at com.ibm.io.async.AbstractAsyncFuture.fireCompletionActions(AbstractAsyncFuture.java:195)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:194)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:741)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:863)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1510)
Caused by: java.lang.ClassNotFoundException: com.bcbsmn.claims.perconf.ejb.EJSStatelessPerConfinementServiceHomeBean_c3c0b315
at com.ibm.ws.classloader.CompoundClassLoader.findClass(CompoundClassLoader.java:472)
at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:373)
at java.lang.ClassLoader.loadClass(ClassLoader.java:561)
at com.ibm.ejs.container.BeanMetaData.loadExistedClass(BeanMetaData.java:3763)
at com.ibm.ejs.container.BeanMetaData.<init>(BeanMetaData.java:1329)
... 71 more
[10/12/07 16:41:27:973 CDT] 00000021 ServiceLogger I com.ibm.ws.ffdc.IncidentStreamImpl open FFDC0009I: FFDC opened incident stream file C:\Program Files\ibm\SDP70\runtimes\base_v61\profiles\AppSrv02\logs\ffdc\server1_7dc27dc2_07.10.12_16.41.27_3.txt
[10/12/07 16:41:27:988 CDT] 00000021 ServiceLogger I com.ibm.ws.ffdc.IncidentStreamImpl resetIncidentStream FFDC0010I: FFDC closed incident stream file C:\Program Files\ibm\SDP70\runtimes\base_v61\profiles\AppSrv02\logs\ffdc\server1_7dc27dc2_07.10.12_16.41.27_3.txt
[10/12/07 16:41:28:238 CDT] 00000021 ServiceLogger I com.ibm.ws.ffdc.IncidentStreamImpl open FFDC0009I: FFDC opened incident stream file C:\Program Files\ibm\SDP70\runtimes\base_v61\profiles\AppSrv02\logs\ffdc\server1_7dc27dc2_07.10.12_16.41.28_0.txt
[10/12/07 16:41:28:254 CDT] 00000021 ServiceLogger I com.ibm.ws.ffdc.IncidentStreamImpl resetIncidentStream FFDC0010I: FFDC closed incident stream file C:\Program Files\ibm\SDP70\runtimes\base_v61\profiles\AppSrv02\logs\ffdc\server1_7dc27dc2_07.10.12_16.41.28_0.txt
[10/12/07 16:41:28:504 CDT] 00000021 ServiceLogger I com.ibm.ws.ffdc.IncidentStreamImpl open FFDC0009I: FFDC opened incident stream file C:\Program Files\ibm\SDP70\runtimes\base_v61\profiles\AppSrv02\logs\ffdc\server1_7dc27dc2_07.10.12_16.41.28_1.txt
[10/12/07 16:41:28:519 CDT] 00000021 ServiceLogger I com.ibm.ws.ffdc.IncidentStreamImpl resetIncidentStream FFDC0010I: FFDC closed incident stream file C:\Program Files\ibm\SDP70\runtimes\base_v61\profiles\AppSrv02\logs\ffdc\server1_7dc27dc2_07.10.12_16.41.28_1.txt
[10/12/07 16:41:28:754 CDT] 00000021 ServiceLogger I com.ibm.ws.ffdc.IncidentStreamImpl open FFDC0009I: FFDC opened incident stream file C:\Program Files\ibm\SDP70\runtimes\base_v61\profiles\AppSrv02\logs\ffdc\server1_7dc27dc2_07.10.12_16.41.28_2.txt
[10/12/07 16:41:28:848 CDT] 00000021 ServiceLogger I com.ibm.ws.ffdc.IncidentStreamImpl resetIncidentStream FFDC0010I: FFDC closed incident stream file C:\Program Files\ibm\SDP70\runtimes\base_v61\profiles\AppSrv02\logs\ffdc\server1_7dc27dc2_07.10.12_16.41.28_2.txt
[10/12/07 16:41:29:066 CDT] 00000021 ServiceLogger I com.ibm.ws.ffdc.IncidentStreamImpl open FFDC0009I: FFDC opened incident stream file C:\Program Files\ibm\SDP70\runtimes\base_v61\profiles\AppSrv02\logs\ffdc\server1_7dc27dc2_07.10.12_16.41.29_0.txt
[10/12/07 16:41:29:113 CDT] 00000021 ServiceLogger I com.ibm.ws.ffdc.IncidentStreamImpl resetIncidentStream FFDC0010I: FFDC closed incident stream file C:\Program Files\ibm\SDP70\runtimes\base_v61\profiles\AppSrv02\logs\ffdc\server1_7dc27dc2_07.10.12_16.41.29_0.txt
[10/12/07 16:41:29:113 CDT] 00000021 Helpers W NMSV0610I: A NamingException is being thrown from a javax.naming.Context implementation. Details follow:
Context implementation: com.ibm.ws.naming.jndicos.CNContextImpl
Context method: lookupExt
Context name: BCBSMN79477Node02Cell/nodes/BCBSMN79477Node02/servers/server1
Target name: com/bcbsmn/claims/perconf/PerConfinementService
Other data: ""
Exception stack trace: javax.naming.NamingException: Error during resolve [Root exception is org.omg.CORBA.portable.UnknownException: vmcid: 0x0 minor code: 0 completed: Maybe]
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1939)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1862)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt(CNContextImpl.java:1552)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:1354)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:172)
at javax.naming.InitialContext.lookup(InitialContext.java:363)
at com.bcbsmn.claims.perconf.managedbean.SearchBean.search(SearchBean.java:315)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:615)
at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:127)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:73)
at javax.faces.component.UICommand.broadcast(UICommand.java:312)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:298)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:412)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:77)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:220)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:91)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3129)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:238)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811)
at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1433)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:93)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:394)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:152)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:213)
at com.ibm.io.async.AbstractAsyncFuture.fireCompletionActions(AbstractAsyncFuture.java:195)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:194)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:741)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:863)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1510)
Caused by: org.omg.CORBA.portable.UnknownException: vmcid: 0x0 minor code: 0 completed: Maybe
at com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.resolveUnresolvedBinding(WsnOptimizedNamingImpl.java:2193)
at com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.resolve_binding(WsnOptimizedNamingImpl.java:1895)
at com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.do_resolve_complete_info(WsnOptimizedNamingImpl.java:599)
at com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase.resolve_complete_info(WsnOptimizedNamingImplBase.java:2215)
at com.ibm.WsnOptimizedNaming._NamingContextStub.resolve_complete_info(_NamingContextStub.java:536)
at com.ibm.ws.naming.jndicos.CNContextImpl.cosResolve(CNContextImpl.java:4351)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1901)
... 38 moreCan any body tell me what's wrong with it? i have seen all the stubs generated it is looking for but not able to load/recognize it? And also i need to mention other problem is that everytime i compile, deploy and start the server i am getting open failure exception and server not recognizing the ejb jar and if i close and restart the RSA server starts well.
Pls help me in solving this issue.Hi All
Two separate webapps, have different names for
Datasources, on the same host and port. Both
application work fine independently.
When we deploy both applications on the same app
server(websphere), whichever we executes first gets
its datasource from JNDI lookup and works fine, but
when we try second application it have problem in
finding its data source from JNDI lookup. If we start
this second application first, it will work fine, but
now another will have the same problem in its JNDI
lookup.
Any idea why.
Thanks
....RanvirHi Ranvir,
Do you mean you try to reach the same datasource with different names or do you try to reach different datasources over the same port?
If you try the first issue you shouldn't get any trouble. At least it works fine with JBOSS for example.
But if you try to do the latter in my oppinion you don't have a JNDI problem but a problem with socket binding: the two different databases must be contacted over different ports.
What do WebSphere's logs tell?
Best regards
Andy -
UserTransaction - Scope using JNDI lookup from jspInit() method
Howdy,
I'm using JSP's with JavaBeans accessing a DataSource and some other enviroment variables using JNDI lookups. I've read that JNDI lookups can take a fair amount of time and should be limited whenever possible. My previous configuration had the JNDI lookups inside the constructors of the JavaBeans but I've recently decided to move them to the jspInit() method of the calling JSP. This way the lookup only needs to be performed once and then I pass the values to the JavaBean in a method called setContextVariables. Two of the references to objects that i'm sending are the UserTransaction and DataSource objects. Within the Javabeans I have userTran.begin() and commit() statements. So far it's running great but i'm starting to wonder about the thread safety of this method. My question lies in the actual delagation of the UserTransaction object to the calling client method. It seems that i'm passing the same transaction to every Javabean (or am I?) Is the transaction actually issued when the begin() method is called, or at the time of the JNDI lookup? To test everything out, I opened two sessions and put a breakpoint inside one of the transactions. When I stopped at the breakpoint I ran another thread (also using a transaction retrieved from the same JSP). Then I went back and resumed the first thread and everything seemed to work ok. So... this seems completely fantabulastic so far (definitely noticable response time increases) but I'm still a little skeptical. If anyone is using a process similar to this I would appreciate some feedback. Thanks.Hi,
The EJB bean will use the client transaction when the following attributes are specified in descriptor.
1) Required
2) Mandatory
3) Supports
In Required case, if the client is associated with Transaction, then the EJB bean will use the same transaction. This is achieved by Transaction context. The EJB bean will use the same transaction context set by client. if the client doesn't have any transaction, then the container will create new transaction context for EJB bean and completes the transaction.
In Mandatory case, the client must be associated with Transaction so that EJB bean will use the same transaction. If the client doesn't associate with transaction, then container will throw TransactionRequiredException for EJB bean.
In Supports case, it works similar to Required case except that if the client doesn't associate with transaction, then there won't be any transaction in EJB bean.
hope this helps.
Maybe you are looking for
-
Help needed in tuning a complex query
Hi, I am running Oracle 9i on Solaris 9. I have the following query that's running for more than 20 hours and not finishing. I am attaching TOAD explain plan and number of records of the tables. If somebody can give some ideas, I will really apprecia
-
PC Suite 6.86.9.0 - Error resetting the unread fla...
Entering the PC suite Nokia Phone Browser inbox will reset the unread flag for ALL messages on the phone. This shouldn't happen before selecting each of the SMS-messages!? The unread flag seems to be correct entering the Phone Browser, but the flags
-
Photoshop CS3 crashes when opening documents
Hi, whenever I try to open a document in Photoshop it quits on me. I can open any document if I go through Bridge. I have uninstalled my whole Creative Suite and installed it again, this time without Version Cue. Still, when I go to Open and double c
-
Hi, IDOC with same basic type will overwrite with each other when we import from SAP to XI? Eventh the extension type and Idoc type are different.
-
Render sky with Cinema 4d Lite in After Effects
Can somebody explain how in my final render in After Effects, the sky is visible?