Class javax.naming.InitialContext not find import
how should I set the classpath environment?
Where to find javax.naming.InitialContext package?
thanks for you help
You should set the classpath environment to include wherever your javax.naming package is. If you're using Java 1.3 or later, javax.naming should be in the classpath already.
Similar Messages
-
Class javax.rmi.PortableRemoteObject not found in import
I have successfully tested test1.jsp calling stateful ejb test1ejb under JDEV9032. On deploying to standalone OC4J903, the following error occurred on accessing the jsp:
500 Internal Server Error
OracleJSP: oracle.jsp.provider.JspCompileException:
Errors compiling:D:\O9IAS\j2ee\home\application-deployments\test\testWEB\persistence\_pages\\_test1.java
Line # Error 10
Class javax.rmi.PortableRemoteObject not found in import. import javax.rmi.PortableRemoteObject;
Appreciate some pointers on how to troubleshoot this problem. Thanks. William Chew.This error is due to the c:\windows\system32\java.exe being first on the path instead of the d:\jdev9i\jdk\bin\java.exe being picked up.
-
Class javax.crypto.SecretKey not found in import.
While compilation i am getting this error.
Class javax.crypto.SecretKey not found in import.
I am not able to figure it out . Please help me for that.
Is it related to some classpath setting.This error is due to the c:\windows\system32\java.exe being first on the path instead of the d:\jdev9i\jdk\bin\java.exe being picked up.
-
Java.io.NotSerializableException: javax.naming.InitialContext
I am using Workshop to create a Stateful session bean and i just have a simple member variable in the bean of type string. I didnt override the ejbCreate and setSessionContext methods and i get the following error when it is trying to passivate the bean.
Passivate Called
<Nov 17, 2004 2:51:06 PM PST> <Error> <EJB> <BEA-010024> <Error occurred during
passivation: java.io.NotSerializableException: javax.naming.InitialContext
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java
:1330)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:13
02)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.jav
a:1245)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
at weblogic.ejb20.swap.PassivationUtils.write(PassivationUtils.java:94)
at weblogic.ejb20.swap.DiskSwap.write(DiskSwap.java:214)
at weblogic.ejb20.manager.StatefulSessionManager.swapOut(StatefulSession
Manager.java:1051)
at weblogic.ejb20.cache.NRUCache.moveInActiveToFree(NRUCache.java:550)
at weblogic.ejb20.cache.NRUCache.reclaimNodes(NRUCache.java:578)
at weblogic.ejb20.cache.NRUCache.getFreeNode(NRUCache.java:238)
at weblogic.ejb20.cache.NRUCache.put(NRUCache.java:318)
at weblogic.ejb20.manager.StatefulSessionManager.create(StatefulSessionM
anager.java:844)
at weblogic.ejb20.manager.StatefulSessionManager.remoteCreate(StatefulSe
ssionManager.java:880)
at weblogic.ejb20.internal.StatefulEJBHome.create(StatefulEJBHome.java:1
33)
at filenet.wfqa.tests.ejb.beans.StatefulSession_us0wxs_HomeImpl.create(S
tatefulSession_us0wxs_HomeImpl.java:75)
at filenet.wfqa.tests.ejb.beans.StatefulSession_us0wxs_HomeImpl_WLSkel.i
nvoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:477)
at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerR
ef.java:108)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:353)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
144)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.jav
a:415)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest
.java:30)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
The stack trace sesms to tell me that it is something internal to the workshop generated EJBHome class since i do not see any reference to InitialContext in my bean class.
Is it some bug with workshop. Or is it something wrong i am doing.
Thanks
sriramPage 325 (paragraph 5) of O”Reilly Enterprise Java Beans (4th Edition) states:
“During the lifetime of a stateful session bean, there may be periods of inactivity when the bean instance is not servcing mentod from the client. To conseve resources, the container can passivate the bean instance by preserving its conversation state and evicitin the bean instance from memory. A ben’s convesatin stat may consist of primitive values, object that are serializable, and the following special types:
javax.ejb.SessionContext
javax.ejb EJBHome
javax.ejb EJNObject
javax.ejb Jta.UserTRansaction
javax.ejb Naming.Context(only when it references the JNDI ENC)
…” -
Cannot access class javax.naming.Referenceable;
Hi
I am trying to create a connection pool and using the oracle.jdbc.pool.* in JavaBeans using JDeveloper 3.1.
I am getting the following error.Unable to find the reason for this and the sun documentation says - no usage for this class.
Error:
cannot access class javax.naming.Referenceable; file javax/naming/Referenceable.class not found.
Any help is greatly appreciated..
thanks
Yugandhar
nullYou need to make sure $ORACLE_HOME/jdbc/lib/jndi.zip is on your classpath for this to work.
-
Root exception is javax.naming.AuthenticationException: Not authorized
Hi :
I am trying to access an EJB (OC4j Container ) thru a thick client which is running on the same machine but outside the container.
My code to access the ejb is as follows:
Properties props = new Properties();
props.put(Context.INITIAL_CONTEXT_FACTORY
, "com.evermind.server.rmi.RMIInitialContextFactory");
props.put(Context.PROVIDER_URL, "ormi://localhost:23791/Sample");
props.put(Context.SECURITY_PRINCIPAL, "sample");
props.put(Context.SECURITY_CREDENTIALS, "demo");
InitialContext initialContext = new InitialContext(props);
System.out.println("Initial Context"+initialContext);
System.out.println("EjbNames.USER_HOME.getJndiName()"+EjbNames.USER_HOME.getJndiName());//EjbNames is an enum.Which returns jndi name of the specific ejb.)
I have also modified to system-jazn-data.xml as follows:
<application>
<name>Sample</name>
<login-modules>
<login-module>
<class>com.sample.abc.web.security.SampleLoginModule</class>
<control-flag>required</control-flag>
<options>
<option>
<name>Password</name>
<value>demo</value>
</option>
<option>
<name>Username</name>
<value>sample</value>
</option>
</options>
</login-module>
</login-modules>
</application>
Still I am getting following Exception while trying to connect thru thick client to the server. Stack trace is as follows:
SEVERE: ConnectionImpl:ilogin javax.naming.NamingException: Lookup error: javax.naming.AuthenticationException: Not authorized; nested exception is:
javax.naming.AuthenticationException: Not authorized [Root exception is javax.naming.AuthenticationException: Not authorized]
Aug 18, 2006 12:03:44 PM com.sample.abc.api.exceptions.SampleException <init>
SEVERE: java.io.PrintStream@145f0e3
java.lang.Exception: Home not found.
Also below is the error which is printed on OC4j Console:
NOTIFICATION J2EE RMI0004 Invalid username or password for Sample(sample). Authentication failed.
Please help,also let me know If I am missing on configuration side or whatever is required.I am using OC4j 10.1.3.
Thanks & RegardsAdd the following in system-jazn-data.xml
<grant>
<grantee>
<principals>
<principal>
<type>user</type>
<class>Your Principal Class</class>
<name>UserName to which you want to give permission</name>
</principal>
</principals>
</grantee>
<permissions>
<permission>
<class>com.evermind.server.rmi.RMIPermission</class>
<name>login</name>
</permission>
</permissions>
</grant> -
Javax.naming.InitialContext
Hi
I have a servlet which needs to connect to MSSQL 2005. However, it has compile error in the following code. How to fix it?
import java.io.*; import java.net.*; import java.sql.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; javax.naming.InitialContext y = new javax.naming.InitialContext(); javax.sql.DataSource d = (javax.sql.DataSource) y.lookup("java:comp/env/jdbc/product_warehouse");Compilation errors belongs in the 'New to Java' forum: [http://forums.sun.com/forum.jspa?forumID=54].
Don't forget to mention the exact error message in the new topic over there. Good luck.
Or, if you're smart, just Google the error message. -
Javax.naming.* Not Found
I have downloaded the j2sdkee1.3 for comiling my Ejb files.All the files get compiled but my client file which uses javax.naming package doesnt get compiled.The error message says its unable to find javax.naming package. Can somebody help me on this issue please.
Thanxi too am having the same problem any suggestions???
-
Help needed for javax.naming.Context and javax.naming.InitialContext
I need help on this two..
I am currently doing a project which required Connection Pooling. And this is the first time i'm exposed to all this.. I know nothing about these files.. But, i manage to get help from someone on DataSource. But i can't find any for naming.context and naming.InitialContext.. Can anyone help me? I need to know where i can get these 2 files or how to configure it.. Thanks! ;pThis'll help you:
http://java.sun.com/products/jndi/tutorial/ -
Class javax.servlet.Servlet not found - problem
Hello,
i'm using intellij and tomcat . when i try to configure intellij to use tomcat it says that it doesn't find javax.servlet.Servlet class.
i'm using jdk1.5.0_05. what can i do to fix this error?
tnx,
clauditzaok!
and where can i find this particular jar? i have searched it on java.sun.com, but all i could find was j2ee that includes support for servlets -
I have followed the tutorial on http://www.oracle.com/technology/obe/obe1013jdev/10131/10131_ejb_30/ejb_30.htm to create my own EJB with Jdeveloper, but I got some errors. Please help.
When I run the client, it gave out the following errors:
javax.naming.NameNotFoundException: buslogic.HRAppFacade not found
at com.evermind.server.rmi.RMIClientContext.lookup(RMIClientContext.java:52)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at client.HRAppFacadeClient.main(HRAppFacadeClient.java:15)
Process exited with exit code 0.
I have created the entity and facade (with interface), but the client couldn't lookup the facade, giving out the above error. How to solve the problm? Thanks.
The following is my source code:
Employees.java
package buslogic.persistence;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
@Entity
@NamedQueries({
@NamedQuery(name = "Employees.findAll", query = "select o from Employees o"),
@NamedQuery(name = "Employees.findEmployeeById", query = "select o from Employees o where o.empid = :empid")
@Table(name = "\"employees\"")
public class Employees implements Serializable {
@Id
@Column(name="empid")
private int empid;
@Column(name="name")
private String name;
@Column(name="phone")
private int phone;
public Employees() {
public int getEmpid() {
return empid;
public void setEmpid(int empid) {
this.empid = empid;
public String getName() {
return name;
public void setName(String name) {
this.name = name;
public int getPhone() {
return phone;
public void setPhone(int phone) {
this.phone = phone;
(HRAppFacadeBean.java)
package buslogic;
import buslogic.persistence.Employees;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
@Stateless(name="HRAppFacade")
public class HRAppFacadeBean implements HRAppFacade, HRAppFacadeLocal {
@PersistenceContext(unitName="EJB_Project")
private EntityManager em;
public HRAppFacadeBean() {
public Object mergeEntity(Object entity) {
return em.merge(entity);
public Object persistEntity(Object entity) {
em.persist(entity);
return entity;
/** <code>select o from Employees o</code> */
public List<Employees> queryEmployeesFindAll() {
return em.createNamedQuery("Employees.findAll").getResultList();
/** <code>select o from Employees o where o.empid = :empid</code> */
public Employees queryEmployeesFindEmployeeById(int empid) {
return (Employees)em.createNamedQuery("Employees.findEmployeeById").setParameter("empid", empid).getSingleResult();
public void removeEmployees(Employees employees) {
employees = em.find(Employees.class, employees.getEmpid());
em.remove(employees);
(HRAppFacade.java)
package buslogic;
import buslogic.persistence.Employees;
import java.util.List;
import javax.ejb.Remote;
@Remote
public interface HRAppFacade {
Object mergeEntity(Object entity);
Object persistEntity(Object entity);
List<Employees> queryEmployeesFindAll();
Employees queryEmployeesFindEmployeeById(int empid);
void removeEmployees(Employees employees);
(HRAppFacadeLocal.java)
package buslogic;
import buslogic.persistence.Employees;
import java.util.List;
import javax.ejb.Local;
@Local
public interface HRAppFacadeLocal {
Object mergeEntity(Object entity);
Object persistEntity(Object entity);
List<Employees> queryEmployeesFindAll();
Employees queryEmployeesFindEmployeeById(int empid);
void removeEmployees(Employees employees);
}I hit the exact same error. In my case it was due to missing "@Id" line in Departments.java. I must have accidently deleted it when pasting in some code.
(my clue was the errors I got when starting imbedded OC4J)
This section of Departments.java should read as follows:
public class Departments implements Serializable {
@Id
@GeneratedValue(strategy=SEQUENCE, generator="DEPARTMENTS_SEQ")
@Column(name="DEPARTMENT_ID", nullable = false)
After fixing this, I ran a "make" of "HRApp", restarted the embedded OC4J server (terminate it, then right click HRAppFacadeBean.java, and click Run).
Then ran the application... -
Ejb error((MARSHAL) Could not find class) when using OneToMany relationship
I am using Netbeans 5.5 with J2EE App Server 9. I have two entity beans with a OneToMany Uni-directional relationship. I have a Remote Stateless session bean which has persistence operations for creating and searching etc.. I am accessing the remote bean via jndi from a j2ee java client. The access works fine. The session bean persist operation creates data in both the entities (cascade persist).
But, after the data is created, when I access the entity manager find() method from the session bean via the client errors out. This error only happens for the entities with OneToMany relationship, not for OneToOne relationships.
I am using TOPLINK persistence provider accessing a derby data source. I have the latest persistence library jar files in the library classpath.
client code:
Phone p1 = new Phone();
p1.setPnumber("999 999 9999");
Customer c1 = new Customer();
c1.setLname("Smith");
c1.getPhone().add(p1);
int pk = agent.createCustomer(c1); // creates the entities
Customer c2 = agent.findCustomer(pk); // this causes the ERROR
session bean code:
@PersistenceContext private EntityManager em;
public int createCustomer(Customer c) {
em.persist(c);
return c.getId();
public Customer findCustomer(int i) { // this causes the ERROR
return em.find(Customer.class, i);
exception:
Mar 30, 2007 3:25:00 PM com.sun.corba.ee.impl.encoding.CDRInputStream_1_0 read_value
WARNING: "IOP00810257: (MARSHAL) Could not find class"
org.omg.CORBA.MARSHAL: vmcid: SUN minor code: 257 completed: Maybe
at com.sun.corba.ee.impl.logging.ORBUtilSystemException.couldNotFindClass(ORBUtilSystemException.java:8309)
at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:984)
at com.sun.corba.ee.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:259)
at com.sun.corba.ee.impl.io.IIOPInputStream.inputObjectField(IIOPInputStream.java:1987)
at com.sun.corba.ee.impl.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:2211)
at com.sun.corba.ee.impl.io.IIOPInputStream.inputObject(IIOPInputStream.java:1219)
at com.sun.corba.ee.impl.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:398)
***exception in Client_1 ***
at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:329)
at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:295)
at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1005)
at com.sun.corba.ee.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:259)
at com.sun.corba.ee.impl.presentation.rmi.DynamicMethodMarshallerImpl$14.read(DynamicMethodMarshallerImpl.java:333)
at com.sun.corba.ee.impl.presentation.rmi.DynamicMethodMarshallerImpl.readResult(DynamicMethodMarshallerImpl.java:424)
at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.privateInvoke(StubInvocationHandlerImpl.java:162)
at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:119)
at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(BCELStubBase.java:197)
at com.titan.ejb.__Tester1Remote_Remote_DynamicStub.findCustomer(__Tester1Remote_Remote_DynamicStub.java)
at com.titan.ejb._Tester1Remote_Wrapper.findCustomer(com.titan.ejb._Tester1Remote_Wrapper.java)
at com.titan.clients.Client_1.main(Client_1.java:37)
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:585)
at com.sun.enterprise.util.Utility.invokeApplicationMain(Utility.java:232)
at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:329)
at com.sun.enterprise.appclient.Main.main(Main.java:180)
Caused by: java.lang.ClassNotFoundException
... 25 more
javax.ejb.EJBException: nested exception is: java.rmi.MarshalException: CORBA MARSHAL 1398079745 Maybe; nested exception is:
org.omg.CORBA.MARSHAL: vmcid: SUN minor code: 257 completed: Maybe
java.rmi.MarshalException: CORBA MARSHAL 1398079745 Maybe; nested exception is:
org.omg.CORBA.MARSHAL: vmcid: SUN minor code: 257 completed: Maybe
at com.sun.corba.ee.impl.javax.rmi.CORBA.Util.mapSystemException(Util.java:224)
at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.privateInvoke(StubInvocationHandlerImpl.java:172)
at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:119)
at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(BCELStubBase.java:197)
at com.titan.ejb.__Tester1Remote_Remote_DynamicStub.findCustomer(__Tester1Remote_Remote_DynamicStub.java)
at com.titan.ejb._Tester1Remote_Wrapper.findCustomer(com.titan.ejb._Tester1Remote_Wrapper.java)
at com.titan.clients.Client_1.main(Client_1.java:37)
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:585)
at com.sun.enterprise.util.Utility.invokeApplicationMain(Utility.java:232)
at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:329)
at com.sun.enterprise.appclient.Main.main(Main.java:180)
Caused by: org.omg.CORBA.MARSHAL: vmcid: SUN minor code: 257 completed: Maybe
at com.sun.corba.ee.impl.logging.ORBUtilSystemException.couldNotFindClass(ORBUtilSystemException.java:8309)
at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:984)
at com.sun.corba.ee.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:259)
at com.sun.corba.ee.impl.io.IIOPInputStream.inputObjectField(IIOPInputStream.java:1987)
at com.sun.corba.ee.impl.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:2211)
at com.sun.corba.ee.impl.io.IIOPInputStream.inputObject(IIOPInputStream.java:1219)
at com.sun.corba.ee.impl.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:398)
at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:329)
at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:295)
at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1005)
at com.sun.corba.ee.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:259)
at com.sun.corba.ee.impl.presentation.rmi.DynamicMethodMarshallerImpl$14.read(DynamicMethodMarshallerImpl.java:333)
at com.sun.corba.ee.impl.presentation.rmi.DynamicMethodMarshallerImpl.readResult(DynamicMethodMarshallerImpl.java:424)
at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.privateInvoke(StubInvocationHandlerImpl.java:162)
... 12 more
Caused by: java.lang.ClassNotFoundException
... 25 more
javax.ejb.EJBException: nested exception is: java.rmi.MarshalException: CORBA MARSHAL 1398079745 Maybe; nested exception is:
org.omg.CORBA.MARSHAL: vmcid: SUN minor code: 257 completed: Maybe
at com.titan.ejb._Tester1Remote_Wrapper.findCustomer(com.titan.ejb._Tester1Remote_Wrapper.java)
at com.titan.clients.Client_1.main(Client_1.java:37)
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:585)
at com.sun.enterprise.util.Utility.invokeApplicationMain(Utility.java:232)
at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:329)
at com.sun.enterprise.appclient.Main.main(Main.java:180)It appears to be a bug in Netbeans.
I have a similar error message with the following settings:
A session bean remote interface
be.macharis.toon.pacita.common.OriginFacadeRemoteA session bean implementing the remote interface
be.macharis.toon.pacita.common.OriginFacadeAt deploying the ejb module, the session bean is loaded in the JNDI registry under the name be.macharis.toon.pacita.common.OriginFacadeRemote (the server log says so).
I have the following code in a servlet:
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
try {
Context ic = new InitialContext();
OriginFacadeRemote originFacade = (OriginFacadeRemote)ic.lookup(OriginFacadeRemote.class.getName());
originFacade.setOrigin(componentRegistry, OriginFacadeRemote.ELEMENT_CONTAINER); // <- exception here
} catch (NamingException e) {
e.printStackTrace();
}Yet I get a java.lang.ClassNotFoundException during the EJB method call. The exception does not take place during execution of the method, but before, while the EJB container is still resolving the method. It thus must be a(nother) bug in the implementation of the EJB container.
And bugs that are outside your control are so much harder to deal with... There was another bug in the EJB container for serialising complex object that I could work around by explicitly serialising the Objects myself to byte arrays. It took me 5 days to do so. I don't know if I will manage to work around this bug. If I do, I will post my solution. For completeness, below my "clarifying" error dump:
javax.ejb.EJBException: nested exception is: java.rmi.MarshalException: CORBA MARSHAL 1398079745 Maybe; nested exception is:
org.omg.CORBA.MARSHAL: ----------BEGIN server-side stack trace----------
org.omg.CORBA.MARSHAL: vmcid: SUN minor code: 257 completed: Maybe
at com.sun.corba.ee.impl.logging.ORBUtilSystemException.couldNotFindClass(ORBUtilSystemException.java:8309)
at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:984)
at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:850)
at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_abstract_interface(CDRInputStream_1_0.java:844)
at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_abstract_interface(CDRInputStream_1_0.java:834)
at com.sun.corba.ee.impl.encoding.CDRInputStream.read_abstract_interface(CDRInputStream.java:275)
at com.sun.corba.ee.impl.io.IIOPInputStream.readObjectDelegate(IIOPInputStream.java:361)
at com.sun.corba.ee.impl.io.IIOPInputStream.readObjectOverride(IIOPInputStream.java:524)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:345)
at java.util.HashMap.readObject(HashMap.java:1029)
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.corba.ee.impl.io.IIOPInputStream.invokeObjectReader(IIOPInputStream.java:1692)
at com.sun.corba.ee.impl.io.IIOPInputStream.inputObject(IIOPInputStream.java:1210)
at com.sun.corba.ee.impl.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:398)
at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:329)
at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:295)
at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1005)
at com.sun.corba.ee.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:259)
at com.sun.corba.ee.impl.io.IIOPInputStream.inputObjectField(IIOPInputStream.java:1987)
at com.sun.corba.ee.impl.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:2211)
at com.sun.corba.ee.impl.io.IIOPInputStream.inputObject(IIOPInputStream.java:1219)
at com.sun.corba.ee.impl.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:398)
at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:329)
at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:295)
at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1005)
at com.sun.corba.ee.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:259)
at com.sun.corba.ee.impl.io.IIOPInputStream.inputObjectField(IIOPInputStream.java:1987)
at com.sun.corba.ee.impl.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:2211)
at com.sun.corba.ee.impl.io.IIOPInputStream.inputObject(IIOPInputStream.java:1219)
at com.sun.corba.ee.impl.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:398)
at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:329)
at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:295)
at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1005)
at com.sun.corba.ee.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:259)
at com.sun.corba.ee.impl.presentation.rmi.DynamicMethodMarshallerImpl$14.read(DynamicMethodMarshallerImpl.java:333)
at com.sun.corba.ee.impl.presentation.rmi.DynamicMethodMarshallerImpl.readArguments(DynamicMethodMarshallerImpl.java:393)
at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:119)
at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:650)
at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:193)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1705)
at com.sun.corba.ee.impl.protocol.SharedCDRClientRequestDispatcherImpl.marshalingComplete(SharedCDRClientRequestDispatcherImpl.java:154)
at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.invoke(CorbaClientDelegateImpl.java:194)
at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.privateInvoke(StubInvocationHandlerImpl.java:159)
at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:119)
at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(BCELStubBase.java:197)
at be.macharis.toon.pacita.common.__OriginFacadeRemote_Remote_DynamicStub.setOrigin(__OriginFacadeRemote_Remote_DynamicStub.java)
at be.macharis.toon.pacita.common._OriginFacadeRemote_Wrapper.setOrigin(be.macharis.toon.pacita.common._OriginFacadeRemote_Wrapper.java)
at pacita.servlets.ContainerRegistry.processRequest(ContainerRegistry.java:64)
at pacita.servlets.ContainerRegistry.doGet(ContainerRegistry.java:95)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:397)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:278)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:240)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:179)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:239)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:667)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(ProcessorTask.java:574)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:844)
at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:287)
at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)
Caused by: java.lang.ClassNotFoundException
... 77 more
----------END server-side stack trace---------- vmcid: SUN minor code: 257 completed: Maybe -
EJB Reference could not be resolved (javax.naming.NameNotFoundException)
I am new to EJBs and am trying to get a simple Java client to run which I've generated from a EJB3.0 session bean.
The code for the client (LoanAppFacadeClient.java) is
package buslogic;
import java.util.Hashtable;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
public class LoanAppFacadeClient {
public static void main(String [] args) {
try {
final Context context = getInitialContext();
LoanAppFacade loanAppFacade = (LoanAppFacade)context.lookup("java:comp/env/ejb/LoanAppFacade");
// Call any of the Remote methods below to access the EJB
// System.out.println( loanAppFacade.getLoans( ) );
loanAppFacade.addLoan( "Galactic Loans", 30, "fixed", 6.25 );
String ssn = "123-12-1234";
System.out.println(loanAppFacade.getCreditRating( ssn ));
} catch (Exception ex) {
ex.printStackTrace();
private static Context getInitialContext() throws NamingException {
Hashtable env = new Hashtable();
// Standalone OC4J connection details
env.put( Context.INITIAL_CONTEXT_FACTORY, "oracle.j2ee.naming.ApplicationClientInitialContextFactory" );
env.put( Context.SECURITY_PRINCIPAL, "oc4jadmin" );
env.put( Context.SECURITY_CREDENTIALS, "welcome1" );
env.put(Context.PROVIDER_URL, "ormi://localhost:23791/LoanApp");
return new InitialContext( env );
When the trying to run the client I get a warning:
"WARNING: EJB Reference "ejb/LoanAppFacade" could not be resolved."
followed by the error
"javax.naming.NameNotFoundException: java:comp/env/ejb/LoanAppFacade not found in Lab1_BusinessServices-app-client"
When the client was created I right-clicked on the session bean (LoanAppFacadeBean which implements LoanAppFacade) and chose New Sample Java Client.
This automatically creates the java client and also created the following xml file (application-client.xml)
<?xml version = '1.0' encoding = 'windows-1252'?>
<application-client 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/application-client_1_4.xsd" version="1.4" xmlns="http://java.sun.com/xml/ns/j2ee">
<display-name>Lab1_BusinessServices-app-client</display-name>
<ejb-ref>
<ejb-ref-name>ejb/LoanAppFacade</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<remote>buslogic.LoanAppFacade</remote>
<ejb-link>LoanAppFacade</ejb-link>
</ejb-ref>
</application-client>
Could someone please help me to fix these errors?
Thanks,
AndrewI used windows for years whereby I stored all photos in folders. As macs don't use this concept I am finding it hard to organize my photos.
You can do this on your Mac too. Just don't use iPhoto. But iPhoto is a lot more flexible.
For instance:
I usually sort them by month so when I say move to an album I mean I create an album called for example '2013 March' so I can easily find specific photos/videos.
Click on the Magnifying Glass lower left to reveal the search box. Then click on the magnifying glass in the search box, and select Date. Now you can instantly find all the photos from a particular month, or day.
File -> New Smart Album will allow you to create an automatic album for any date or date range you choose.
Select one of the affected videos in the iPhoto Window and go File -> Reveal in Finder -> Original. A Finder Window should open with the file selected. Does it play? -
Hi
I have developed a search servlet and deployed it in tomcat 4.0.3 and connected to mysql database through jdbc by specifying jndi.
I have coded JNDI lokkup name as "java:comp/env/jdbc/KgoogleDB"
I have added a context in server.xml file of tomcat for DBCP connection pooling .I have tested this in windows and it is running well in it.
But when i hosted this in linux i got error like this
INIT OF SEARCH SERVLET
Error in file reading Connection refused
File Not Found
javax.naming.NameNotFoundException: Name java:comp is not bound in this Context
at org.apache.naming.NamingContext.lookup(NamingContext.java:811)
at org.apache.naming.NamingContext.lookup(NamingContext.java:194)
at javax.naming.InitialContext.lookup(InitialContext.java:354)
at DbConnect.getConnection(DbConnect.java:35)
at QueryDetails.Query(QueryDetails.java:32)
at Search.doPost(Search.java:66)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:446)
at org.apache.catalina.servlets.InvokerServlet.doPost(InvokerServlet.java:216)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at filters.ExampleFilter.doFilter(ExampleFilter.java:149)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at filters.ExampleFilter.doFilter(ExampleFilter.java:149)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:475)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.warp.WarpRequestHandler.handle(WarpRequestHandler.java:217)
at org.apache.catalina.connector.warp.WarpConnection.run(WarpConnection.java:194)
at java.lang.Thread.run(Thread.java:536)
Connection ID null
Entered FINALLY
=================================
What would be the cause of this error?.Please help me.
My server.xml context is
- <Host className="org.apache.catalina.connector.warp.WarpHost" name="www.keralagoogle.com" debug="0" appBase="/domains/www.yy.com/tomcat/webapps" unpackWARs="true">
- <Context path="/yyjava" docBase="/domains/www.yy.com/tomcat/webapps/yyjava" debug="0" reloadable="true" crossContext="true">
<Logger className="org.apache.catalina.logger.FileLogger" prefix="localhost_KgoogleDB." suffix=".txt" timestamp="true" />
<Resource name="jdbc/KgoogleDB" auth="Container" type="javax.sql.DataSource" />
- <ResourceParams name="jdbc/KgoogleDB">
- <parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
- <!--
Maximum number of dB connections in pool. Make sure you
configure your mysqld max_connections large enough to handle
all of your db connections. Set to 0 for no limit.
-->
- <parameter>
<name>maxActive</name>
<value>500</value>
</parameter>
- <!--
Maximum number of idle dB connections to retain in pool.
Set to 0 for no limit.
-->
- <parameter>
<name>maxIdle</name>
<value>300</value>
</parameter>
- <!--
Maximum time to wait for a dB connection to become available
in ms, in this example 10 seconds. An Exception is thrown if
this timeout is exceeded. Set to -1 to wait indefinitely.
-->
- <parameter>
<name>maxWait</name>
<value>12000</value>
</parameter>
- <!-- MySQL dB username and password for dB connections
-->
- <parameter>
<name>username</name>
<value>pratap</value>
</parameter>
- <parameter>
<name>password</name>
<value>ky67yumXg</value>
</parameter>
- <!-- Class name for mm.mysql JDBC driver
-->
- <parameter>
<name>driverClassName</name>
<value>com.mysql.jdbc.Driver</value>
</parameter>
- <!--
The JDBC connection url for connecting to your MySQL dB.
The autoReconnect=true argument to the url makes sure that the
mm.mysql JDBC Driver will automatically reconnect if mysqld closed the
connection. mysqld by default closes idle connections after 8 hours.
-->
- <parameter>
<name>url</name>
<value>jdbc:mysql://localhost:3306/kgoogle?</value>
</parameter>
</ResourceParams>
</Context>
==============================
Please help me find if i have to change the syntax for linux in the above code.
Thanks in Advance
Prathaphi
Thanks for your advise.
But when i chenged my web.xml and jndi name in my servlet file i got error like this
javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
at org.apache.naming.NamingContext.lookup(NamingContext.java:811)
at org.apache.naming.NamingContext.lookup(NamingContext.java:194)
at org.apache.naming.SelectorContext.lookup(SelectorContext.java:183)
at javax.naming.InitialContext.lookup(InitialContext.java:354)
at DbConnect.getConnection(DbConnect.java:35)
at QueryDetails.Query(QueryDetails.java:32)
at Search.doPost(Search.java:66)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServl
et.java:446)
at org.apache.catalina.servlets.InvokerServlet.doPost(InvokerServlet.jav
a:216)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:193)
at filters.ExampleFilter.doFilter(ExampleFilter.java:149)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:213)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:193)
at filters.ExampleFilter.doFilter(ExampleFilter.java:149)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:213)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
.java:566)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica
torBase.java:475)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
.java:564)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve
.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:
2343)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:180)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatche
rValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:
468)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcesso
r.java:1012)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.ja
va:1107)
at java.lang.Thread.run(Thread.java:536)
Connection ID null
Entered FINALLY
Please help me
Thanks in Advance
Prathap -
Javax.naming.NameNotFoundException: SessionEJBBean not found
Please help I am getting error: javax.naming.NameNotFoundException: SessionEJBBean not found.
I am using JDeveloper 10g as editor.
The embedded server is running, SessionEJBBean is also there. I have restarted the computer, changed 'SessionEJB' from 'SessionEJBBean'. Yet No success. This is what I get.:
javax.naming.NameNotFoundException: SessionEJBBean not found
at com.evermind.server.rmi.RMIClientContext.lookup(RMIClientContext.java:52)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at friends.SessionEJBClient.main(SessionEJBClient.java:11)
Process exited with exit code 0.
SessionEJBClient.java
package friends;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
public class SessionEJBClient {
public static void main(String [] args) {
try {
final Context context = getInitialContext();
SessionEJB sessionEJB = (SessionEJB)context.lookup("SessionEJBBean");
} catch (Exception ex) {
ex.printStackTrace();
private static Context getInitialContext() throws NamingException {
// Get InitialContext for Embedded OC4J
// The embedded server must be running for lookups to succeed.
return new InitialContext();
}Thank you.Thanks Karma-9 for your reply. My issue has got resolved as I followed this link:
http://www.oracle.com/technology/obe/obe1013jdev/10131/10131_ejb_30/ejb_30.htm
However I have now new problem in hand, when I am trying to insert data in database
using JSP. I am having problem with request.getParameter(). It is not
recognised by JSP. A red underline is being shown below
request.getParameter(). One more thing, in JSP page, if I take cursor over
'request' in request.getParameter, it shows, 'Name request not found'. When
I take cursor over 'getParameter' in request.getParameter, it shows, 'Method
getParameter (java.lang.String) not found in<unknown>'.
This is my code:
MyPage.jsp
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ page contentType="text/html;charset=windows-1252"%>
<%@ page import="java.sql.*, javax.naming.Context,
javax.naming.InitialContext, javax.naming.NamingException,
friendspackage.*, java.text.*, java.util.*"%>
<%!
public void jspInit () {
String name, city;
name = request.getParameter("name");
city = request.getParameter("city");
try {
final Context context = getInitialContext();
SessionFriends sessionFriends =
(SessionFriends)context.lookup("SessionFriends");
sessionFriends.addFriends("name","city");
//System.out.println( "Success" );
} catch (Exception ex) {
ex.printStackTrace();
private static Context getInitialContext() throws NamingException {
// Get InitialContext for Embedded OC4J
// The embedded server must be running for lookups to succeed.
return new InitialContext();
%>MyPage.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252"></meta>
<title>My Friends</title>
</head>
<body>
<form name="MyFriends" action="MyFriends.jsp" method="post">
Name:
<input type="text" name="name">
City:
<input type="text" name="city">
<input type="submit" value="Submit">
</form>
</body>
</html>Please let me know if I have to make any changes in web.xml which is:
<?xml version = '1.0' encoding = 'windows-1252'?>
<web-app 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" version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee">
<description>Empty web.xml file for Web Application</description>
<session-config>
<session-timeout>35</session-timeout>
</session-config>
<mime-mapping>
<extension>html</extension>
<mime-type>text/html</mime-type>
</mime-mapping>
<mime-mapping>
<extension>txt</extension>
<mime-type>text/plain</mime-type>
</mime-mapping>
</web-app>Thank you again.
Anurag
Maybe you are looking for
-
Update Header Partner data in a Purchase Order in 4.6C system.
Hello all, I have written a report program to add/update partner data at PO header level. The report uses BAPI POCHANGE for the update. But the BAPI_PO_CHANGE does not transfer/update Partner Information for the PO's in 4.6 C system. The same code fu
-
How to correctly sync from Itunes after Ipod touch
Hi, I just got a new Iphone 3G, after having used an Ipod touch. I synced the Iphone from Itunes, and all my existing apps and settings have synced OK, but all the apps are empty and none of my photos, videos etc. have synced - even though I went thr
-
Attaching a PDF document to an order from Web
Hi, We have a requirement to attached a PDF document to an order in SAP from a web front end (its a custom web application written in cold fusion). We currently create orders from this web application which talks to SAP via XI. I know that using the
-
Hi I have a Macbook pro using OS X 8.5.1. I have just download acrobat pro XI. When I try putting a video (Quick time) in a PDF document, the button is there, but when I clic to play, the document is close without notice. Acrobat pro XI is suppose to
-
Occasionally flickering iMac screen after installing Yosemite
Occasionally flickering iMac ()intel) screen after installing Yosemite. Cannot yet specify when the flickering occurs, but it cover large sections of the screen. Absolutely annoying.