Javax.naming.NameNotFoundException during a lookup() call.
I am getting this exception when I try to get a reference to my Local Entity bean from within a Remote Session bean.
( I did a search in these forums, and found a few topics similar to mine. However, those that were similar were unfortunately still unresolved).
I have a Session Bean with a Remote interface (ExecutionReportOperator),
and an Entity Bean with a local interface (ExecutionReport). It is deployed in JBoss, here is output that indicates successful deployment:
INFO [EjbModule] Deploying ExecutionReport
INFO [EjbModule] Deploying ExecutionReportOperator
INFO [BaseLocalProxyFactory] Bound EJB LocalHome 'ExecutionReport' to jndi 'local/ExecutionReport@4199584'
INFO [ProxyFactory] Bound EJB Home 'ExecutionReportOperator' to jndi 'ExecutionReportOperator'
INFO [EJBDeployer] Deployed: file:/C:/Program Files/jboss-4.0.3SP1/server/default/deploy/ExecReportingEJBs.jar
Now, within my Session bean, I'm trying to get a reference to the Home interface of my Entity bean:
private ExecutionReportHome getExecutionReportHomeObject()
throws NamingException {
InitialContext ic = new InitialContext();
ExecutionReportHome erh = (ExecutionReportHome) ic.lookup("ExecutionReport");
return erh;
However this throws a Naming exception. I guess the string I'm sending in to the lookup() method needs to be adjusted/modified. I've tried "local/ExecutionReport" as well as the full package name, no luck. Does anyone know what the string should look like?
Here are the contents of my ejb-jar.xml file:
<enterprise-beans>
<session>
<ejb-name>ExecutionReportOperator</ejb-name>
<home>com.fanfare.server.execReporting.beans.session.ExecutionReportOperatorHome</home>
<remote>com.fanfare.server.execReporting.beans.session.ExecutionReportOperator</remote>
<ejb-class>com.fanfare.server.execReporting.beans.session.ExecutionReportOperatorBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
<entity>
<ejb-name>ExecutionReport</ejb-name>
<local-home>com.fanfare.server.execReporting.beans.entity.ExecutionReportHome</local-home>
<local>com.fanfare.server.execReporting.beans.entity.ExecutionReport</local>
<ejb-class>com.fanfare.server.execReporting.beans.entity.ExecutionReportBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
<reentrant>false</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>ExecutionReport</abstract-schema-name>
...
Some additional info: Just to test, I created a Remote interface for my Entity bean and deployed it to JBoss. Once I did that, I was able to successfully locate the Local object without any Naming exceptions. (No code changes to my original function, just created the Remote interface and deployed it).
Hope this extra information is useful.
Similar Messages
-
Javax.naming.NameNotFoundException: error in whil calling EJB Bean
Dear friends,
I have created (Bean Managed Entity) a remote,home and bean objects for adding a country in a database. When i convert
into jar and and deploy means, its working fine. But if i put into a package means it does work
and raise "javax.naming.NameNotFoundException" error.
i keep my files as following folder structure
d:\siva\projects\ShopCart\
(under this )
CountryMas.java
CountryHome.java
CountryBean.java
CountryMasPK.java
<meta-inf>
ejb-jar.xml
weblogic-ejb-jar.xml
and deployed in weblogic 6.1 using console.
i have copied the source code here with
Remote interface
package ShopCart;
import javax.ejb.*;
import javax.rmi.*;
public interface CountryMas extends EJBObject {
Home Interface
package ShopCart;
import javax.ejb.*;
import java.rmi.*;
public interface CountryHome extends EJBHome {
public CountryMas create(String Cname) throws CreateException,RemoteException;
public CountryMas findByPrimaryKey(CountryMasPK pk) throws
FinderException,RemoteException;
BEAN OBJECT
package ShopCart;
import java.io.*;
import java.util.*;
import java.sql.*;
import javax.sql.*;
import javax.ejb.*;
import javax.naming.*;
public class CountryBean implements EntityBean {
private EntityContext ctx;
private int CountryId;
private String CountryName;
public void setEntityContext(EntityContext ctx){
this.ctx = ctx;
public void unsetEntityContext(){
this.ctx = null;
public void ejbActivate(){
public void ejbPassivate(){
public void ejbLoad(){
public void ejbStore(){
public void ejbRemove(){
Connection con = null;
PreparedStatement ps = null ;
try {
con = getConnection();
ps = con.prepareStatement("Delete from CountryMas where id=?");
ps.setInt(1,CountryId);
if (ps.executeUpdate() !=1) {
String Error = "JDBC did not create any row";
throw new CreateException (Error);
}catch (Exception e){
System.out.println (e);
public CountryMasPK ejbCreate(String Cname) throws CreateException {
this.CountryName =Cname;
Connection con = null;
PreparedStatement ps = null ;
try {
con = getConnection();
ps = con.prepareStatement("insert into CountryMas values(?)");
ps.setString (1,CountryName);
if (ps.executeUpdate() !=1) {
String Error = "JDBC did not delete any row";
throw new CreateException (Error);
con.commit();
}catch (Exception e){
System.out.println (e);
int PKid=0;
ResultSet rs;
PreparedStatement ps1 = null;
try {
ps1 = con.prepareStatement("select max(id) as Mid from CountryMas");
rs = ps1.executeQuery();
PKid = rs.getInt("mid");
}catch(Exception e){
System.out.println (e);
return new CountryMasPK(PKid);
public void ejbPostCreate(String Cname) throws CreateException {
private Connection getConnection()throws SQLException {
InitialContext initCtx = null;
DataSource ds = null;
try{
initCtx = new InitialContext ();
ds = (javax.sql.DataSource)
initCtx.lookup("java:comp/env/jdbc/ShopCartPool");
}catch(Exception e){
System.out.println(e);
return ds.getConnection();
public CountryMasPK ejbFindByPrimaryKey(CountryMasPK pk)throws ObjectNotFoundException {
Connection con= null;
PreparedStatement ps = null ;
try{
con = getConnection();
ps = con.prepareStatement("select cname from CountryMas where id=?");
ps.setInt(1,pk.ID);
ps.executeQuery();
ResultSet rs= ps.getResultSet();
if (rs.next()){
this.CountryName = rs.getString(1);
}catch(Exception e){
System.out.println(e);
//return new CountryMasPK(pk.i);
return pk;
PRIMARY KEY OBJECT
package ShopCart;
import java.io.Serializable;
public class CountryMasPK implements java.io.Serializable {
public int ID;
public CountryMasPK(int ID){
this.ID =ID;
public CountryMasPK(){
public CountryMasPK(CountryMasPK pk){
this.ID = pk.ID;
public String toString(){
return new Integer(ID).toString();
public int hashCode(){
return new Integer(ID).hashCode();
public boolean equals(Object countrymas){
//return ((CountryMasPK)countrymas).ID.equals(ID);
return true;
EJB-JAR.XML
<?xml version="1.0"?>
<!DOCTYPE ejb-jar PUBLIC
'-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN'
'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
<ejb-jar>
<enterprise-beans>
<entity>
<ejb-name>ShopCart</ejb-name>
<home>ShopCart.CountryHome</home>
<remote>ShopCart.CountryMas</remote>
<ejb-class>ShopCart.CountryBean</ejb-class>
<persistence-type>Bean</persistence-type>
<prim-key-class>ShopCart.CountryMasPK</prim-key-class>
<reentrant>False</reentrant>
<resource-ref>
<res-ref-name>jdbc/ShopCartPool</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</entity>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>ShopCart</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
WEBLOGIC-EJB-JAR.XML
<?xml version="1.0"?>
<!DOCTYPE weblogic-ejb-jar PUBLIC
'-//BEA Systems, Inc.//DTD WebLogic 6.0.0 EJB//EN'
'http://www.bea.com/servers/wls600/dtd/weblogic-ejb-jar.dtd'>
<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>ShopCart</ejb-name>
<reference-descriptor>
<resource-description>
<res-ref-name>jdbc/ShopCartPool</res-ref-name>
<jndi-name>ShopCartDataSource</jndi-name>
</resource-description>
</reference-descriptor>
<jndi-name>Country</jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>
i converted jar file like this
d:\siva\projects\> set claapath=%classpath%;.;
cd d:\siva\projects\ShopCart > javac *.java
cd d:\siva\projects\ShopCart > jar -cvf Sh.jar *
cd..
d:\siva\projects> java weblogic.ejbc ShopCart\Sh.jar ShopCart\Shop.jar
and deployed using weblogic 6.1 console
and client code as follows
Client.java
import java.io.*;
import javax.naming.*;
import javax.ejb.*;
import javax.rmi.*;
import java.util.*;
import ShopCart.*;
class Client {
public static void main(String args[]){
Context ctx=null;
try{
Properties pr = new Properties();
pr.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
pr.put(Context.PROVIDER_URL,"t3://localhost:7001");
ctx= new InitialContext(pr);
Object obj = ctx.lookup("Country");
CountryHome cm = (CountryHome)
javax.rmi.PortableRemoteObject.narrow(obj,CountryHome.class);
cm.create(args[0]);
System.out.println ("Creating Country " + args[0] +" ..... [Done]");
}catch (Exception e){
System.out.println(e);
when i run this file it raise the error
D:\Siva\Projects>java Client.java
Exception in thread "main" java.lang.NoClassDefFoundError: Client/java
D:\Siva\Projects>java Client
javax.naming.NameNotFoundException: Unable to resolve Country. Resolved: '' Unre
solved:'Country' ; remaining name ''
D:\Siva\Projects>
This is the error message. Please observe it and do let me know what would be the error. There
would be small configuration error. But i couldn't locate it . plz help me somebody.
Thanx & Regards,
Siva.you need to use the name java:comp/env/Country in the client.
and the client deployment descriptor will need an ejb-ref entry:
<ejb-ref>
<ejb-ref-name>
Country
</ejb-ref-name>
<ejb-ref-type>
Session
</ejb-ref-type>
<home>
ShopCart.CountryHome
</home>
<remote>
ShopCart.CountryMas
</remote>
</ejb-ref>toby -
JNDI lookup failed:javax.naming.NameNotFoundException
Hello:
I have a application (not web) that publish messages to a specific topic, i want to receive these messages in a Web Service, but when the web service make the call to a class that is the JMS Client it can't find the Connection factory Name that i create in the aplication.
I want to know what i have to do,
I work with J2EE1.3.1 and JMS1.0.2 for the application that publish the messages
and Jwsdp1.1, tomcat 4 and j2sdk 1.4.0 for the web service.
I create the connection factory with this command:
j2eeadmin -addJmsFactory jms/DurableTopicB topic -props clientID=IdTopicB
Then in the class that the web service invoke i trying to join with this:
try {
jndiContext =new InitialContext();
}catch (NamingException e){
System.err.println("Could not create JNDI API "+
"context:"+e.toString());
return;
*Look up connection factory and topic.If either
*does not exist,exit.
try {
topicConnectionFactory =(TopicConnectionFactory)
jndiContext.lookup(conFacName);
}catch (NamingException e){
System.err.println("JNDI API lookup failed:"+
e.toString());
return;
//System.exit(1);
But i receive a error message in the log of Tomcat:
JNDI API lookup failed:javax.naming.NameNotFoundException: El nombre DurableTopicB no este asociado a este contexto
ThanksHello:
I display the full context of the connection factory in the application that publish the message:
Full context is :
Enviroment is : {java.naming.corba.orb=com.sun.enterprise.iiop.POAEJBORB@ec4a87}
And in the web service when i create the initial context the full context is:
Full context is : java:
Enviroment is : {java.naming.factory.initial=org.apache.naming.java.javaURLContextFactory, java.naming.factory.url.pkgs=org.apache.naming}
How can i see the connection factory in the Web Service, because the connection factory was created in other Application? -
JNDI lookup from OC4J to weblogic throws javax.naming.NameNotFoundException
Hi All,
We have the below setup in our production environment.
EJB application is deployed in the Weblogic 10.3.4.0 Server on Sun Solaris. The EJB version is 3.0
OC4J 10.2.0 is running on another Sun Solaris machine.
There are 2 webservice applications WEBSERV1 & TestSoapEJB running on this OC4J container.
We need to do lookup the EJBs deployed on the Weblogic server. For this we used the below logic in the web service's Stateless session bean:
String weblogicURL = "";
Properties props = new Properties();
try
props.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("wl.properties"));
weblogicURL = props.getProperty("weblogicURL");
catch (FileNotFoundException e)
e.printStackTrace();
catch (IOException e)
e.printStackTrace();
Context ctx = null;
Hashtable ht = new Hashtable();
ht.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
ht.put(Context.SECURITY_PRINCIPAL,"weblogic");
ht.put(Context.SECURITY_CREDENTIALS,"weblogic654");
ht.put(Context.PROVIDER_URL, weblogicURL);
ctx = NamingManager.getInitialContext(ht) ;
// tried using //ctx = new InitialContext(ht); same behavior.
TestEJB.AdministratorEJB ejb = (TestEJB.AdministratorEJB) ctx.lookup("TestEJB#TestEJB.AdministratorEJB");
ctx.close();
When we first test first WEBSER1, the lookup is fine.
But when we test the second webservice WEBSER2, the webservice name itself not able to lookup: It gives the below error:
javax.naming.NameNotFoundException: remaining name: env/TestSoapEJB
Below is the stack throws thrown on browser:
500 Internal Server Error
javax.naming.NameNotFoundException: remaining name: env/TestSoapEJB
at weblogic.j2eeclient.SimpleContext.resolve(SimpleContext.java:35)
at weblogic.j2eeclient.SimpleContext.resolve(SimpleContext.java:39)
at weblogic.j2eeclient.SimpleContext.lookup(SimpleContext.java:59)
at weblogic.j2eeclient.SimpleContext.lookup(SimpleContext.java:59)
at weblogic.j2eeclient.SimpleContext.lookup(SimpleContext.java:64)
at weblogic.jndi.factories.java.ReadOnlyContextWrapper.lookup(ReadOnlyContextWrapper.java:45)
at weblogic.jndi.internal.AbstractURLContext.lookup(AbstractURLContext.java:130)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at oracle.j2ee.ws.SessionBeanRpcWebService.init(SessionBeanRpcWebService.java:65)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpApplication.loadServlet(HttpApplication.java:2354)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpApplication.findServlet(HttpApplication.java:4795)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpApplication.getRequestDispatcher(HttpApplication.java:2821)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:680)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:285)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:126)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
at java.lang.Thread.run(Thread.java:662)
It seems that, the OC4J is looking in Weblogic context. But it should be looking in its own context. How to resolve this issue.
The same case happens if i restart the OC4J and first test the TestSoapEJB the lookup is fine . But if i test the WEBSERV1 , it throws the same error as above. In short, if one of the webservices lookup is working fine, the other webservice is not working. At the same time only one webservice's lookup is working.
Kindly help me to resolve this issue.
regards,
Zia
Edited by: PT Expert on Sep 9, 2012 3:16 AMI work now more that two days on this error!!!
-> I remade my complete jdev project, it did not work!
-> I deleted the jdev/system/j2ee/oc4j/workspace dir
-> I search for some .lock files
-> and many more tries!!! But without success...
Is there a way to reset the Embedded OC4J? -
Hi
I use JDev Studio 10.1.3.40.66 and EJB 3.0 with annotations. I am working in the same Project (Model) with two stateless beans and some entities. In the same Project I have one test-client which implemented the lookup.
Here a snippet of the EJB:
@Stateless( name = "MyDao" )
public class MyDaoImpl implements IMyDao {
... }Here piece of code out of test-client:
final Context context = getInitialContext();
IMyDao iMyDao = (IMyDao)context.lookup("MyDao");Now everything worked fine and nobody changed anything in the project. So it may be that after a "power off" and a restart I couldn't find my EJBs with the lookup?!
Here is what I get from OC4J log:
07/04/02 10:32:09 FEIN: TxSecIORInterceptor.addCSIv2Components Unable to obtain mutual auth port
07/04/02 10:32:09 FEIN: TxSecIORInterceptor.addCSIv2Components UnknownType exceptioncom.sun.corba.ee.spi.legacy.interceptor.UnknownType
(Here is some more stack trace!)
FEIN: [current-workspace-app:Azima_AzimaModel_0] Initializing EntityManagerFactory named Azima-local with persistence provider oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.
07/04/02 10:32:13 WARNUNG: Application.setConfig Application: current-workspace-app is in failed state as initialization failed.
java.lang.LinkageError: loader constraints violated when linking javax/persistence/spi/PersistenceUnitInfo class
Checking that EJBs were successfully deployed in embedded OC4J...
All EJBs are successfully deployed.From my test-client log I get:
javax.naming.NameNotFoundException: MyDao not found
at com.evermind.server.rmi.RMIClientContext.lookup(RMIClientContext.java:52)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at com.promatis.azima.model.test.Client.main(Client.java:390)
...So I couldn't test my EJB anymore. If you have some suggestions or if you need more information about my project just post...
I need some help with this problem!
ThanksI work now more that two days on this error!!!
-> I remade my complete jdev project, it did not work!
-> I deleted the jdev/system/j2ee/oc4j/workspace dir
-> I search for some .lock files
-> and many more tries!!! But without success...
Is there a way to reset the Embedded OC4J? -
Hi All,
Am using jdeveloper 11.1.1.6. Am trying to send a mail through ADF
I have verfied the link which given below and trying to do the same.
http://adfblogs.blogspot.in/2012/01/sending-e-mail-from-adf-application.html
While am pressing the send button am getting the exception as
<LifecycleImpl> <_handleException> ADF_FACES-60098:Faces lifecycle receives unhandled exceptions in phase INVOKE_APPLICATION 5
javax.faces.el.EvaluationException: javax.naming.NameNotFoundException: While trying to lookup 'mail.NewMailSession' didn't find subcontext 'mail'. Resolved ''; remaining name 'mail/NewMailSession'
at org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:58)
at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodBinding(UIXComponentBase.java:1256)
at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:183)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeApplication(LifecycleImpl.java:889)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:379)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:194)
Could any one pls help me to resolve it?I had restarted the weblogic server even though am getting the same error
javax.naming.NameNotFoundException: While trying to lookup 'mail.NewMailSession' didn't find subcontext 'mail'. Resolved ''; remaining name 'mail/NewMailSession'
at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1139)
at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.java:247)
at weblogic.jndi.internal.ServerNamingNode.lookupHere(ServerNamingNode.java:182)
at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:206)
at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:254)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:411)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at Mail.SendAction(Mail.java:49)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.el.parser.AstValue.invoke(Unknown Source)
at com.sun.el.MethodExpressionImpl.invoke(Unknown Source) -
hi,
i have installed hr schema and created a page with a table.when i run the page,
i am getting javax.naming.NameNotFoundException: While trying to lookup 'jdbc.SampleHR1DS' didn't find subcontext 'jdbc'. Resolved ''; remaining name 'jdbc/SampleHR1DS'
Do i need to create data source for this.How to resolve this.
i am using 11.1.2.4.0 jdevthere are multiple option of creating data source.which one i should use.
should i use generic one. what is URL information for oracle xe client.what is driver name? -
Javax.naming.NameNotFoundException while trying to lookup for the Datasourc
I get following exception when the datasource is looked up after redeployment.
javax.naming.NameNotFoundException: Unable to resolve 'jdbc.oracleDS' Resolved: '' Unresolved:'jdbc' ; remaining name 'jdbc.oracleDS'
But after redeployment if I restart the application server, this problem gets resolved automatically and I am able to get the connection.
So is there any specific configuration, so that I can access the Database connections without restarting the servers after re-deployment?
Connection Pool and DataSource are targetted to a Cluster.
Please let me know if there is any solution for this.
Thanks in advance !there are multiple option of creating data source.which one i should use.
should i use generic one. what is URL information for oracle xe client.what is driver name? -
URGENT - javax.naming.NameNotFoundException No object bound to name
I'm working on a stateless EJB (JobDtlEJB) which calls another stateless EJB (FuncVSREJB). During runtime, the following message appear in application log:
[20/Feb/2006:00:16:56] INFO ( 2088): CORE3282: stdout: EJBGetter:getFuncVSRHome-to lookup[java:comp/env/ejb/funcvsr]
[20/Feb/2006:00:16:56] INFO ( 2088): CORE3282: stdout: [2006/02/21 00:16] {-VoiceSROut}
[20/Feb/2006:00:16:56] INFO ( 2088): CORE3282: stdout: JobDtlEJB exception FuncVSR:javax.naming.NameNotFoundException: No object bound to name java:comp/env/ejb/funcvsr
Would appreciate if anyone kind help!!!
Below is my portion of codes in JobDtlEJB:
import com.util.EJBGetter;
public class JobDtlEJB implements javax.ejb.SessionBean {
private transient javax.ejb.SessionContext m_ctx = null;
private FuncVSRHome myfuncvsrHome;
private FuncVSR myfuncvsrRemote;
public void ejbCreate() throws javax.ejb.CreateException {
System.out.println("ejbCreate() on obj " + this);
public String getConnect(String InjobID) {
try
myfuncvsrHome = EJBGetter.getFuncVSRHome("java:comp/env/ejb/funcvsr");
myfuncvsrRemote = myfuncvsrHome.create();
} catch(Exception ee) {
cFunction.NonIMErrLog("-VoiceSROut", "JobDtlEJB exception FuncVSR:"+ee.toString(), true);
ee.printStackTrace();
Coding inside EJBGetter:
package com.util;
import javax.rmi.PortableRemoteObject;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import com.ejb.*;
public final class EJBGetter {
public static FuncVSRHome getFuncVSRHome(String jndiName) throws NamingException
InitialContext initial = new InitialContext();
System.out.println("EJBGetter:getFuncVSRHome-to lookup["+jndiName+"]");
Object objref = initial.lookup( jndiName );
System.out.println("EJBGetter:getFuncVSRHome-narrow["+jndiName+"]");
FuncVSRHome ejb2Home = ( FuncVSRHome ) PortableRemoteObject.narrow( objref, FuncVSRHome.class );
System.out.println("EJBGetter:getFuncVSRHome-returning EJB Home for ["+jndiName+"]");
return ejb2Home;
} // EJBGetter
Below is my ejb-jar.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
<ejb-jar>
<enterprise-beans>
<session>
<display-name>TheFuncVSR</display-name>
<ejb-name>TheFuncVSR</ejb-name>
<home>com.ejb.FuncVSRHome</home>
<remote>com.ejb.FuncVSR</remote>
<ejb-class>com.ejb.FuncVSREJB</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Bean</transaction-type>
</session>
<session>
<display-name>TheJobDtl</display-name>
<ejb-name>TheJobDtl</ejb-name>
<home>com.ejb.JobDtlHome</home>
<remote>com.ejb.JobDtl</remote>
<ejb-class>com.ejb.JobDtlEJB</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Bean</transaction-type>
</session>
</enterprise-beans>
</ejb-jar>
THe following is my sun-ejb-jar.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sun-ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Sun ONE Application Server 7.0 EJB 2.0//EN' 'http://www.sun.com/software/sunone/appserver/dtds/sun-ejb-jar_2_0-0.dtd'>
<!-- Copyright 2002 Sun Microsystems, Inc. All rights reserved. -->
<sun-ejb-jar>
<enterprise-beans>
<unique-id>1</unique-id>
<ejb>
<ejb-name>TheJobDtl</ejb-name>
<jndi-name>jobdtl</jndi-name>
</ejb>
<ejb>
<ejb-name>TheFuncVSR</ejb-name>
<jndi-name>funcvsr</jndi-name>
</ejb>
</enterprise-beans>
</sun-ejb-jar>
The web.xml file content:
<ejb-ref>
<ejb-ref-name>ejb/jobdtl</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>com.ejb.JobDtlHome</home>
<remote>com.ejb.JobDtl</remote>
<ejb-link>TheJobDtl</ejb-link>
</ejb-ref>
<ejb-ref>
<ejb-ref-name>ejb/funcvsr</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>com.ejb.FuncVSRHome</home>
<remote>com.ejb.FuncVSR</remote>
<ejb-link>TheFuncVSR</ejb-link>
</ejb-ref>
</web-app>I've solved this issue in ejb-jar.xml. This is because of <ejb-ref-name> in ejb-jar.xml is unmatched with that in web.xml
<ejb-ref-name>ejb/funcvsr</ejb-ref-name>
Jsut sharing to you all. :) -
Javax.naming.NameNotFoundException using Spring with EJB3 and Weblogic 10
I'm deploying an EAR application from Weblogic 10 Administration Console... This
EAR has two modules: an EJB3 module, and a Web module. The deploy process finish,
but the status of the application is "Failed"... then in the log I get the
following error:
User defined listener
org.springframework.web.context.ContextLoaderListener failed:
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'gruposUnidadesServiceFacade' defined in class path resource
[http://applicationContext.xml]: Invocation of init method failed; nested exception is
javax.naming.NameNotFoundException: Unable to resolve
'GruposUnidadesService'. Resolved ''; remaining name 'GruposUnidadesService'.
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'gruposUnidadesServiceFacade' defined in class path resource
[http://applicationContext.xml]: Invocation of init method failed; nested exception is
javax.naming.NameNotFoundException: Unable to resolve 'GruposUnidadesService'. Resolved
''; remaining name 'GruposUnidadesService' at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1260)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:438)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:383)
at java.security.AccessController.doPrivileged(Native Method) at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:353)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:245)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:169)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:242)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:394)
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:736)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:369)
at
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:261)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
at
weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:465)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source) at
weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:175)
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1784)
at
weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:2999)
at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1371)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:468) at
weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
at
weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
at
weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
at
weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:117)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
at
weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
at
weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
at
weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)
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)
javax.naming.NameNotFoundException: Unable to resolve 'GruposUnidadesService'. Resolved
''; remaining name 'GruposUnidadesService' at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1139)
at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.java:252)
at
weblogic.jndi.internal.ServerNamingNode.lookupHere(ServerNamingNode.java:182)
at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:206) at
weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:254)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:380) at
javax.naming.InitialContext.lookup(InitialContext.java:392) at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:132)
at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:88) at
org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:130) at
org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:155) at
org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:93)
at
org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:105)
at org.springframework.ejb.access.AbstractRemoteSlsbInvokerInterceptor.lookup(AbstractRemoteSlsbInvokerInterceptor.java:97)
at
org.springframework.ejb.access.AbstractSlsbInvokerInterceptor.refreshHome(AbstractSlsbInvokerInterceptor.java:105)
at org.springframework.ejb.access.AbstractSlsbInvokerInterceptor.afterPropertiesSet(AbstractSlsbInvokerInterceptor.java:92)
at
org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean.afterPropertiesSet(SimpleRemoteStatelessSessionProxyFactoryBean.java:99)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1288)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1257)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:438)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:383)
at java.security.AccessController.doPrivileged(Native Method) at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:353)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:245)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:169)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:242)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:394)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:736)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:369)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:261)
at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
at
weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:465)
at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source) at
weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:175)
at
weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1784)
at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:2999)
at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1371)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:468) at
weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
at
weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
at
weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:117)
at
weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
at
weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
at
weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)
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)
This my EJB3 bean code:
@Stateless(name="GruposUnidadesService",
mappedName="GruposUnidadesService")
public
class GruposUnidadesServiceBean implements GruposUnidadesService,
GruposUnidadesServiceLocal {
In the mappedName I have tried different ways like: "ejb/GruposUnidadesService"
but I always get the same exception.
This is my weblogic-ejb-jar.xml
<?xml version = '1.0' encoding =
'windows-1252'?>
<!DOCTYPE weblogic-ejb-jar PUBLIC "-//BEA
Systems, Inc.//DTD WebLogic 8.1.0 EJB//EN"
"http://www.bea.com/servers/wls810/dtd/weblogic-ejb-jar.dtd">
<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>GruposUnidadesService</ejb-name>
<enable-call-by-reference>true</enable-call-by-reference>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>
In the web module, I have Spring with MyFaces, in my applicationContext.xml
I have:
<?xml version="1.0"
encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD
BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="gruposUnidadesServiceFacade" class="org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean">
<property name="jndiName"
value="GruposUnidadesService"/>
<property name="businessInterface" value="penoles.infraestructura.web.servicesfacades.gruposunidades.GruposUnidadesServiceFacade"/>
</bean>
<bean
id="gruposUnidadesServiceFacadeBean" class="penoles.infraestructura.web.servicesfacades.gruposunidades.GruposUnidadesServiceFacadeBean">
<property name="gruposUnidadesServiceFacade"
ref="gruposUnidadesServiceFacade"/>
</bean>
</beans>
Here, I have tried adding the resourceRef property set
to true and to false and always I get the exception.
Finally, in my web.xml I have:
<ejb-ref>
<ejb-ref-name>GruposUnidadesService</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<remote>penoles.infraestructura.business.services.gruposunidades.GruposUnidadesService</remote>
</ejb-ref>
And in my weblogic.xml:
<?xml version = '1.0' encoding =
'windows-1252'?>
<!DOCTYPE weblogic-web-app PUBLIC "-//BEA
Systems, Inc.//DTD Web Application 8.1//EN"
"http://www.bea.com/servers/wls810/dtd/weblogic810-web-jar.dtd">
<weblogic-web-app>
<reference-descriptor>
<ejb-reference-description>
<ejb-ref-name>GruposUnidadesService</ejb-ref-name>
<jndi-name>ejb/GruposUnidadesService</jndi-name>
</ejb-reference-description>
</reference-descriptor>
</weblogic-web-app>
My environment is: Weblogic 10.3.0.0 on Linux Redhat 4
thnks
Edited by: user501097 on 08-oct-2008 8:29Well I Think it was a beginner mistake…
I added to the following to my web.xml
<ejb-ref>
<ejb-ref-name>SeguridadService</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<remote>penoles.infraestructura.business.services.seguridad.SeguridadService</remote>
<ejb-link>SeguridadService</ejb-link>
</ejb-ref>
And change the applicationContext.xml
<bean id="gruposUnidadesServiceFacade" class = "org.springframework.jndi.JndiObjectFactoryBean">
<property name="resourceRef" value="true"/>
<property name="proxyInterface" value="penoles.infraestructura.web.servicesfacades.gruposunidades.GruposUnidadesServiceFacade"/>
<property name = "jndiName" value = "GruposUnidadesService"/>
</bean>
thnks! -
Javax.naming.NameNotFoundException: jdbc not bound
Hi !
I've a application deployed with JBoss 4.0.2 Solaris 2.8, I've create a Oracle DS, when I try to read data from a database throw DS works fine, but when I try to insert, delete or update records from database the jboss show the next error.
2005-09-07 09:17:55,662 ERROR [org.jboss.ejb.plugins.LogInterceptor] Transaction
RolledbackLocalException in method: public abstract int com.soluzionasf.arqw10.g
c.cmp.OracleSequenceSessionLocal.getNextSequenceNumber(java.lang.String) throws
javax.ejb.FinderException, causedBy:
javax.naming.NameNotFoundException: jdbc not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:491)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:499)
at org.jnp.server.NamingServer.getObject(NamingServer.java:505)
at org.jnp.server.NamingServer.lookup(NamingServer.java:249)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:610)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at com.soluzionasf.arqw10.gc.cmp.OracleSequenceSessionBean.getConnection
(OracleSequenceSessionBean.java:76)
at com.soluzionasf.arqw10.gc.cmp.OracleSequenceSessionBean.getNextSequen
ceNumber(OracleSequenceSessionBean.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(S
tatelessSessionContainer.java:214)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invo
ke(CachedConnectionInterceptor.java:185)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(Stat
elessSessionInstanceInterceptor.java:130)
at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(Service
EndpointInterceptor.java:51)
at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidation
Interceptor.java:48)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
rceptor.java:105)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
torCMT.java:335)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:1
66)
This is my DS definition
<?xml version="1.0" encoding="UTF-8"?>
<local-tx-datasource>
<jndi-name>jdbc/OracleDS</jndi-name>
<connection-url>jdbc:oracle:thin:@10.98.10.42:1532:orcl28</connection-url>
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<user-name>evo_adminis</user-name>
evo_adminis1
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
<type-mapping>Oracle9i</type-mapping>
</local-tx-datasource>
Who knows the solutions for my problem
Thanks for advanceCould be that your EJB is connected to a wrong datasource called only "jdbc"?
Strangely you say that while reading data all works fine (so the datasource definition is ok) but only when writing data there is a NamingException.
The stacktrace seems to report an error while getting datasource reference inside com.soluzionasf.arqw10.gc.cmp.OracleSequenceSessionLocal.getNextSequenceNumber method, the problems seems to be a bad name resource name ("jdbc" instead of java:jdbc/OracleDS or java:comp/env/jdbc/OracleDS if you use resource reference in your web.xml file). If you created this class as a CMP perhaps you misstype the right datasource name, otherwise if you code this method by yourseft you misstype the naming reference. -
I am pretty new to J2ee so help me out with these basics
I had deployed my application at college which worked exactly but when I deployed it at my home, it got deployed well but its returning a error message when create is called. Also i had used mssql for jdbc connection but haven't set the j2ee_classpath, pls help me how to find jdbc drivers .jar file. Does j2ee_classpath has anything to do with my error.All other paths are intact.
Help me soon, i have to hurry up my proj...
Advanced Thanks To Your Good Heart.
- Suresh Kumar.R
coding snippet -->****Down
public AccountBean()
try
Context ic=new InitialContext();
java.lang.Object objref=ic.lookup("java:comp/env/ejb/Account");
accountHome=(AcHome)PortableRemoteObject.narrow(objref,AcHome.class);
catch(Exception re)
System.err.println("Couldn't locate Account Home");
re.printStackTrace();
reset();
********Error :********
Couldn't locate Account Home
javax.naming.NameNotFoundException: Account not found
<<no stack trace available>>ack trace available>>yes Everything you say is right in my prog. but it still does n't works.
i haven't set my j2ee_classpath & does it have anything to do with my error.
if so, where to find the drivers(MS-SQL) .jar file.
Thank You for Your reply
-Suresh Kumar.R -
Javax.naming.NameNotFoundException
I am using Weblogic 7.0 and while deploying an EJB during startup I get this error?
Somehow, this application deployed in some developers' machines and failed on
others. I have no idea why? Pls help!
Wen
[exec] weblogic.ejb20.UnDeploymentException: cps_server_ejb.jar; nested exception
is:
[exec] javax.naming.NameNotFoundException: Unable to resolve 'app/ejb/cps_server_ejb.jar#StatefulWorkflowEJB'
Resolved: 'app/ejb' Unresolved:
'cps_server_ejb.jar#StatefulWorkflowEJB' ; remaining name 'cps_server_ejb.jar#StatefulWorkflowEJB'
[exec] javax.naming.NameNotFoundException: Unable to resolve 'app/ejb/cps_server_ejb.jar#StatefulWorkflowEJB'
Resolved: 'app/ejb' Unresolved:'cps
serverejb.jar#StatefulWorkflowEJB' ; remaining name 'cps_server_ejb.jar#StatefulWorkflowEJB'
[exec] at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:858)
[exec] at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.java:223)
[exec] at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:187)
[exec] at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:338)
[exec] at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:333)
[exec] at weblogic.ejb20.deployer.EJBDeployer.cleanupAppContext(EJBDeployer.java:1739)
[exec] at weblogic.ejb20.deployer.EJBDeployer.rollback(EJBDeployer.java:1420)
[exec] at weblogic.ejb20.deployer.EJBDeployer.undeploy(EJBDeployer.java:310)
[exec] at weblogic.ejb20.deployer.Deployer.deploy(Deployer.java:884)
[exec] at weblogic.j2ee.EJBComponent.deploy(EJBComponent.java:79)
[exec] at weblogic.j2ee.Application.addComponent(Application.java:294)
[exec] at weblogic.j2ee.J2EEService.addDeployment(J2EEService.java:163)
[exec] at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentTarget.java:396)
[exec] at weblogic.management.mbeans.custom.DeploymentTarget.addDeployments(DeploymentTarget.java:302)
[exec] at weblogic.management.mbeans.custom.DeploymentTarget.updateServerDeployments(DeploymentTarget.java:256)
[exec] at weblogic.management.mbeans.custom.DeploymentTarget.updateDeployments(DeploymentTarget.java:207)
[exec] at java.lang.reflect.Method.invoke(Native Method)
[exec] at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl.java:717)
[exec] at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:699)
[exec] at weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBeanImpl.java:405)
[exec] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
[exec] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
[exec] at weblogic.management.internal.RemoteMBeanServerImpl.invoke(RemoteMBeanServerImpl.java:921)
[exec] at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:470)
[exec] at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:198)
[exec] at $Proxy40.updateDeployments(Unknown Source)
[exec] at weblogic.management.configuration.ServerMBean_CachingStub.updateDeployments(ServerMBean_CachingStub.java:3957)
[exec] at weblogic.management.deploy.slave.SlaveDeployer.updateServerDeployments(SlaveDeployer.java:2258)
[exec] at weblogic.management.deploy.slave.SlaveDeployer.resume(SlaveDeployer.java:365)
[exec] at weblogic.management.deploy.DeploymentManagerServerLifeCycleImpl.resume(DeploymentManagerServerLifeCycleImpl.java:235)
[exec] at weblogic.t3.srvr.ServerLifeCycleList.resume(ServerLifeCycleList.java:61)
[exec] at weblogic.t3.srvr.T3Srvr.resume(T3Srvr.java:812)
[exec] at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:294)
[exec] at weblogic.Server.main(Server.java:31)
[exec] <Oct 30, 2002 10:15:28 AM PST> <Error> <J2EE> <160001> <Error deploying
application cps_server_ejb:Could it be caused by a wrong configuration in the Weblogic Server console?That, or you are simply using the wrong JNDI lookup path. Or both. The server should provide a function to see what is deployed in its JNDI context, hopefully also mentioning the JNDI path to use. If you need more help, I suggest you take your question to the weblogic forum.
https://forums.oracle.com/forums/category.jspa?categoryID=193 -
WL5.1 SP* javax.naming.NameNotFoundException
I am looking for advice ... I started getting a NameNotFoundException when I
moved from SP6 to SP8 running on a Solaris machine (NO code changes).
Anyone have any ideas as to the problem? As the deployment names seem
correct, it is not obvious to me where the problem lies.
ejb-jar.xml snippet
=============
<session>
<description>ProductHierarchy EJB</description>
<display-name>ProductHierarchy</display-name>
<ejb-name>ProductHierarchy</ejb-name>
<home>com.redcelsius.ecommerce.product.ejb.ProductHierarchyHome</home>
<remote>com.redcelsius.ecommerce.product.ejb.ProductHierarchy</remote>
<ejb-class>com.redcelsius.ecommerce.product.ejb.ProductHierarchyBean</ejb-cl
ass>
<session-type>Stateless</session-type>
<transaction-type>Bean</transaction-type>
</session>
weblogic-ejb-jar.xml snippet
===================
<weblogic-enterprise-bean>
<ejb-name>ProductHierarchy</ejb-name>
<caching-descriptor>
</caching-descriptor>
<jndi-name>ecommerce.ProductHierarchyHome</jndi-name>
</weblogic-enterprise-bean>
client home lookup snippet
==================
InitialContext ctx =
AbstractResourceFactory.getResourceFactory().getInitialContext();
Object ref = ctx.lookup("ecommerce.ProductHierarchyHome");
Weblogic deployment
===============
Thu Mar 01 12:18:31 GMT-05:00 2001:<I> <EJB JAR deployment
./myserver/redcelsius/ecommerce-server.jar> EJB home interface:
'com.redcelsius.ecommerce.product.ejb.ProductHierarchyHome' deployed bound
to the JNDI name: 'ecommerce.ProductHierarchyHome'
Exception
=======
javax.naming.NameNotFoundException: 'ecommerce.ProductHierarchyHome';
remaining name 'ecommerce.ProductHierarchyHome'
at
weblogic.jndi.toolkit.BasicWLContext.resolveName(BasicWLContext.java:745)
at
weblogic.jndi.toolkit.BasicWLContext.lookup(BasicWLContext.java:133)
at
weblogic.jndi.toolkit.BasicWLContext.lookup(BasicWLContext.java:574)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at
com.redcelsius.ecommerce.product.web.ProductBean.getEJB(ProductBean.java:68)I solved the problem. We read vendor specific values (such as
Context.PROVIDER_URL and Context.INITIAL_CONTEXT_FACTORY) from a property
file in a startup class in a static initializer.
It seems that the timing of when the startup class is loaded changed between
sp6 and sp8; as a result the static initializer could not find our property
file to set the values required when InitialContext(Properties) is called.
Everything now works.
Alan Koop
"Rob Woollen" <[email protected]> wrote in message
news:[email protected]...
Are you sure that you are looking up the EJB on the WLS server that
deployed it? (I have to ask.)
Otherwise, there shouldn't be any required code changes between SP6 and
SP8. We certainly test 1000s of EJBs against the service pack so JNDI
lookups should work fine.
Have you made any environmental changes?
If you go back to SP6, does it still work?
-- Rob
Alan Koop wrote:
I am looking for advice ... I started getting a NameNotFoundException
when I
moved from SP6 to SP8 running on a Solaris machine (NO code changes).
Anyone have any ideas as to the problem? As the deployment names seem
correct, it is not obvious to me where the problem lies.
ejb-jar.xml snippet
=============
<session>
<description>ProductHierarchy EJB</description>
<display-name>ProductHierarchy</display-name>
<ejb-name>ProductHierarchy</ejb-name>
<home>com.redcelsius.ecommerce.product.ejb.ProductHierarchyHome</home>
<remote>com.redcelsius.ecommerce.product.ejb.ProductHierarchy</remote>
<ejb-class>com.redcelsius.ecommerce.product.ejb.ProductHierarchyBean</ejb-cl
ass>
<session-type>Stateless</session-type>
<transaction-type>Bean</transaction-type>
</session>
weblogic-ejb-jar.xml snippet
===================
<weblogic-enterprise-bean>
<ejb-name>ProductHierarchy</ejb-name>
<caching-descriptor>
</caching-descriptor>
<jndi-name>ecommerce.ProductHierarchyHome</jndi-name>
</weblogic-enterprise-bean>
client home lookup snippet
==================
InitialContext ctx =
AbstractResourceFactory.getResourceFactory().getInitialContext();
Object ref = ctx.lookup("ecommerce.ProductHierarchyHome");
Weblogic deployment
===============
Thu Mar 01 12:18:31 GMT-05:00 2001:<I> <EJB JAR deployment
./myserver/redcelsius/ecommerce-server.jar> EJB home interface:
'com.redcelsius.ecommerce.product.ejb.ProductHierarchyHome' deployedbound
to the JNDI name: 'ecommerce.ProductHierarchyHome'
Exception
=======
javax.naming.NameNotFoundException: 'ecommerce.ProductHierarchyHome';
remaining name 'ecommerce.ProductHierarchyHome'
at
weblogic.jndi.toolkit.BasicWLContext.resolveName(BasicWLContext.java:745)
at
weblogic.jndi.toolkit.BasicWLContext.lookup(BasicWLContext.java:133)
at
weblogic.jndi.toolkit.BasicWLContext.lookup(BasicWLContext.java:574)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at
com.redcelsius.ecommerce.product.web.ProductBean.getEJB(ProductBean.java:68)
>
Coming Soon: Building J2EE Applications & BEA WebLogic Server
by Michael Girdley, Rob Woollen, and Sandra Emerson
http://learnweblogic.com -
OC4J Configuration - javax.naming.NameNotFoundException
Here is a description of the problem we are having:
The Problem
We have a remote client that wishes to invoke services
that we are
going to provide. These services will be accessible via a JNDI
lookup from
the client's JVM. The client, is operating in a JRE, version
1.2.2, but is
an in-house Java Server Engine (developed before the Servlet API
specification) and not a command line client application. It is
desirable to
do a simple JNDI lookup from the RMIInitialContext and gain
access to the
services (Home Interface). Attached is a demonstration of a
client
application doing a lookup against the deployment shown below
(orion-ejb-jar.xml ). Notice the name of the service in the
lookup on the
client application are exactly the same as the location
declaration of the
session deployment element of the orion-ejb-jar.xml. The service
(EJB, not
attached) was deployed without any errors. The exception we are
getting is:
Exception in thread "main" javax.naming.NameNotFoundException:
DAServicesDemo not found
at com.evermind.server.rmi.RMIContext.lookup
(RMIContext.java:121)
at javax.naming.InitialContext.lookup
(InitialContext.java:350)
at test.RemoteServiceClient.main
(RemoteServiceClient.java:26)
The RMI server has been configured with the default
settings, and is
listening on port 8474
The Source
package test;
import ORG.oclc.da.beans.*;
import javax.naming.*;
import java.util.*;
import java.rmi.*;
import javax.ejb.*;
public class RemoteServiceClient
public static void main(String[] args)
throws NamingException, CreateException,
RemoteException,
Exception{
Properties h = new Properties();
h.put(Context.INITIAL_CONTEXT_FACTORY,
"com.evermind.server.rmi.RMIInitialContextFactory");
h.put
(Context.PROVIDER_URL, "ormi://risc14.dev.oclc.org:8474");
InitialContext context = new InitialContext(h);
DAServicesDemoHome remoteServiceHome =
(DAServicesDemoHome) (new
InitialContext(h)).lookup("DAServicesDemo");
DAServicesDemo remoteService =
(DAServicesDemo)remoteServiceHome.create();
System.out.println("Here it is: " +
remoteService.getContentGroup());
C_DemoServices remoteService = new C_DemoServices();
String result = remoteService.getContentGroup();
System.out.println("This is the result form the remote
service: " +
result);
EJB-jar.xml
<ejb-jar>
<description>
Proof of concept application for the integration of DA to
CORC
</description>
<display-name>Digital Archive Remote Services</display-name>
<enterprise-beans>
<session>
<ejb-name>DAServicesDemo</ejb-name>
<home>ORG.oclc.da.beans.DAServicesDemoHome</home>
<remote>ORG.oclc.da.beans.DAServicesDemo</remote>
<ejb-class>ORG.oclc.da.beans.DAServicesDemoBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>DAServicesDemo</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>NotSupported</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
Orion-ejb.jar
<orion-ejb-jar deployment-version="1.0.2.2" deployment-
time="ea2215b915">
<enterprise-beans>
<session-deployment name="DAServicesDemo"
location="DAServicesDemo"
wrapper="DAServicesDemoHome_StatelessSessionHomeWrapper1"
timeout="1800"
persistence-filename="DAServicesDemo" />
</enterprise-beans>
<assembly-descriptor>
<default-method-access>
<security-role-mapping
name="<default-ejb-caller-role>" impliesAll="true" />
</default-method-access>
</assembly-descriptor>
</orion-ejb-jar>
Any help would be greatly appreciated, thanks in advanced...Hi Jonathan,
If I understand you correctly, you are trying to access an EJB in
OC4J from a separate, external JVM. If that is correct, then, in
order to achieve that, the (EJB) home interface "stub" class must
be located in the client's JVM. Unfortunately, I haven't figured
out how to do that, and therefore, as far as I can see, the only
two client options available are:
1. Web-based client -- servlet or JSP
2. Application client -- standalone java application.
However, for both options, the client must also be deployed to
OC4J. I don't know how to obtain "stub" classes generated by OC4J
so that I can give external clients access to them.
According to the J2EE spec, application clients need to be run
within containers, too -- albeit thin containers. I presume that
means you need 2 instances of OC4J running -- one for the server
and one for the client. Seems a bit "heavy" to me, so for now I'm
going with the web-based (servlet) client and having external
java classes communicate with the servlet.
Hope this has been of assistance to you,
Avi.
Maybe you are looking for
-
REUSE_ALV_GRID_DISPLAY export to exel
Hi! I'm displaying numbers into my ALV, that works perfect but when I export the ALV to Excel with the standard button (CTRL + SHIF + F7) I get the Excel sheet but the numbers are not being displayed fine. the scenario. I have a column of 20 char 012
-
Wrong date on archived scanned document
I am using the trial version of Acrobat X. When using the Action Wizard to archive a scanned document the default file name/date is incorrect. How can this be resolved? The last document name was 2010125102233. The 2010 is the year, the 12 is decemb
-
I have a file /tmp/SEA1.txt in my server that contains; SEA1 COVERA ALL BB02 200101 17024.00 SEA1 COVERA ALL BB03 200101 12614.00 SEA1 COVERA ALL BB04 200101 15204.00 I performed flollow procedures in SQL*PLUS: CREATE OR REPLACE DIRECTORY TMP_DIR AS
-
Multiple delete is not working.
Hi, Multiple delete is not working. Please find my backend bean code. Please let me know the issue in my code. Table: <af:table value="#{bindings.CmProcessParamValueView13.collectionModel}" var="row" rows="#{bindings.CmProcessParamValueView13.rangeSi
-
I am using FC Express HD, and for some reason, when I export a Quicktime movie, the final movie will only play audio, and the video is black. I only get the actual video if I export as self contained, or if I exportusing quicktime conversion. Why?