Error connecting to an EJB 3.0 Remote on OC4J 10.1.3.2 from Tomcat
Hi, I want to connect to a Remote Session Bean running on the OC4J 10.1.3 and it doesn´t work.
I have connected to it from a java standalone application using:
public static void main(String [] args) {
try {
final Context context = getInitialContext();
SessionEJB sessionEJB = (SessionEJB)context.lookup("java:comp/env/ejb/SessionEJB");
System.out.println(sessionEJB.mergeEntity(""));
System.out.println( "hola" );
} 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, "passw" );
env.put(Context.PROVIDER_URL, "ormi://localhost:23791/ejb3jar");
return new InitialContext( env );
with this application-client.xml file:
<?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>Model-app-client</display-name>
<ejb-ref>
<ejb-ref-name>ejb/SessionEJB</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<remote>ar.com.eds.ejb3.model.SessionEJB</remote>
<ejb-link>SessionEJB</ejb-link>
</ejb-ref>
thats works fine, but when I try to use the same solution from a jsf proyect running on a Tomcat 5.5.20, it fails with this error:
Caused by: java.lang.RuntimeException: Error while creating home.
at ar.com.mcd.fawkes.ui.locator.EJB3Locator.get(EJB3Locator.java:32)
at ar.com.mcd.fawkes.ui.locator.ServiceLocator$1.get(ServiceLocator.java:12)
at net.sf.opentranquera.web.jsf.locator.ServiceLocatorBean.get(ServiceLocatorBean.java:42)
at com.sun.faces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:79)
at com.sun.faces.el.impl.ArraySuffix.evaluate(ArraySuffix.java:187)
at com.sun.faces.el.impl.ComplexValue.evaluate(ComplexValue.java:171)
at com.sun.faces.el.impl.ExpressionEvaluatorImpl.evaluate(ExpressionEvaluatorImpl.java:263)
at com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:160)
... 80 more
Caused by: javax.naming.NameNotFoundException: Name ejb is not bound in this Context
at org.apache.naming.NamingContext.lookup(NamingContext.java:769)
at org.apache.naming.NamingContext.lookup(NamingContext.java:139)
at org.apache.naming.NamingContext.lookup(NamingContext.java:780)
at org.apache.naming.NamingContext.lookup(NamingContext.java:139)
at org.apache.naming.NamingContext.lookup(NamingContext.java:780)
at org.apache.naming.NamingContext.lookup(NamingContext.java:152)
at org.apache.naming.SelectorContext.lookup(SelectorContext.java:136)
at javax.naming.InitialContext.lookup(Unknown Source)
at ar.com.mcd.fawkes.ui.locator.EJB3Locator.get(EJB3Locator.java:28)
... 87 more
Could you please help me with any tip?
Mauricio
Message was edited by:
Mauricio
Hi, Rick
Thanks for your help.
I deleted de application-client.xml file, added the following lines to the web.xml file:
<ejb-ref>
<ejb-ref-name>ejb/SessionEJB</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<remote>ar.com.eds.ejb3.model.SessionEJB</remote>
</ejb-ref>
and now I´m using oracle.j2ee.rmi.RMIInitialContextFactory
there is no error, and it doesn´t throw any exception but the following line returns null.
SessionEJB sessionEJB = (SessionEJB)context.lookup("java:comp/env/ejb/SessionEJB");
Its seems the lookup method finds the remote ejb because it doesn´t fail, but it returns null.
Any idea what is wrong?
Mauricio.
Similar Messages
-
Error connecting to JServer/EJB
Hi all,
I've successfully deployed a BC4J Application Module as EJB Session Bean into Oracle8i 8.1.6. The test on this Application Module works fine.
The client code that calls the EJB is:
package ricercalista.client;
import java.util.Hashtable;
import javax.naming.*;
import oracle.jbo.*;
import ricercalista.client.ejb.LoginModuleEJBClient;
import oracle.jbo.client.remote.ejb.*;
import oracle.jbo.common.remote.*;
import oracle.jbo.common.remote.ejb.*;
import ricercalista.common.ejb.*;
import ricercalista.common.*;
public class LoginClient {
final String AMDefName = "ricercalista.LoginModule";
final String username = "omero";
final String password = "omero";
final String dbUrl = "jdbc:oracle:thin:omero/omero@localhost:1521:OMERO";
public LoginClient() {
try {
Hashtable env = new Hashtable(10);
env.put(Context.INITIAL_CONTEXT_FACTORY, JboContext.JBO_CONTEXT_FACTORY);
env.put(JboContext.DEPLOY_PLATFORM, JboContext.PLATFORM_ORACLE8I);
env.put(JboContext.SECURITY_PRINCIPAL, username);
env.put(JboContext.SECURITY_CREDENTIALS, password);
env.put(JboContext.HOST_NAME, "bacco08.csr.unibo.it");
env.put(JboContext.CONNECTION_PORT, "2481");
env.put(JboContext.ORACLE_SID, "OMERO");
env.put(JboContext.APPLICATION_PATH, "test/omero/ejb");
Context ic = new InitialContext(env);
LoginModuleHome home = (LoginModuleHome) ic.lookup(AMDefName);
LoginModuleEJBClient myejb = (LoginModuleEJBClient) home.create();
myejb.getTransaction().connect(dbUrl, username, password);
myejb.setUser("turronic", "chris");
System.out.println((String) myejb.getCognome());
System.out.println((String) myejb.getNome());
ricercalista.UserProfile up = myejb.getUserProfile();
for (int i = 0; i < up.size(); i++) {
System.out.println("dominio = " + up.getCodeDomain(i) + " grado = " + up.getInterestDegree(i));
myejb.getTransaction().disconnect();
myejb.remove();
catch (java.rmi.RemoteException re) {
System.out.println("Remote exception in creating " + AMDefName);
re.printStackTrace();
catch (javax.ejb.CreateException ce) {
System.out.println("Unable to create ejb " + AMDefName);
ce.printStackTrace();
catch (NamingException ne) {
System.out.println("Unable to find application " + AMDefName);
ne.printStackTrace();
catch (oracle.jbo.ApplicationModuleCreateException e) {
System.out.println("Unable to create application module " + AMDefName);
e.printStackTrace();
public static void main(String[] args) {
new LoginClient();
When I run this client, an error occurs on the statement:
LoginModuleHome home = (LoginModuleHome) ic.lookup(AMDefName);
The error is:
System Error: javax.naming.NamingException: Unknown reasons. Root exception is java.lang.ClassNotFoundException: ricercalista.common.ejb.LoginModuleHomeHelper
System Error: void oracle.jbo.client.remote.corba.aurora.AuroraApplicationModuleHome.initRemoteHome() (AuroraApplicationModuleHome.java:167)
System Error: void oracle.jbo.client.remote.corba.aurora.AuroraApplicationModuleHome.<init>(oracle.jbo.JboContext, java.lang.String) (AuroraApplicationModuleHome.java:75)
System Error: oracle.jbo.common.JboHome oracle.jbo.client.remote.corba.aurora.AuroraInitialContext.createJboHome(java.lang.String) (AuroraInitialContext.java:47)
System Error: java.lang.Object oracle.jbo.common.JboInitialContext.lookup(java.lang.String) (JboInitialContext.java:72)
System Error: java.lang.Object javax.naming.InitialContext.lookup(java.lang.String) (InitialContext.java:349)
System Error: void ricercalista.client.LoginClient.<init>() (LoginClient.java:51)
System Error: void ricercalista.client.LoginClient.main(java.lang.String[]) (LoginClient.java:89)
Have you ever got this error? Is the client code right?
Thanks a lot!java.lang.ClassNotFoundException:ricercalista.common.ejb.LoginModuleHomeHelper
It's saying Call Not Found and I'm guessing that ricercalista.common.ejb.LoginModuleHomeHelper
is your class? Did your classes(jar file) get to the server in the right place? to be found? Is the Classpath set?
I'm not a EJB programmer though. -
Error connecting to ftp server
Dear All,
I'm doing file to file scenario through XI. The receiver communication channel is a normal file adapter and it is working perfectly fine . My sender communication channel is a FTP adapter. I'm trying to send a file from FTP to a folder on my integration engine. When i went into adapter monitoring, i got the error in the sender file adaper for ftp. The error is - " Error connecting to ftp server ".
normally, i'm able to do the ftp from integration server to my ftp server, but through XI , it is giving me the above mentioned error. I think some of my properties are not specified correctly. Kindly advise . The properties that i have specified in the ftp adapter are -
adapter type - file
transport protocol - ftp
message protocol - file
adapter engine - integration server
server - ip address of the ftp host
port - 21
username - username of the ftp server
password - password of the ftp user
connect mode - per file transfer
transfer mode - binary
folder - name of the folder created on the ftp root directory ( without the path ) Do i need to give the full path here ?
file name - file in the above specified folder
Kindly let me know.
Regards.
NaveenHI Naveen,
This link explains all the parameters that need to be entered for a file adpater. Just check it out and compare it with your values and your FTP settings.
http://help.sap.com/saphelp_nw04/helpdata/en/e3/94007075cae04f930cc4c034e411e1/content.htm
//folder - name of the folder created on the ftp root directory ( without the path ) Do i need to give the full path here ?
Yes, i think you should specify the full path here.
Regards,
bhavesh -
P2V Failed with the Error : "Connection closed at byte 11086778368. Giving"
hi,
P2v gets failed with the error: Connection closed at byte 11086778368. Giving up
i checked the p2v log from /tmp/
10826600K .......... .......... .......... .......... .......... 12% 18.5M 60m9s
10826650K .......... .......... .......... .......... .......... 12% 22.0M 60m9s
10826700K .......... .......... .......... .......... .......... 12% 22.1M 60m9s
10826750K .......... .......... .......... .......... .......... 12% 21.5M 60m9s
10826800K .......... .......... .......... .......... .......... 12% 4.69K 61m26s
10826850K .......... .......... .......... .......... .......... 12% 15.7M 61m26s
10826900K .......... .......... .......... .. 12% 1.50K=8m52s
13:29:53 (19.9 MB/s) - Connection closed at byte 11086778368. Giving up
please suggest if anybody had come across with problem....Raja Kondar wrote:
P2v gets failed with the error: Connection closed at byte 11086778368. Giving upDo you have enough drive space on the target server? You'll need at least 3x as much drive space as is available on the physical box you're converting. For example, if your physical server has a 72GB disk, you'll need ~200GB of free disk space on the Oracle VM Server. -
Connect to ejb gf 3 remote.
Hello I am trying to connect to a remote ejb from tomcat 6 with the ejb residing on glassfish 3.I am using the guide at [glassfish |https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html#nonJavaEEwebcontainerRemoteEJB] for advice.
My servers tomcat 6 and glassfish 3 are running on different ports and are on the same machine running on localhost.I want to get the most current technique to connect to a ejb in glassfish 3.I have tried to implement and use parts of tutorials but have not found one answer sufficient to my use.
I am using netbeans 6.9.I have followed he steps laid out in the glassfish guide.I have read to just include the gf-client.jar file which includes links to needed files.
here STEP 3:
"Note that the Java EE 6 API classes are automatically included by gf-client.jar so there is no need to explicitly add javaee.jar to the classpath. gf-client.jar refers to many other .jars from the GlassFish installation directory so it is best to refer to it from within the installation directory itself rather than copying it(and all the other .jars) to another location."
This is what I am doing.
I have tried using the appserv-rt.jar file to remove the java.lang.ClassNotFoundException: com.sun.enterprise.naming.SerialInitContextFactory.Though I don`t know the best way in that I got another error.
What library files do I include and where do I include them.I have included my ejb netbeans ejb.jar file so I just need the right libraries in the right places.Please offer you opinion and suggestions.
calling code
Context ic = null;
Properties props = new Properties();
props.setProperty("java.naming.factory.initial",
"com.sun.enterprise.naming.SerialInitContextFactory");
props.setProperty("java.naming.factory.url.pkgs",
"com.sun.enterprise.naming");
props.setProperty("java.naming.factory.state",
"com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl");
// optional. Defaults to localhost. Only needed if web server is running
// on a different host than the appserver
props.setProperty("org.omg.CORBA.ORBInitialHost", "localhost");
// optional. Defaults to 3700. Only needed if target orb port is not 3700.
props.setProperty("org.omg.CORBA.ORBInitialPort", "3700");
ic = new InitialContext(props);
try{
ExpoServiceFacadeRemote foo = (ExpoServiceFacadeRemote)ic.lookup(ExpoServiceFacadeRemote.class.getName());
foo.toString();
} catch (Exception e) {
e.printStackTrace();
} finally {
out.close();
}here I got an error in
ic = new InitialContext(props);
SEVERE: null
javax.naming.NoInitialContextException: Cannot instantiate class: com.sun.enterprise.naming.SerialInitContextFactory [Root exception is java.lang.ClassNotFoundException: com.sun.enterprise.naming.SerialInitContextFactory]
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:657)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
at javax.naming.InitialContext.init(InitialContext.java:223)
at javax.naming.InitialContext.<init>(InitialContext.java:197)
at Controller.com.processRequest(com.java:62)
at Controller.com.doGet(com.java:89)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassNotFoundException: com.sun.enterprise.naming.SerialInitContextFactory
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:46)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:654)
... 19 moreThanks gimbal2, i did what you said it is easier.I am also doing a programmatic login to glassfish 3 file realm I have set up. It works though it does not know my role i defined puzzling?
my user is orders.I previously did a login from a packaged war in my j2ee netbeans application.It worked by defining in sun-web.xml and the web.xml the role.But just defining the role in the sun-ejb-jar.xml doesn`t work for finding the user logged in role.
Where should I define my role for orders?
sun-ejb-jar.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sun-ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD GlassFish Application Server 3.0 EJB 3.1//EN" "http://www.sun.com/software/appserver/dtds/sun-ejb-jar_3_1-0.dtd">
<sun-ejb-jar>
<enterprise-beans/>
<security-role-mapping>
<role-name>admin</role-name>
<principal-name>orders</principal-name>
</security-role-mapping>
</sun-ejb-jar>
@Resource
SessionContext sessionContext;
@WebMethod(operationName = "authenticate")
public String authenticate(@WebParam(name = "username") String username,
@WebParam(name = "password") String password) {
String re_result = "";
ProgrammaticLogin programmaticLogin = new ProgrammaticLogin();
try {
if (programmaticLogin.login(username, password, "file", false)) {
if (sessionContext.isCallerInRole("admin")) {
re_result = sessionContext.getCallerPrincipal().getName();
} else {
re_result = "No";
} catch (Exception ex) {
Logger.getLogger(ExpoFacade.class.getName()).log(Level.SEVERE, null, ex);
return re_result;
}you see this line never gets executed
re_result = sessionContext.getCallerPrincipal().getName();Please inspect and offer you advice
cheers
Edited by: Nital Faxing on Nov 4, 2010 8:24 PM -
Error connecting to IONA ORB within an EJB
Hi,
I am trying to connect to a remote CORBA server(C++) through my ejb running on PE8.2, but when I init the IONA ORB in the ejb, I get the follwing exception:
Caused by: org.omg.CORBA.INITIALIZE: Exception reading properties, probably this is an applet but no applet parameter supplied to ORB.init vmcid: 0x0 minor code: 0 completed: No
at IE.Iona.OrbixWeb.CORBA.ORB._set_parameters(ORB.java:1573)
at IE.Iona.OrbixWeb.CORBA.ORB.<init>(ORB.java:81)
at IE.Iona.OrbixWeb.CORBA.ORB._create_orb(ORB.java:1611)
at IE.Iona.OrbixWeb.CORBA.ORB._initialise(ORB.java:1545)
at IE.Iona.OrbixWeb.CORBA.ORB.init(ORB.java:1505)
Here is the ORB invocation from my ejb:
public void initOrb(String p_hostName, String p_serverName) {
String[] args = {p_hostName, p_serverName};
Properties p = new Properties();
p.setProperty("org.omg.CORBA.ORBClass","IE.Iona.OrbixWeb.CORBA.ORB");
p.setProperty("org.omg.CORBA.ORBSingletonClass", "IE.Iona.OrbixWeb.CORBA.singletonORB");
// Initialize the ORB
ORB orb = (ORB)ORB.init(args,p);
}All the required libs are included in the appserver lib.
I have tried this with JBOSS and it works fine.
Do I need to replace the SunAS ORB libraries with the IONA ORB that I need to use?
Has anyone seen this before?Hi, Rick
Thanks for your help.
I deleted de application-client.xml file, added the following lines to the web.xml file:
<ejb-ref>
<ejb-ref-name>ejb/SessionEJB</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<remote>ar.com.eds.ejb3.model.SessionEJB</remote>
</ejb-ref>
and now I´m using oracle.j2ee.rmi.RMIInitialContextFactory
there is no error, and it doesn´t throw any exception but the following line returns null.
SessionEJB sessionEJB = (SessionEJB)context.lookup("java:comp/env/ejb/SessionEJB");
Its seems the lookup method finds the remote ejb because it doesn´t fail, but it returns null.
Any idea what is wrong?
Mauricio. -
Error connection with a database in remote node
When I try to start a dialog instance does not detect that the database is in a remote server is booted:
"Checking SAP R/3 PAP Database
Database is not available via /usr/sap/PAP/SYS/exe/run/R3trans -d -w
Database PAP must be started on remote server"
The output of R3trans -x is:
"This is ./R3trans version 6.05 (release 46D - 28.03.01 - 11:30:00).
2EETW169 no connect possible: "DBMS = ORACLE --- dbs_ora_tnsname = 'PAP'"
./R3trans finished (0012)."
The output of trans.log is:
"4 ETW000 [developertrace,0] -->oci_logon(con_hdl=0, user='', dbname='PAP')
4 ETW000 88 0.035395
4 ETW000 [dboci.c ,0] *** ERROR => OCI-call 'olog' failed: rc = 12705
4 ETW000 75859 0.111254
4 ETW000 [dbsloci.,0] *** ERROR => CONNECT failed with sql error '12705'"
Can anybody help me to solve this problem?Thank you for your help, RK.
The problem was that sidadm was not the owner of ORA_NLS.
Now I have another problem: when running startsap not boot disp + work. -
ISE Alarm - Error connecting to remote feed URL
Hi all,
My ISE administration node generate alarm as attached.
anyone known this error? what does it means? does it related to posture update or what? because when this error message occur, there is no schedulling posture update.?
Regards,
RianHi Rian,
I think this error/alarm can be seen when we have "ISE > Administration > System > Settings > Client Provisioning" configured for automatic update or Downloading Client Provisioning Resources Automatically.
It could be an network flip or internet issue.
If we have configured proxy settings Administration > System > Settings > Proxy then check if proxy server is working fine.
Make sure there is no firewall that could create issues while connecting to URL.
Cannot Download Remote Client Provisioning Resources
http://www.cisco.com/en/US/docs/security/ise/1.1/user_guide/ise_troubleshooting.html#wpxref65566
Jatin Katyal
- Do rate helpful posts - -
WLST : Error connecting to a remote Weblogic server instance from OEPE 3.7
Attempting a to run a weblogic script connecting to a remote weblogic server instance (10.3.5), which is generating the following exception in OEPE 3.7.2 -
username = 'weblogic'
password = 'weblogic6'
url='t3://xxx.xxx.com:7001'
connect(username,password,url)
Connecting to t3://xxx.xxx.com:7001 with userid weblogic ...
This Exception occurred at Fri Feb 01 13:20:54 MST 2013.
Error occured while performing connect : Error connecting to the server : Failed to generate class for weblogic.management.mbeanservers.compatibility.internal.MBeanHomeImpl_1035_WLStub
Use dumpStack() to view the full stacktrace :
java.lang.AssertionError: Failed to generate class for weblogic.management.mbeanservers.compatibility.internal.MBeanHomeImpl_1035_WLStubconnect
Problem invoking WLST - Traceback (innermost last):
File "C:\Users\hughese\workspace\12c_wlst\wlst\heapsize.py", line 13, in ?
File "<iostream>", line 22, in connect
File "<iostream>", line 648, in raiseWLSTException
WLSTException: Error occured while performing connect : Error connecting to the server : Failed to generate class for weblogic.management.mbeanservers.compatibility.internal.MBeanHomeImpl_1035_WLStub
Use dumpStack() to view the full stacktrace
Connecting to the local weblogic server instance (t3://localhost:7001) works okay.
From the command prompt (wlst.cmd) I'm able to connect to the remote weblogic server instance -
wls:/offline> connect('weblogic','xxxxx','t3:xxx.xxx.com:7001') ;
Connecting to t3://xxx.xxx.com:7001 with userid weblogic ...
Successfully connected to Admin Server 'AdminServer' that belongs to domain 'IDMDomain'.
I've compared the CLASSPATHs between OEPE and the command prompt.
Any assistance would be greatly appreciated.
Edited by: 950635 on Feb 1, 2013 7:47 PMHi,
1)To get mysql JDBC driver to work on my Linux system, i had to add the classpath for the driver to the .bashrc:
CLASSPATH=./:home/<user>/java/mm.mysql-2.0.6/:home/<user>/java
Note that I execute the java program as the user <user> (and .bashrc is the config. file of this <user>...). Perhaps you must do this as well for the Oracle driver on your client machine. I don't know if your client machine is UNIX/LINUX or WINDOWS. It should only be clear that the CLASSPATH is set in the config. file of the user under which the java program runs and that this user has the permission to access the files.
There are no differences between accessing the database locally than accessing it by a network connection. The only thing that matters are that the connection parameters are right and that the network works properly.
2) are you sure that the table tname (case sensitivity?) exits?
Marc -
Error when connecting Applet to EJB
Hi,
I have an Applet that I try to connect to an EJB, but without success.
To pinpoint the problem, I took the client-side code of the example ...examples\ejb\basic\BeanManaged
and made an AWT Applet out of it.
I seem to trap some error when I call the getInitialContext() when trying to find the Home interface.
Nothing happens in my code (ie. the Applet) after I enter this part of the code. It is a it hard to say
where it stops, since I do not get all output. It seems to die when I am trying to instantiate the
Context-object or the AccountHome object. Maybe I just have a Classpath error.
When running the BeanManaged as a Java Application, everything is working fine.
Does anyone have any experience in these matters ?
I am using WL 5.1.0 (no SP-s), JDK 1.2.2
Regards, ErikThanks for you answer Jos, but honestly I don't know what I should do then, since I can't get data from database through the applet.
I have read some articles that we can get data from database through the applet (they use tomcat too). I have followed what the article said, but I still get the error.
Do you have any idea Jos? Thank you very much for your nice attention
Warmnest regards,
Vijay -
Error connecting to oracle DB using SAS 8.1
Hi,
I am using SAS 8.1(2005 Q1) and the oracle server is 9.2.0.1. I am trying to run a sample application given in the app server (jdbc-simple) and it's not connecting to the database.
I am using oracle thin driver.
I have created the jdbc connection pool named jdbc-pool too. Is there anything else I shud do? I am able to ping to the database using this connection pool but not able to run the application and getting http status 500 error with the following message:
java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key exception
This is the server.log file:
[#|2005-08-22T13:04:45.356+0530|SEVERE|sun-appserver-pe8.1_02|javax.enterprise.system.container.web|_ThreadID=11;|WEB0783: Error commiting response
java.io.IOException: An existing connection was forcibly closed by the remote host
at sun.nio.ch.SocketDispatcher.write0(Native Method)
at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:33)
at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:104)
at sun.nio.ch.IOUtil.write(IOUtil.java:75)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:302)
at java.nio.channels.Channels.write(Channels.java:60)
at java.nio.channels.Channels.access$000(Channels.java:47)
at java.nio.channels.Channels$1.write(Channels.java:134)
at org.apache.coyote.http11.InternalOutputBuffer.commit(InternalOutputBuffer.java:602)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.action(ProcessorTask.java:749)
at org.apache.coyote.Response.action(Response.java:188)
at org.apache.coyote.Response.sendHeaders(Response.java:380)
at org.apache.coyote.tomcat5.OutputBuffer.doFlush(OutputBuffer.java:357)
at org.apache.coyote.tomcat5.OutputBuffer.close(OutputBuffer.java:318)
at org.apache.coyote.tomcat5.CoyoteResponse.finishResponse(CoyoteResponse.java:496)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:188)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:653)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:534)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.doTask(ProcessorTask.java:403)
at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:55)
|#]
[#|2005-08-22T13:05:34.432+0530|WARNING|sun-appserver-pe8.1_02|javax.enterprise.resource.resourceadapter|_ThreadID=12;|RAR6017 : Failed to get connection pool object via JNDI lookup : jdbc-pool|#]
[#|2005-08-22T13:07:39.704+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.tools.deployment|_ThreadID=13;|DPL5109: EJBC - START of EJBC for [jdbc-simple]|#]
[#|2005-08-22T13:07:39.724+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.tools.deployment|_ThreadID=13;|Processing beans ...|#]
[#|2005-08-22T13:07:39.814+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.tools.deployment|_ThreadID=13;|DPL5110: EJBC - END of EJBC for [jdbc-simple]|#]
[#|2005-08-22T13:07:41.707+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.tools.deployment|_ThreadID=13;|Total Deployment Time: 10042 msec, Total EJB Compiler Module Time: 110 msec, Portion spent EJB Compiling: 1%
Breakdown of EJBC Module Time: Total Time for EJBC: 110 msec, CMP Generation: 0 msec (0%), Java Compilation: 0 msec (0%), RMI Compilation: 0 msec (0%), JAX-RPC Generation: 50 msec (45%),
|#]
[#|2005-08-22T13:07:42.568+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.tools.deployment|_ThreadID=13;|deployed with moduleid = jdbc-simple|#]
[#|2005-08-22T13:07:43.459+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.tools.admin|_ThreadID=14;|ADM1041:Sent the event to instance:[ApplicationDeployEvent -- reference-added jdbc-simple]|#]
[#|2005-08-22T13:07:43.669+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.tools.admin|_ThreadID=14;|ADM1042:Status of dynamic reconfiguration event processing:[success]|#]
[#|2005-08-22T13:07:43.759+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.tools.admin|_ThreadID=14;|ADM1041:Sent the event to instance:[ApplicationDeployEvent -- deploy jdbc-simple]|#]
[#|2005-08-22T13:07:44.159+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.container.ejb|_ThreadID=14;|Instantiated container for: ejbName: jdbc-simpleEJB; containerId: 73708094084546560|#]
[#|2005-08-22T13:07:44.430+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.core.classloading|_ThreadID=14;|LDR5010: All ejb(s) of [jdbc-simple] loaded successfully!|#]
[#|2005-08-22T13:07:44.440+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.container.web|_ThreadID=14;|WEB0100: Loading web module [jdbc-simple:jdbc-simple.war] in virtual server [server] at [/jdbc-simple]|#]
[#|2005-08-22T13:07:45.982+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.tools.admin|_ThreadID=14;|ADM1042:Status of dynamic reconfiguration event processing:[success]|#]
[#|2005-08-22T13:10:48.029+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=15;|
GreeterDBServlet is executing ...|#]
[#|2005-08-22T13:10:48.029+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=15;|
Retrieving JNDI initial context...|#]
[#|2005-08-22T13:10:48.049+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=15;|
- Retrieved initial context successfully|#]
[#|2005-08-22T13:10:48.049+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=15;|
Looking up dbGreeter bean home interface...|#]
[#|2005-08-22T13:10:48.049+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=15;|
- Looking up: java:comp/env/ejb/jdbc-simple|#]
[#|2005-08-22T13:10:48.169+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=15;|
- Looked up the EJB successfully|#]
[#|2005-08-22T13:10:48.179+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=15;|
Creating the dbGreeter bean...|#]
[#|2005-08-22T13:10:48.189+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=15;|
- Created EJB successfully |#]
[#|2005-08-22T13:10:48.189+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=15;|
Getting the message from the dbGreeter bean ...|#]
[#|2005-08-22T13:10:48.229+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=16;|
ejbCreate() on obj samples.jdbc.simple.ejb.GreeterDBBean@1cce278|#]
[#|2005-08-22T13:10:48.239+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=16;|
ejbCreate() on obj samples.jdbc.simple.ejb.GreeterDBBean@2848b1|#]
[#|2005-08-22T13:10:48.239+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=16;|
ejbCreate() on obj samples.jdbc.simple.ejb.GreeterDBBean@bc9c25|#]
[#|2005-08-22T13:10:48.239+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=16;|
ejbCreate() on obj samples.jdbc.simple.ejb.GreeterDBBean@af5e3c|#]
[#|2005-08-22T13:10:48.239+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=16;|
ejbCreate() on obj samples.jdbc.simple.ejb.GreeterDBBean@153e9cf|#]
[#|2005-08-22T13:10:48.239+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=16;|
ejbCreate() on obj samples.jdbc.simple.ejb.GreeterDBBean@1b16bd|#]
[#|2005-08-22T13:10:48.239+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=16;|
ejbCreate() on obj samples.jdbc.simple.ejb.GreeterDBBean@7210ec|#]
[#|2005-08-22T13:10:48.239+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=16;|
ejbCreate() on obj samples.jdbc.simple.ejb.GreeterDBBean@b4fa48|#]
[#|2005-08-22T13:10:48.239+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=16;|
ejbCreate() on obj samples.jdbc.simple.ejb.GreeterDBBean@19bcae1|#]
[#|2005-08-22T13:10:48.239+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=16;|
ejbCreate() on obj samples.jdbc.simple.ejb.GreeterDBBean@1249338|#]
[#|2005-08-22T13:10:48.239+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=16;|
ejbCreate() on obj samples.jdbc.simple.ejb.GreeterDBBean@3d787c|#]
[#|2005-08-22T13:10:48.239+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=16;|
ejbCreate() on obj samples.jdbc.simple.ejb.GreeterDBBean@1b12c9b|#]
[#|2005-08-22T13:10:48.239+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=16;|
ejbCreate() on obj samples.jdbc.simple.ejb.GreeterDBBean@e797db|#]
[#|2005-08-22T13:10:48.239+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=16;|
ejbCreate() on obj samples.jdbc.simple.ejb.GreeterDBBean@a2e5cc|#]
[#|2005-08-22T13:10:48.239+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=16;|
ejbCreate() on obj samples.jdbc.simple.ejb.GreeterDBBean@1a7a525|#]
[#|2005-08-22T13:10:48.249+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=16;|
ejbCreate() on obj samples.jdbc.simple.ejb.GreeterDBBean@52732d|#]
[#|2005-08-22T13:10:48.249+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=16;|
ejbCreate() on obj samples.jdbc.simple.ejb.GreeterDBBean@107939f|#]
[#|2005-08-22T13:10:48.249+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=16;|
ejbCreate() on obj samples.jdbc.simple.ejb.GreeterDBBean@6cdb70|#]
[#|2005-08-22T13:10:48.249+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=16;|
ejbCreate() on obj samples.jdbc.simple.ejb.GreeterDBBean@baa4a4|#]
[#|2005-08-22T13:10:48.249+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=16;|
ejbCreate() on obj samples.jdbc.simple.ejb.GreeterDBBean@18f22f3|#]
[#|2005-08-22T13:10:48.259+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=15;|
ejbCreate() on obj samples.jdbc.simple.ejb.GreeterDBBean@15ec870|#]
[#|2005-08-22T13:10:48.269+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=15;|
GreeterDB EJB is determining message...|#]
[#|2005-08-22T13:10:48.269+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=15;|
- Message determined successfully|#]
[#|2005-08-22T13:10:48.269+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=15;|
- Got this message from greeter bean: afternoon|#]
[#|2005-08-22T13:10:48.269+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=15;|
Getting the name input to this servlet...|#]
[#|2005-08-22T13:10:48.269+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=15;|
- Got name: gmfgmf|#]
[#|2005-08-22T13:10:48.269+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=15;|
Recording the greeting in the database...|#]
[#|2005-08-22T13:10:48.279+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=15;|
Getting datasource...|#]
[#|2005-08-22T13:10:48.279+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=15;|
- Got datasource successfully|#]
[#|2005-08-22T13:10:48.279+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=15;|
Getting connection...|#]
[#|2005-08-22T13:10:48.870+0530|WARNING|sun-appserver-pe8.1_02|javax.enterprise.resource.resourceadapter|_ThreadID=15;|RAR5038:Unexpected exception while creating resource|#]
[#|2005-08-22T13:10:48.870+0530|WARNING|sun-appserver-pe8.1_02|javax.enterprise.resource.resourceadapter|_ThreadID=15;|RAR5117 : Failed to obtain/create connection. Reason : Connection could not be allocated because: ORA-01017: invalid username/password; logon denied
|#]
[#|2005-08-22T13:10:48.870+0530|WARNING|sun-appserver-pe8.1_02|javax.enterprise.resource.resourceadapter|_ThreadID=15;|RAR5114 : Error allocating connection : [Error in allocating a connection. Cause: Connection could not be allocated because: ORA-01017: invalid username/password; logon denied
]|#]
[#|2005-08-22T13:10:48.870+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=15;|
- Could not interact with the database|#]
[#|2005-08-22T13:10:48.880+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=15;|
Exception: java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: ORA-01017: invalid username/password; logon denied
|#]
[#|2005-08-22T13:10:48.880+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=15;|
Storing the message in request object for the JSP...|#]
[#|2005-08-22T13:10:48.880+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=15;|
- Stored message successfully|#]
[#|2005-08-22T13:10:48.880+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=15;|
Dispatching JSP for output...|#]
[#|2005-08-22T13:11:48.408+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=15;|
GreeterDBView JSP is executing...|#]
[#|2005-08-22T13:11:48.408+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=15;|
GreeterDBView JSP is all done|#]
[#|2005-08-22T13:11:48.418+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=15;|
- Dispatched JSP successfully|#]
[#|2005-08-22T13:11:48.418+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=15;|
GreeterDBServlet is all done
|#]
[#|2005-08-22T13:11:53.283+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=15;|
GreeterDBServlet is executing ...|#]
[#|2005-08-22T13:11:53.283+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=15;|
Retrieving JNDI initial context|#]
[#|2005-08-22T13:11:53.293+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=15;|
- Retrieved initial context successfully|#]
[#|2005-08-22T13:11:53.293+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=15;|
Getting datasource...|#]
[#|2005-08-22T13:11:53.293+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=15;|
- Got datasource successfully|#]
[#|2005-08-22T13:11:53.293+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=15;|
Getting connection|#]
[#|2005-08-22T13:11:53.644+0530|WARNING|sun-appserver-pe8.1_02|javax.enterprise.resource.resourceadapter|_ThreadID=15;|RAR5038:Unexpected exception while creating resource|#]
[#|2005-08-22T13:11:53.644+0530|WARNING|sun-appserver-pe8.1_02|javax.enterprise.resource.resourceadapter|_ThreadID=15;|RAR5117 : Failed to obtain/create connection. Reason : Connection could not be allocated because: ORA-01017: invalid username/password; logon denied
|#]
[#|2005-08-22T13:11:53.664+0530|WARNING|sun-appserver-pe8.1_02|javax.enterprise.resource.resourceadapter|_ThreadID=15;|RAR5114 : Error allocating connection : [Error in allocating a connection. Cause: Connection could not be allocated because: ORA-01017: invalid username/password; logon denied
]|#]
[#|2005-08-22T13:11:53.664+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=15;|
- Could not interact with the database|#]
[#|2005-08-22T13:11:53.674+0530|SEVERE|sun-appserver-pe8.1_02|javax.enterprise.system.container.web|_ThreadID=15;|StandardWrapperValve[GreeterDBLogDisplayServlet]: Servlet.service() for servlet GreeterDBLogDisplayServlet threw exception
java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key exception
at java.util.ResourceBundle.getObject(ResourceBundle.java:326)
at java.util.ResourceBundle.getString(ResourceBundle.java:286)
at samples.jdbc.simple.servlet.GreeterDBLogDisplayServlet.doGet(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:747)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
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 org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:257)
at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:263)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:225)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:132)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:933)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:185)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:653)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:534)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.doTask(ProcessorTask.java:403)
at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:55)
|#]
[#|2005-08-22T13:14:00.758+0530|WARNING|sun-appserver-pe8.1_02|javax.enterprise.tools.launcher|_ThreadID=10;|LAUNCHER005:Spaces in your PATH have been detected. The PATH must be consistently formated (e.g. C:\Program Files\Java\jdk1.5.0\bin; ) or the Appserver may not be able to start and/or stop. Mixed quoted spaces in your PATH can cause problems, so the launcher will remove all double quotes before invoking the process. The most reliable solution would be to remove all spaces from your path before starting the Appservers components. |#]
[#|2005-08-22T13:14:00.948+0530|INFO|sun-appserver-pe8.1_02|javax.enterprise.tools.launcher|_ThreadID=10;|
D:/j2eesdk-1_4_02/jdk\bin\java
-client
-Xmx512m
-XX:NewRatio=2
-Dcom.sun.aas.defaultLogFile=D:/j2eesdk-1_4_02/domains/domain1/logs/server.log
-Dcom.sun.aas.verboseMode=true
-Djava.endorsed.dirs=D:/j2eesdk-1_4_02/lib/endorsed
-Djava.security.policy=D:/j2eesdk-1_4_02/domains/domain1/config/server.policy
-Djava.security.auth.login.config=D:/j2eesdk-1_4_02/domains/domain1/config/login.conf
-Dsun.rmi.dgc.server.gcInterval=3600000
-Dsun.rmi.dgc.client.gcInterval=3600000
-Djavax.net.ssl.keyStore=D:/j2eesdk-1_4_02/domains/domain1/config/keystore.jks
-Djavax.net.ssl.trustStore=D:/j2eesdk-1_4_02/domains/domain1/config/cacerts.jks
-Djava.ext.dirs=D:/j2eesdk-1_4_02/jdk/jre/lib/ext;D:/j2eesdk-1_4_02/domains/domain1/lib/ext
-Djdbc.drivers=com.pointbase.jdbc.jdbcUniversalDriver
-Djavax.management.builder.initial=com.sun.enterprise.admin.server.core.jmx.AppServerMBeanServerBuilder
-Dcom.sun.enterprise.config.config_environment_factory_class=com.sun.enterprise.config.serverbeans.AppserverConfigEnvironmentFactory
-Dcom.sun.enterprise.taglibs=appserv-jstl.jar,jsf-impl.jar
-Dcom.sun.enterprise.taglisteners=jsf-impl.jar
-Djavax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
-Dcom.sun.aas.configName=server-config
-Dorg.xml.sax.parser=org.xml.sax.helpers.XMLReaderAdapter
-Ddomain.name=
-Djmx.invoke.getters=true
-Djavax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
-Dcom.sun.aas.promptForIdentity=true
-Dorg.xml.sax.driver=com.sun.org.apache.xerces.internal.parsers.SAXParser
-Dcom.sun.aas.instanceRoot=D:/j2eesdk-1_4_02/domains/domain1
-Djavax.xml.transform.TransformerFactory=com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl
-Dcom.sun.aas.domainName=
-Djava.util.logging.manager=com.sun.enterprise.server.logging.ServerLogManager
-Dproduct.name=Sun-Java-System/Application-Server
-Dcom.sun.enterprise.overrideablejavaxpackages=javax.faces,javax.servlet.jsp.jstl,javax.xml.bind,javax.help
-Dcom.sun.aas.configRoot=D:/j2eesdk-1_4_02/config
-Djava.library.path=D:\j2eesdk-1_4_02\lib;D:\j2eesdk-1_4_02\lib;D:\j2eesdk-1_4_02\jdk\bin;.;C:\WINNT\system32;C:\WINNT;D:\j2eesdk-1_4_02\lib;D:\j2eesdk-1_4_02\bin;D:\j2eesdk-1_4_02\bin;D:\j2eesdk-1_4_02\bin;D:\oracle\ora81\lib;C:\j2sdk1.4.2_08\bin;D:\oracle\ora81\bin;C:\Program Files\Oracle\jre\1.1.7\bin;C:\Program Files\Oracle\jre\bin;c:\winnt;c:\winnt\system32;D:/j2eesdk-1_4_02/jdk/bin;D:/j2eesdk-1_4_02/lib;D:/j2eesdk-1_4_02/lib/locale;D:/JBuilder7/lib/bes;D:/j2eesdk-1_4_02/imq/lib/imqxm.jar;D:\j2eesdk-1_4_02\bin;D:/j2eesdk-1_4_02/bin
-Dcom.sun.aas.instanceName=server
-Dcom.sun.aas.processLauncher=SE
-cp
D:/j2eesdk-1_4_02/jdk/lib/tools.jar;D:/j2eesdk-1_4_02/lib/appserv-rt.jar;D:/j2eesdk-1_4_02/lib\activation.jar;D:/j2eesdk-1_4_02/lib\admin-cli.jar;D:/j2eesdk-1_4_02/lib\appserv-admin.jar;D:/j2eesdk-1_4_02/lib\appserv-cmp.jar;D:/j2eesdk-1_4_02/lib\appserv-ext.jar;D:/j2eesdk-1_4_02/lib\appserv-jstl.jar;D:/j2eesdk-1_4_02/lib\appserv-upgrade.jar;D:/j2eesdk-1_4_02/lib\commons-launcher.jar;D:/j2eesdk-1_4_02/lib\commons-logging.jar;D:/j2eesdk-1_4_02/lib\dom.jar;D:/j2eesdk-1_4_02/lib\j2ee-svc.jar;D:/j2eesdk-1_4_02/lib\j2ee.jar;D:/j2eesdk-1_4_02/lib\jax-qname.jar;D:/j2eesdk-1_4_02/lib\jaxr-api.jar;D:/j2eesdk-1_4_02/lib\jaxr-impl.jar;D:/j2eesdk-1_4_02/lib\jaxrpc-api.jar;D:/j2eesdk-1_4_02/lib\jaxrpc-impl.jar;D:/j2eesdk-1_4_02/lib\jmxremote.jar;D:/j2eesdk-1_4_02/lib\jmxremote_optional.jar;D:/j2eesdk-1_4_02/lib\jsf-api.jar;D:/j2eesdk-1_4_02/lib\jsf-impl.jar;D:/j2eesdk-1_4_02/lib\mail.jar;D:/j2eesdk-1_4_02/lib\relaxngDatatype.jar;D:/j2eesdk-1_4_02/lib\rmissl.jar;D:/j2eesdk-1_4_02/lib\saaj-api.jar;D:/j2eesdk-1_4_02/lib\saaj-impl.jar;D:/j2eesdk-1_4_02/lib\xalan.jar;D:/j2eesdk-1_4_02/lib\xercesImpl.jar;D:/j2eesdk-1_4_02/lib\xsdlib.jar;D:/j2eesdk-1_4_02/lib/install/applications/jmsra/imqjmsra.jar;D:/j2eesdk-1_4_02/imq/lib/jaxm-api.jar;D:/j2eesdk-1_4_02/imq/lib/fscontext.jar;D:/j2eesdk-1_4_02/lib/ant/lib/ant.jar;D:/j2eesdk-1_4_02/pointbase/lib/pbclient.jar;D:/j2eesdk-1_4_02/pointbase/lib/pbembedded.jar;${oracle.jdbc.lib.class.path}/ojdbc14.jar;${oracle.jdbc.lib.class.path}/ojdbc14_g.jar;${oracle.jdbc.lib.class.path}/ocrs12.zip
com.sun.enterprise.server.PEMain
stop
verbose|#]Cud someone tell me why am I getting this error?
Regards,
shipf1Other solution:
on refresh period, default value is 1 minute, force this value at 0 and your connection
is ok.
Eric
Joseph Weinstein <[email protected]> wrote:
Redo the pool definition, and set 'test connection on reserve'. Don't
set 'test connections on release', and leave refresh minutes alone.
add a test table. DUAL is perfect for that. Everything else seems
fine.
Joe
Rafid wrote:
I am getting this error when I try to make a connection to an Oracle817DB.
I am using Oracles drviers (classes12.zip)
<Nov 2, 2001 2:05:18 PM EST> <Error> <JDBC> <Cannot startup connectionpool
"genPool" Test table must be specifed for genPool with 'test connectionon
reserve' or 'test connection on release' or 'refresh minutes' set higher
than 0.>
<Nov 2, 2001 2:05:18 PM EST> <Info> <JDBC> <Creating TX Data Sourcenamed
weblogic.jdbc.jts.genPool for pool genPool>
<Nov 2, 2001 2:05:18 PM EST> <Info> <JDBC> <Checking existence of connection
pool genPool requested by user system>
<Nov 2, 2001 2:05:18 PM EST> <Error> <JDBC> <Error during Data Source
creation: weblogic.common.ResourceException:
DataSource(weblogic.jdbc.jts.genPool) can't be created with non-existent
Pool (connection or multi) (genPool)>
I have created a connction pool called genPool,
set the URL :jdbc:oracle:thin:@genoracle:1521:GENORANY
driver class name = oracle.jdbc.driver.OracleDriver
Properties:
user=name ** where name is user
password=xx **where xx is password
dll=ocijdbc8
protocol=thin
I created the Tx Data Sources with
name = weblogic.jdbc.jts.genPool
jndi = weblogic.jdbc.jts.genPool
poolname = genPool
Can anyone help me through this, it would be a great help
Rafid Wahab -
Can't access EJB deployed on remote OC4J - what am I doing wrong?
I'm unable to access an EJB deployed on a remote OC4J instance (ie, part of a 9iAS installation on another machine vs local in JDeveloper).
I've reverted to a stupid-simple EJB in hopes of getting it going prior to trying my actual code. The EJB works fine in JDev (9.0.3) - I 'run' the EJB to start the local OC4J instance, run my client code (generated via the "New Sample Java Client..." option in the Navigator context popup) and all is well.
I then create an EAR file via the the "Create EJB Jar Deployment Profile..." context popup of the ejb-jar.xml node, followed by "Deploy to EAR file" from the context popup of the resulting ejb1.deploy node. I next "Deploy EAR File" via the "Oracle Enterprise Manager" that comes with 9iAS (the :1810 port). After successfully deploying, I modify my client code in JDeveloper, specifying the new connection information for the remote machine via the Hashtable constructor of InitialContext and attempt to run it. I've tried a number of Context.PROVIDER_URL forms, including: ormi://registered_pingable_host_name:23791/deployed_application_name
ormi://registered_pingable_host_name:23791/session_deployment_name (from the <enterprise-beans><session-deployment name="xxx"/></enterprise-beans> section of my orion-ejb-jar.xml file, as per a tip in this forum)
I've tried prefixing ormi:// with http:, but get no response whatesoever in this case.
I've also tried it without the port number (this port number matches that in my remote OC4J's <oc4j_instance_home>/config/rmi.xml file).
On the Context.SECURITY_PRINCIPAL and Context.SECURITY_CREDENTIALS settings, I've tried various values, generally using the 'admin' user, with passwords taken from:
<oc4j_instance_home>/principals.xml
<oc4j_instance_home>/application-deployments/application_name/principals.xml
I've also tried matching the password in the jazn-data.xml, to no avail - this password appears encrypted anyway, but thought I'd give it a try on the off-chance that it was just a randomly-generated password - no go.
I've also tried SCOTT/TIGER, anonymous, etc. Incidentally, the 'deactivated' attribute of the <user> tag is set to "false" in my principals.xml files.
No matter what I do, I always get back "javax.naming.NamingException: Lookup error: java.net.ConnectException: Connection refused: connect"
Additionally, I get this same message when I try to establish an Application Server Connection via JDev.
Clearly, I'm missing something critical (and probably simple), but I can't for the life of me figure it out.
Any help would be much appreciated!
Thanks,
Jim StollOk, well this is a bit strange...
3103 - 3103 also fails, and some experimentation has led me to find that any time that I specify a range smaller than 6 (3101 - 3106 works, 3101 - 3105, 3101-3101, 3103-3103, etc does not), the OC4J instance will not restart. I get "An error occurred while starting. The opmn request has failed. From opmn: HTTP/1.1 204 No Content Content-Length: 0 Content-Type: text/html Response: 0 of 1 processes started. Check opmn log files such as ipm.log and ons.log for detailed." in the OEM window (I specify the RMI port range, hit Apply, go to the OC4J instance home page, see that the Status is 'Down', hit Start, and get that message.) <ORACLE_HOME>/product/iasinfra/opmn/logs/ipm.log tells me:
02/12/03 09:41:12 There is no rmi port left for starting an OC4J process. Please check oc4j's port property in OPMN's configuration file.
02/12/03 09:41:12 start_proc: UID 3719788: failed to build args
02/12/03 09:41:12 start_proc_req: failed to start a process in GID OC4JJim2, type: 2
If I bump it up to 3101 - 3106 or higher, it starts right up. Running opmnadmin debug, as suggested by Venky (thanks Venky!), yields:
PROCESS TABLE
UID PID FLAGS TYPE STATUS REF HTTP AJP RMI JMS
3654011 84 00000040 OC4J Alive 1 0 3005 3106 3206
424987 604 00000000 Apache Alive 1 7777 0 0 0
2932088 14849 00000000 OC4J Alive 1 0 3003 3103 3203
3063160 14878 00000000 OC4J Alive 1 0 3001 3101 3201
3194232 14906 00000000 OC4J Alive 1 0 3000 3105 3205
3325304 14936 00000000 OC4J Alive 1 0 3002 3102 3202
3456376 14964 00000000 OC4J Alive 1 0 3004 3104 3204
Which is what I would expect, given the specified range of 3101-3106. Trying each of these ports in turn, I've found that I can hit the EJB successfully on 3106, but 3101 - 3105 all fail with:
javax.naming.NamingException: Lookup error: javax.naming.AuthenticationException: No such domain/application: Project7_2; nested exception is:
javax.naming.AuthenticationException: No such domain/application: Project7_2
java.lang.Object com.evermind.server.rmi.RMIContext.lookup(java.lang.String)
RMIContext.java:134
java.lang.Object javax.naming.InitialContext.lookup(java.lang.String)
InitialContext.java:350
void Samplemypackage9.MySessionEJBClient1.main(java.lang.String[])
MySessionEJBClient1.java:15
I'm a little concerned about assuming the high-end of the range to be the active port on a regular basis (though thus far, among about 20 - 30 tries spaced over 20 - 30 minutes, it has been...) - I guess I can have my code loop through the range until it finds a good port or exhausts the list, but that seems a bit excessive.
Can you think of a reason that my OC4J instance won't start with a range size of less than 6? I'm on 9iAS 9.0.2, if that makes any difference.
Thanks,
Jim -
Connecting to an ejb from another appserver
Hello,
I need to connect to an EJB running on a company's REMOTE Weblogic
appserver. I have done so using normal class files but now I wish to use an
EJB to do so. I am using Jboss but am getting errors from Jboss saying that
it cannot find certain files. Should I be able to connect to the remote
Weblogic server simply by giving JBOSS the url/t3 of it? This is what I am
doing in the JBOSS deployed ejb:
Properties properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
properties.put(Context.PROVIDER_URL, "t3://xxx.xxx.xx.xx");
InitialContext ctx = new InitialContext(properties);
should I just be using JBOSS context factory in my bean code or do I need
weblogic's? Doing this the way I am above, Jboss says it cannot find
"weblogic.jndi.WLInitialContextFactory". So I jared up the parent directory
inserting it into jboss and the next time it told me it couldn't find
com.java.util.collections.ArrayList. So I jarred up the com directory from
weblogic and gave jboss access to it. I now get a classnotfound for a class
which IS contained in the com directory which is now available to Jboss.
This tells me that I am going about this THE WRONG WAY. If anyone can help
or point me to a tutorial telling me how I can use another appserver to
connect to a remote Weblogic Server I would greatly appreciate it.
Troy HarrisEasier said then done (getting the higher ups to spend money on an expensive
ejb server right now).
Thanks,
Troy Harris
"Rob Woollen" <[email protected]> wrote in message
news:[email protected]..
No, you would need the weblogic classes on the client-side. You'd be
better off developing your ejb in wls.
-- Rob
Troy Lejuan Harris wrote:
Hello,
I need to connect to an EJB running on a company's REMOTE Weblogic
appserver. I have done so using normal class files but now I wish to
use an
EJB to do so. I am using Jboss but am getting errors from Jboss sayingthat
it cannot find certain files. Should I be able to connect to the remote
Weblogic server simply by giving JBOSS the url/t3 of it? This is what Iam
doing in the JBOSS deployed ejb:
Properties properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
properties.put(Context.PROVIDER_URL, "t3://xxx.xxx.xx.xx");
InitialContext ctx = new InitialContext(properties);
should I just be using JBOSS context factory in my bean code or do Ineed
weblogic's? Doing this the way I am above, Jboss says it cannot find
"weblogic.jndi.WLInitialContextFactory". So I jared up the parentdirectory
inserting it into jboss and the next time it told me it couldn't find
com.java.util.collections.ArrayList. So I jarred up the com directoryfrom
weblogic and gave jboss access to it. I now get a classnotfound for aclass
which IS contained in the com directory which is now available to Jboss.
This tells me that I am going about this THE WRONG WAY. If anyone canhelp
or point me to a tutorial telling me how I can use another appserver to
connect to a remote Weblogic Server I would greatly appreciate it.
Troy Harris -
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 -
Unable to call exported client methods of EJB session bean remote interface
I am unable to call client methods of a BC4J application module deployed as a Session EJB to Oracle 8i at the client side of my multi-tier application. There is no documentation, and I am unable to understand how I should do it.
A business components project has been created. For instance, its application module is called BestdataModule. A few custom methods have been added to BestdataModuleImpl.java file, for instance:
public void doNothingNoArgs() {
public void doNothingOneArg(String astr) {
public void setCertificate(String userName, String userPassword) {
theCertificate = new Certificate(userName, userPassword);
public String getPermission() {
if (theCertificate != null)
{if (theCertificate.getPermission())
{return("Yes");
else return("No, expired");
else return("No, absent");
theCertificate being a protected class variable and Certificate being a class, etc.
The application module has been tested in the local mode, made remotable to be deployed as EJB session bean, methods to appear at the client side have been selected. The application module has been successfully deployed to Oracle 8.1.7 and tested in the remote mode. A custom library containing BestdataModuleEJBClient.jar and BestDataCommonEJB.jar has been created.
Then I try to create a client basing on Example Oracle8i/EJB Client snippet:
package bestclients;
import java.lang.*;
import java.sql.*;
import java.util.*;
import javax.naming.*;
import oracle.aurora.jndi.sess_iiop.*;
import oracle.jbo.*;
import oracle.jbo.client.remote.ejb.*;
import oracle.jbo.common.remote.*;
import oracle.jbo.common.remote.ejb.*;
import oracle.jdeveloper.html.*;
import bestdata.client.ejb.*;
import bestdata.common.ejb.*;
import bestdata.common.*;
import bestdata.client.ejb.BestdataModuleEJBClient;
public class BestClients extends Object {
static Hashtable env = new Hashtable(10);
public static void main(String[] args) {
String ejbUrl = "sess_iiop://localhost:2481:ORCL/test/TESTER/ejb/bestdata.BestdataModule";
String username = "TESTER";
String password = "TESTER";
Hashtable environment = new Hashtable();
environment.put(javax.naming.Context.URL_PKG_PREFIXES, "oracle.aurora.jndi");
environment.put(Context.SECURITY_PRINCIPAL, username);
environment.put(Context.SECURITY_CREDENTIALS, password);
environment.put(Context.SECURITY_AUTHENTICATION, ServiceCtx.NON_SSL_LOGIN);
BestdataModuleHome homeInterface = null;
try {
Context ic = new InitialContext(environment);
homeInterface = (BestdataModuleHome)ic.lookup(ejbUrl);
catch (ActivationException e) {
System.out.println(e.getMessage());
e.printStackTrace();
System.exit(1);
catch (CommunicationException e) {
System.out.println(e.getMessage());
e.printStackTrace();
System.exit(1);
catch (NamingException e) {
System.out.println(e.getMessage());
e.printStackTrace();
System.exit(1);
try {
System.out.println("Creating a new EJB instance");
RemoteBestdataModule remoteInterface = homeInterface.create();
// Method calls go here!
// e.g.
// System.out.println(remoteInterface.foo());
catch (Exception e) {
System.out.println(e.getMessage());
e.printStackTrace();
It doesnt cause any errors. However, how must I call methods? The public interface RemoteBestdataModule has no such methods:
void doNothingNoArgs();
void doNothingOneArg(java.lang.String astr);
void setCertificate(java.lang.String userName, java.lang.String userPassword);
java.lang.String getPermission();
Instead of that it has the following methods:
oracle.jbo.common.remote.PiggybackReturn doNothingNoArgs(byte[] _pb) throws oracle.jbo.common.remote.ejb.RemoteJboException, java.rmi.RemoteException;
oracle.jbo.common.remote.PiggybackReturn doNothingOneArg(byte[] _pb, java.lang.String astr) throws oracle.jbo.common.remote.ejb.RemoteJboException, java.rmi.RemoteException;
oracle.jbo.common.remote.PiggybackReturn customQueryExec(byte[] _pb, java.lang.String aQuery) throws oracle.jbo.common.remote.ejb.RemoteJboException, java.rmi.RemoteException;
oracle.jbo.common.remote.PiggybackReturn setCertificate(byte[] _pb, java.lang.String userName, java.lang.String userPassword) throws oracle.jbo.common.remote.ejb.RemoteJboException, java.rmi.RemoteException;
oracle.jbo.common.remote.PiggybackReturn getPermission(byte[] _pb) throws oracle.jbo.common.remote.ejb.RemoteJboException, java.rmi.RemoteException;
I cannot call those methods. I can see how they are called in BestdataModuleEJBClient.java file:
public void doNothingNoArgs() throws oracle.jbo.JboException {
try {
oracle.jbo.common.remote.PiggybackReturn _pbRet = mRemoteAM.doNothingNoArgs(getPiggyback());
processPiggyback(_pbRet.mPiggyback);
if (_pbRet.isReturnStreamValid()) {
return;
catch (oracle.jbo.common.remote.ejb.RemoteJboException ex) {
processRemoteJboException(ex);
catch (java.rmi.RemoteException ex) {
processRemoteJboException(ex);
throw new oracle.jbo.JboException("Marshall error");
However, I cannot call getPiggyback() function! It is a protected method, it is available to the class BestdataModuleEJBClient which extends EJBApplicationModuleImpl, but it is unavailable to my class BestClients which extends Object and is intended to extend oracle.jdeveloper.html.WebBeanImpl!
It seems to me that I mustnt use RemoteBestdataModule interface directly. Instead of that I must use the public class BestdataModuleEJBClient that extends EJBApplicationModuleImpl and implements BestdataModule interface. It contains all methods required without additional arguments (see just above). However, how must I create an object of BestdataModuleEJBClient class? That is a puzzle. Besides my custom methods the class has only two methods:
protected bestdata.common.ejb.RemoteBestdataModule mRemoteAM;
/*This is the default constructor (do not remove)*/
public BestdataModuleEJBClient(RemoteApplicationModule remoteAM) {
super(remoteAM);
mRemoteAM = (bestdata.common.ejb.RemoteBestdataModule)remoteAM;
public bestdata.common.ejb.RemoteBestdataModule getRemoteBestdataModule() {
return mRemoteAM;
It looks like the remote application module must already exist! In despair I tried to put down something of the kind at the client side:
RemoteBestdataModule remoteInterface = homeInterface.create();
BestdataModuleEJBClient dm = new BestdataModuleEJBClient(remoteInterface);
dm.doNothingNoArgs();
Of course, it results in an error.
System Output: null
System Error: java.lang.NullPointerException
System Error: oracle.jbo.common.PiggybackOutput oracle.jbo.client.remote.ApplicationModuleImpl.getPiggyForRemovedObjects(oracle.jbo.common.PiggybackOutput) (ApplicationModuleImpl.java:3017)
System Error: byte[] oracle.jbo.client.remote.ApplicationModuleImpl.getPiggyfront(boolea
System Error: n) (ApplicationModuleImpl.java:3059)
System Error: byte[] oracle.jbo.client.remote.ApplicationModuleImpl.getPiggyback() (ApplicationModuleImpl.java:3195)
System Error: void bestdata.client.ejb.BestdataModuleEJBClient.doNothingNoArgs() (BestdataModuleEJBClient.java:33)
System Error: void bes
System Error: tclients.BestClients.main(java.lang.String[]) (BestClients.java:76)
I have studied a lot of documents in vain. I have found only various senseless discourses:
"Use the Application Module Wizard to make the Application Module remotable and export the method. This will generate an interface for HrAppmodule (HrAppmodule.java in the Common package) which contains the signature for the exported method promoteAllEmps(). Then, deploy the Application Module. Once the Application Module has been deployed, you can use the promoteAllEmps() method in your client-side programs. Calls to the promoteAllEmps() method in client-side programs will result in calls to the promote() method in the application tier."
However, I have failed to find a single line of code explaining how it should be called.
Can anybody help me?
Best regards,
Svyatoslav Konovaltsev,
[email protected]
nullDear Steven,
1. Thank you very much. It seems to me that the problem is solved.
2. "I logged into Metalink but it wants me to put in both a tar number and a country name to see your issue." It was the United Kingdom, neither the US nor Russia if you mean my issue.
I reproduce the text to be written by everyone who encounters the same problem:
package bestclients;
import java.util.Hashtable;
import javax.naming.*;
import oracle.jbo.*;
public class BestdataHelper {
public static ApplicationModule createEJB()
throws ApplicationModuleCreateException {
ApplicationModule applicationModule = null;
try {
Hashtable environment = new Hashtable(8);
environment.put(Context.INITIAL_CONTEXT_FACTORY, JboContext.JBO_CONTEXT_FACTORY);
environment.put(JboContext.DEPLOY_PLATFORM, JboContext.PLATFORM_EJB);
environment.put(Context.SECURITY_PRINCIPAL, "TESTER");
environment.put(Context.SECURITY_CREDENTIALS, "TESTER");
environment.put(JboContext.HOST_NAME, "localhost");
environment.put(JboContext.CONNECTION_PORT, new Integer("2481"));
environment.put(JboContext.ORACLE_SID, "ORCL");
environment.put(JboContext.APPLICATION_PATH, "/test/TESTER/ejb");
Context ic = new InitialContext(environment);
ApplicationModuleHome home = (ApplicationModuleHome)ic.lookup("bestdata.BestdataModule");
applicationModule = home.create();
applicationModule.getTransaction().connect("jdbc:oracle:kprb:@");
applicationModule.setSyncMode(ApplicationModule.SYNC_IMMEDIATE);
catch (NamingException namingException) {
throw new ApplicationModuleCreateException(namingException);
return applicationModule;
package bestclients;
import bestdata.common.*;
import certificate.*;
public class BestClients extends Object {
public static void main(String[] args) {
BestdataModule bestdataModule = (BestdataModule)BestdataHelper.createEJB();
Certificate aCertificate = new Certificate("TESTER", "TESTER");
//calling a custom method!!
bestdataModule.passCertificate(aCertificate);
Thank you very much,
Best regards,
Svyatoslav Konovaltsev.
[email protected]
null
Maybe you are looking for
-
Can't print from my printer after upgrading to Airport Extreme
I recently upgraded from the conehead airport to the newest Airport extreme. Now my Epson Artisan 700 wireless capable printer is listed as "offline" by my Macbook pro. I went through Epson support who indicated that my printer isn't WPA2 compatibl
-
I upgraded to 7.0.1 and now my library is gone. . . Please help
I am using a PC, and updated to iTunes 7.0.1. My music and iTunes are stored on an external hard drive, but I think that the upgrade was written to my regular drive. I still have all the files and library files. Is there a way to restore this with ou
-
Problem including Javascript in XSL
I have the following code working in Oracle 9IAS 1.0.2.2 and i can't put it at work in 9IAS Release 2. Any one can help my? Thanks for your time. <?xml version="1.0" encoding="iso-8859-1"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transf
-
-HP pavilion h8xt, two acer monitors (w. both vga and dvi and also an add'l dvi plug on the graphics card. Monitors came with a double ended dvi cord. Can I plug one monitor into the dvi of the graphic card and the other monitor into the other dv
-
CCMS on Component Monitoring in RWB
Hi all CCMS button on Componenet Monitoring in RWB, i clicked on this CCMS button. then i got the following error how can i solve? Service cannot be reached What has happened? URL http://sapxi.hh.net:8000/sap/public/bc/its/mimes/system/SL/page/hourgl