Accesing an EJB from an Applet
Hello,
I've published my first EJB to Oracle 8i, and when I use a
standalone java application as a client I have no problems.
But when I try to access with an Applet, the Java console shows:
javax.naming.NotContextException:
retvalentin09.cedetel.tel.uva.es:2481:ORCL/test/MyEJBRemote
The code I use to connect to the EJB is the same as in the
standalone application:
Hashtable env = new Hashtable();
System.out.println("Inicializando entorno...");
env.put(Context.URL_PKG_PREFIXES, "oracle.aurora.jndi");
env.put(Context.SECURITY_PRINCIPAL, "valentin");
env.put(Context.SECURITY_CREDENTIALS, "valentin");
env.put(Context.SECURITY_AUTHENTICATION,
ServiceCtx.NON_SSL_LOGIN);
System.out.println("Inicializado");
try{
Context ic = new InitialContext(env);
System.out.println("Contexto inicial creado");
MyEJBHome home = (MyEJBHome)
ic.lookup("sess_iiop://retvalentin09.cedetel.tel.uva.es:2481:ORCL
/test/MyEJBRemote");
System.out.println("Obtenido home Interface");
try{
try{
MyEJBRemote holaBean = home.create(); // create a
bean instance
System.out.println("Obtenida referencia a EJB");
System.out.println("Resultado: "+holaBean.DimeHola());
} catch (java.rmi.RemoteException
RE){System.out.println("Excepcion remota: "+RE);}
}catch (javax.ejb.CreateException
CE){System.out.println("Excepcion de creacion: "+CE);}
}catch (javax.naming.NamingException
nE){System.out.println("Excepcion de nombrado: "+nE);}
System.out.println("Finalizado");
What is going wrong? I use Java Plugin 1.2.2 in the
navigator, perhaps that is the problem.
I've tried to compile the applet in JDeveloper 2.0 with JDK
1.1.7, but the Netscape Communicator throws Security Exceptions
(I think the JVM of the navigator is 1.1.5), and it happens the
same with Internet Explorer.
I've tried to compile the applet in JDevelper 2.0 whit JDK 1.2,
and in both Communicator and Explorer the Java Console shows this
messages:
Java(TM) Plug-in: Version 1.2.2.pu
Using JRE version 1.2.2
User home directory = C:\WINNT\Profiles\Administrador
Proxy Configuration: Manual Configuration
Proxy: http=proxy.uva.es:80
Proxy Overrides:
JAR cache disabled.
Inicializando entorno...
Inicializado
Contexto inicial creado
Excepcion de nombrado: javax.naming.NotContextException:
retvalentin09.cedetel.tel.uva.es:2481:ORCL/test/MyEJBRemote
Finalizado
I would appreciate if somebody could help me, as it is very
urgent.
Thanks in advance
Valentin
null
Hi
Oracle8i comes with set of samples. One of sample is accessing an
EJB from applet. check out demo.tar/demo.zip file
$ORACLE_HOME/javavm/demo directory.
You will find it useful.
regards
raghu
Valentin Alonso (guest) wrote:
: Hello,
: I've published my first EJB to Oracle 8i, and when I use a
: standalone java application as a client I have no problems.
: But when I try to access with an Applet, the Java console
shows:
: javax.naming.NotContextException:
: retvalentin09.cedetel.tel.uva.es:2481:ORCL/test/MyEJBRemote
: The code I use to connect to the EJB is the same as in the
: standalone application:
: Hashtable env = new Hashtable();
: System.out.println("Inicializando entorno...");
: env.put(Context.URL_PKG_PREFIXES, "oracle.aurora.jndi");
: env.put(Context.SECURITY_PRINCIPAL, "valentin");
: env.put(Context.SECURITY_CREDENTIALS, "valentin");
: env.put(Context.SECURITY_AUTHENTICATION,
: ServiceCtx.NON_SSL_LOGIN);
: System.out.println("Inicializado");
: try{
: Context ic = new InitialContext(env);
: System.out.println("Contexto inicial creado");
: MyEJBHome home = (MyEJBHome)
ic.lookup("sess_iiop://retvalentin09.cedetel.tel.uva.es:2481:ORCL
: /test/MyEJBRemote");
: System.out.println("Obtenido home Interface");
: try{
: try{
: MyEJBRemote holaBean = home.create(); // create a
: bean instance
: System.out.println("Obtenida referencia a EJB");
: System.out.println("Resultado:
"+holaBean.DimeHola());
: } catch (java.rmi.RemoteException
: RE){System.out.println("Excepcion remota: "+RE);}
: }catch (javax.ejb.CreateException
: CE){System.out.println("Excepcion de creacion: "+CE);}
: }catch (javax.naming.NamingException
: nE){System.out.println("Excepcion de nombrado: "+nE);}
: System.out.println("Finalizado");
: What is going wrong? I use Java Plugin 1.2.2 in the
: navigator, perhaps that is the problem.
: I've tried to compile the applet in JDeveloper 2.0 with JDK
: 1.1.7, but the Netscape Communicator throws Security Exceptions
: (I think the JVM of the navigator is 1.1.5), and it happens the
: same with Internet Explorer.
: I've tried to compile the applet in JDevelper 2.0 whit JDK 1.2,
: and in both Communicator and Explorer the Java Console shows
this
: messages:
: Java(TM) Plug-in: Version 1.2.2.pu
: Using JRE version 1.2.2
: User home directory = C:\WINNT\Profiles\Administrador
: Proxy Configuration: Manual Configuration
: Proxy: http=proxy.uva.es:80
: Proxy Overrides:
: JAR cache disabled.
: Inicializando entorno...
: Inicializado
: Contexto inicial creado
: Excepcion de nombrado: javax.naming.NotContextException:
: retvalentin09.cedetel.tel.uva.es:2481:ORCL/test/MyEJBRemote
: Finalizado
: I would appreciate if somebody could help me, as it is very
: urgent.
: Thanks in advance
: Valentin
null
Similar Messages
-
Calling EJB from an applet in 9iAS Release 2?
Hello!
In 9iAS Release 1 it is not so easy to call an EJB from an applet. First the applet needs special privileges and then the applet starts only once. The cause of problem is the implementation of ormi.
Will 9iAS Rel. 2 support Applets calling EJBs?Jeff,
I am also trying to make an applet client for an EJB deployed to OC4J.
I modified the java2.policy file as you suggested, but when I tried to run my applet, I
got the following error:
java.lang.ExceptionInInitializerError: java.security.AccessControlException: access denied (java.util.PropertyPermission tunneling.shortcut read)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
at java.lang.System.getProperty(Unknown Source)
at java.lang.Boolean.getBoolean(Unknown Source)
at com.evermind.server.rmi.RMIInitialContextFactory.<clinit>(RMIInitialContextFactory.java:34)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.sun.naming.internal.VersionHelper12.loadClass(Unknown Source)
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.init(Unknown Source)
at javax.naming.InitialContext.<init>(Unknown Source)
at its.fnd.ejb.EJBHomeFinder.getHomeObject(Unknown Source)
at its.fnd.flight.ejb.EJBFlightFactory.<init>(Unknown Source)
at its.fnd.flight.FlightFactory.<init>(FlightFactory.java:97)
at EJBApplet.jbInit(EJBApplet.java:47)
at EJBApplet.init(EJBApplet.java:36)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
I am using OC4J (stand-alone) version 9.0.2.0.0 on Solaris 7 and Microsoft Internet Explorer
5.0 with the java 1.3.1 plug-in.
Here is the applet code that I use to lookup the EJB home interface:
Properties props = new Properties();
props.put(Context.INITIAL_CONTEXT_FACTORY,"com.evermind.server.rmi.RMIInitialContextFactory");
props.put(Context.PROVIDER_URL,"ormi://host:6666/app");
props.put(Context.SECURITY_PRINCIPAL,"admin");
props.put(Context.SECURITY_CREDENTIALS,"password");
Context ctxt = new InitialContext(props);
Object homeObj = ctxt.lookup("my_bean");
MyBeanHome home = PortableRemoteObject.narrow(homeObj, MyBeanHome.class);
The HTML page with the <applet> tag is a static HTML page that is part of OC4J's default
web application. The applet class file is located in a subdirectory of the default-web-app
directory. Here is the HTML page...
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
<TITLE>
HTML Test Page
</TITLE>
</HEAD>
<BODY>
<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" width="580" height="450" name="EJBApplet" align="middle" alt="Loading EJBApplet ...">
<param name="java_code" value="EJBApplet">
<param name="java_codebase" value="/tests">
<param name="java_archive" value="xerces.jar,ejb.jar,oc4j.jar,jaas.jar"/>
<param name="java_type" value="application/x-java-applet;version=1.3">
<param name="java_scriptable" value="true">
<table cellpadding="1" bgcolor="#FFFFFF" width="580" height="450">
<tr><td>
This is a place for an APPLET.<br>Your browser doesn't support the correct applet java plug-in.<br><br>You can install the correct plug-in from here.<br><a target='_blank' onClick='javascript:self.window.close()' href="/classes/3rdparty/j2re-win-plug-in.exe">Click here to install plug-in.</a><br><br>Or if you have an Internet connection you can install the correct plug-in from here.<br><a target='_blank' onClick='javascript:self.window.close()' href="http://java.sun.com/products/plugin/1.3/plugin-install.html">Click here to install plug-in from Internet.</a><br><br>You can call your System Administrator for assistance.</td></tr>
</table>
</object>
</BODY>
</HTML>
I have searched the Internet, and the documentation, and tried several, different things,
but I can't get it to work.
Any and all help will be greatly appreciated.
Thanks,
Sofia. -
Communicating with EJB from an applet
Hello there
can anyone please clarify an issue for me please? I would like to know if it's possible to call and EJB directly from an applet, without going via jsps or servlets. The J2EE specification says that "All J2EE components except applets, can be clients of RMI-IIOP objects. (Some products might also allow applets to use RMI-IIOP, but this capability is not required)." It appears to be the same situation for JDBC connections also. Would anyone please know how some products allow applets to be clients of RMI-IIOP and what exactly is required?
many thanks!Hi gurus....
I have the same question....
can anyone out there throw some light on the topic ?
many thanks,
Calherj -
Accesing COM port from an applet
Hello:
I am trying to develop an application that retrieves data from a VR glove and then use it to simulate the movement of it in an applet using VRML, anyway, as you can imagine, the applet is giving me problems when I try to access the serial port, it throws this particular exception :
java.lang.ExceptionInInitializerError: com/ms/security/SecurityExceptionEx
at HandAdapter.<init>
at HandManager.init
at com/ms/applet/AppletPanel.securedCall0
at com/ms/applet/AppletPanel.securedCall
at com/ms/applet/AppletPanel.processSentEvent
at com/ms/applet/AppletPanel.processSentEvent
at com/ms/applet/AppletPanel.run
at java/lang/Thread.run
I saw a solution to this problem using a netscape library, namely netscape.security.PrivilegeManager which fixes the problem, however, I haven�t found its counterpart for Internet Explorer.
I hope you guys know of a solution to this issue given that programmers are used to fix this kind of troubles all of the time when developing in applet technology. Thanks in advance.By default applets do not have access to the system... you can set your vm to, allow applets to have access completly to the system, not very secure. Also any one who is visiting your site will have to have this set in there VM... Unless it's for your own personal purposes...
Edit the java.policy so it contains only the following:
grant
permission java.security.AllPermission; -
Hi
I m new to Application servers and EJBs. I have successfully deployed a small EJB in Oracle9i AS. Now I want to write an client to access the EJB. I want the client to be an Applet. But i have found that the applet works only if certain permissions are granted in the client machine
Is there any way by which i can write an Applet that can access an EJB without making any changes in the client machine.
The code I use in the applet is given below.
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.ApplicationClientInitialContextFactory");
env.put(Context.PROVIDER_URL, "ormi://solomon:23791/helloEjb");
env.put("java.naming.security.principal", "admin");
env.put("java.naming.security.credentials", "welcome");
Context ic = new InitialContext (env);
HelloHome hello_home = (HelloHome)ic.lookup ("java:comp/env/helloServer.HelloBean");
Hello hello = hello_home.create ();
System.out.println (hello.helloWorld ());
The Exception i get while running the Applet without making any changes in the client machine is...
java.security.AccessControlException: access denied (java.util.PropertyPermission localhostIsAdmin read)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:272)
at java.security.AccessController.checkPermission(AccessController.java:399)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:545)
at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1278)
at java.lang.System.getProperty(System.java:599)
at com.evermind.server.ApplicationClientInitialContextFactory.getInitialContext(ApplicationClientInitialContextFactory.java:156)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:668)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246)
at javax.naming.InitialContext.init(InitialContext.java:222)
at javax.naming.InitialContext.<init>(InitialContext.java:198)
at TrialApplet.init(TrialApplet.java:51)
at sun.applet.AppletPanel.run(AppletPanel.java:344)
at java.lang.Thread.run(Thread.java:484) Process Exit...
If i use "com.evermind.server.rmi.RMIInitialContextFactory" instead of "com.evermind.server.ApplicationClientInitialContextFactory" the Exception is ..
java.security.AccessControlException: access denied (java.util.PropertyPermission localhostIsAdmin read)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:272)
at java.security.AccessController.checkPermission(AccessController.java:399)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:545)
at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1278)
at java.lang.System.getProperty(System.java:599)
at com.evermind.server.ApplicationClientInitialContextFactory.getInitialContext(ApplicationClientInitialContextFactory.java:156)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:668)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246)
at javax.naming.InitialContext.init(InitialContext.java:222)
at javax.naming.InitialContext.<init>(InitialContext.java:198)
at TrialApplet.init(TrialApplet.java:51)
at sun.applet.AppletPanel.run(AppletPanel.java:344)
at java.lang.Thread.run(Thread.java:484) Process Exit...
Thank you
Raeeshi Raees,
sorry for replying late. u r right that it gives u the same server name as that of hard coding it. but the thing is we should better leave it to the explorer, coz sometimes suppose the server is on the same m/c as that of client then applet to EJB call gives security exception in one of these two; 127.0.0.1 and the actual IP of m/c, even though both are same. (reason, for the sand box, 127.0.0.1 and actual IP are different addresses). it will work only with the IP address, with which it had downloaded applet, so that's the reason i said this, coz if they are on the same m/c, client can call it both ways and then hard coded thing will give problem in one case.
second thing, have u tried running it that way? i think, we just need to pass the server name and as we are the setting all these properties for JNDI services, it can detect on which port of server the naming service is running. and also i am not really sure, whether applet can use all the protocols or not (except for http). for futher reference, use this hyperlink. this is for j-boss app.server but shouldn't make much of the difference.
http://jboss.org/online-manual/HTML/ch13s21.html
hope this helps,
anshu -
Hi friends,
I have a problem of caling EJB from applet.that too from browser.
Through dos prompt,I am able to set the classpath and then open the applet and then call the EJB.but thru browser i am encontering two problems,
First,The codebase of applet is not being set and i am unable to view the applet.
Second,my Initial Context Factory is not being found it is giving error as
Cannot instantiate class: com.evermind.server.rmi.RMIInitialContextFactory.I am using oracle app server Oc4j2.
can any one help me out.
i am able to get output thru dos prompt where i can set classpathkyren,
he has used something called HTML ConvertersDepends on the version of the plug-in you are using.
(I'm sorry, but I couldn't find that detail in any of your posts!)
You have to use the (HTML) converter with java version 1.3 (for example), but you don't have to with java version 1.4.
thru my jbuilder version i am able to solve my
problem.
but thru browser,i am first of all not able to
display applet.That's because "JBuilder" uses the appletviewer to display the applet (and not a browser).
I Think for normal displaying applet we don't need of
signed or unsigned applet.when calling ejb we may
require.As Anupama has stated, the "codebase" attribute of the applet tag must be relative to the directory where the HTML file (containing the "applet" tag) is located. Where I work, we also use the "archive" attribute that tells the applet where to download the JAR files from. In order to lookup your ejb from your applet, you need (at least) the "oc4jclient.jar" file.
By the way, if you want your name to appear next to your posts (instead of your ID number), you need to update your profile. Click on the "Forum Settings" link at the top of the (Web) page.
Good Luck,
Avi. -
Porting EJBS from orion to JBoss
Hi
I want to port EJBs written in Orion application server to JBoss,
Which of the arreas chages are needed ? ,
Currently I am accessing EJBs from an Applet.
So can i use directly ear files in the Orion application server for JBoss.
I want my what all need be changed in following areas.
1. Server configuration
2. EJB deployment
3. Client code access ( i need to change JNDI initial contexts )
4. JMS configurations
thanks in advance
RenjithRenjithkv,
You would require different deployment descriptors for JBoss.
jboss.xml for Ejbs.
Modify standardjaws.xml or create jaws.xml for entity beans.
Modify standardjbosscmp-jdbc.xml or create jbosscmp-jdbc.xml for Ejb jdbc.
Deepak -
JNDI lookup from proxied applet is slow
Hi,
I am doing a t3s lookup for an EJB from an applet. The lookup is fairly fast (<
1 sec) if the browser is
setup to not use an HTTP proxy server. However, if the browser is setup to go
via a proxy server, the
t3s lookup takes upwards of 30 seconds.
Running the Weblogic server with -Dweblogic.system.enableReverseDNSLookups=false
makes
no difference.
I am using WLS5.1SP9, and Netscape 4.7 and IE5 browsers.
Any suggestions, please?
Thanks
RaviYour File-system Object Store should be in a place
accessible by your client application. Then you can
specify JNDI properties
java.naming.factory.initial
java.naming.provider.url
for the initial context. There are examples in
<install-directory>/examples/jms directory.
The ConnectionFactory object you created should
have broker hostname and port (if not default)
specified.
amy -
Hi all!
Need urgent help. We try to contact an session ejb ( deployed to the OC4J - Server ). but it hangs , while creating the InitialContext !!! No exception, the programm stops only, while creating the new initialContext...
It works great, when connecting the ejb from an application, but NOT from an applet. Is there somebody out there, having a solution for that problem ?? Or Somebody know an example, where an applet connects an EJB ??
Please help.
For further information : the source code :
System.out.println("BEGIN getInitialContext() ...");
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.ApplicationClientInitialContextFactory");
env.put(Context.PROVIDER_URL, "ormi://***.***.***.***/Server");
env.put(Context.SECURITY_PRINCIPAL, "******");
env.put(Context.SECURITY_CREDENTIALS, "*****");
try {
System.out.println(" BEGIN Create InitialContext");
javax.naming.InitialContext ic = new javax.naming.InitialContext(env);
System.out.println(" END Create InitialContext");
System.out.println("END getInitialContext() ...");
return ic;
} catch (Exception e) {
throw e;
nullcould this be the reason, you don'y say what browser you are using.
From IBM alphaworks site: http://www.alphaworks.ibm.com
RMI for IE4 installs the missing Remote Method Invocation (RMI) support for the Microsoft Java virtual machine, thus enabling RMI for all Java applications that use the Microsoft Java virtual machine.
Microsoft Internet Explorer 4.0 (IE 4.0) is one of the applications that uses Microsoft Java. Once installed, this package enables IE 4.0 to run applets that use RMI; such applets include the Java Management Applications for the IBM Nways Manager products.
null -
Applet + EJB (jBoss) - Error to get an EJB from Applet
Hello? All
Could anybody explain why i get an error here. There are an Applet, which should get an access to EJB which was deployed on JBOSS Server (version 4.2.2.GA). If I run this code as a Desktop Application (Make a window and put my panel here) - all OK. But if I run my Code as an Applet from HTML page I get an Exception like this:
java.lang.IllegalStateException: unread block data
I refer to my EJB this way:
public void init()
try
Properties jndiProps = new Properties();
String myServer = "michhome";
jndiProps.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory") ;
jndiProps.setProperty("java.naming.provider.url", myServer) ;
jndiProps.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces") ;
InitialContext ctx = new InitialContext(jndiProps);
// Error got here:
Object homeSource = ctx.lookup("Data1EJB");
Data1Home home = (Data1Home)PortableRemoteObject.narrow(homeSource, Data1Home.class) ;
RemoteBean1 = home.create() ;
catch (Exception e)
PrintException(e);
Fragment of my HTML page where I put an Applet:
<applet code=J2EEApplClientPKG.MainApplet codebase=classes ARCHIVE = "jbossall-client.jar" width=600 height=300>
</applet>
Thank you for time you spend on this question.Hello, my first applet is in the jar, and I want to
get it out.get it out you mean launch from an applet which would be
applet code=AppletClassName.class
archive="JarFileName.jar"
width=width height=height>
</applet>
or unjar it out which would be
jar -xvf JarFileName.jar
There is no plug-in installed here either, so I want
THE LATEST VERSION to be uploaded from sun
automatically.
My book suggested something like the code below, but
the plug-in version must be an oldie.
Please help!
<code>
<!--archive="napaku.jar"-->
<object
classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
width="307"
height="231"
codebase="http://java.sun.com/products/plugin/1.2/jinst
ll-12-win32.cab#Version=1,2,0,0">
<param name="code" value="Lottery.class" />
<param name="type" archive="napaku.jar" />
<comment>
<embed type="application/x-java-applet;version=1.2"
code="Lottery.class"
width="307"
height="231"
pluginspace="http://java.sun.com/products/plugin/1.2/pl
gin-install.html">
<noembed>
</comment>
"Napaku applet fails to load!
</noembed>
</embed>
</object>
</code>codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0">
The version may not be latest but you could change that as per your req. -
Calling a WebService from Java Applet
Hi all,
In my application I have 3 projects:
1. server - for all the business logic.
2. view - for web app.
3. swing - for applet.
In the view project I wrote a WS, and I want to call it from my applet. So I created a WS using the Jdev (10.1.3.2) wizard in the view project (I tested it and it worked fine), and in the swing project I created a proxy for this WS, tested it and it worked fine. Then I created a JAR containing the swing project with the WS proxy classes, opened the Applet and find out that I have some classes missing, so I started adding all the relevant Jars and ended with a ~13MB JAR containing all the swing project jars that in the class path for a simple Applet.
I know that I'm missing something but I dont know what. Do I really need all those Jars. Is there a simple way to call to a WS via Applet?
This is the list of all the Jars:
activation.jar
commons-logging-api.jar
commons-logging.jar
ejb.jar
http_client.jar
jaxb-api.jar
jaxb-impl.jar
jaxen.jar
jaxr-api.jar
jaxrpc-api.jar
jazncore.jar
jdom.jar
jms.jar
jta.jar
mail.jar
mdds.jar
oc4jclient.jar
ojdl2.jar
ojmisc.jar
ojpse.jar
oraclepki.jar
orajaxr.jar
orasaaj.jar
orawsdl.jar
orawsrm.jar
osdt_cert.jar
osdt_core.jar
osdt_saml.jar
osdt_wss.jar
osdt_xmlsec.jar
relaxngDatatype.jar
saaj-api.jar
saaj-impl.jar_old
servlet.jar
wsclient.jar
wsdl.jar
wssecurity.jar
wsserver.jar
xdb.jar
xml.jar
xmlparserv2.jar
xsdlib.jar
By the way at the end of all this annoying process I got the next exception:
[failed to localize] typemapping.nested.exception.initialization(javax.xml.rpc.JAXRPCException: javax.xml.soap.SOAPException: Unable to create SOAP Factory: Provider com.sun.xml.messaging.saaj.soap.ver1_1.SOAPFactory1_1Impl not found)
at oracle.j2ee.ws.client.BasicService.createLiteralMappings(BasicService.java:282)
at oracle.j2ee.ws.client.BasicService.createStandardTypeMappingRegistry(BasicService.java:244)
at com.tm.view.ws.misc.runtime.WSMisc_Service_SerializerRegistry.getRegistry(WSMisc_Service_SerializerRegistry.java:26)
at com.tm.view.ws.misc.runtime.WSMisc_Service_Impl.<init>(WSMisc_Service_Impl.java:26)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at oracle.j2ee.ws.client.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:92)
at oracle.j2ee.ws.client.ServiceFactoryImpl.loadService(ServiceFactoryImpl.java:121)
at com.tm.view.ws.misc.WSMiscSoap12HttpPortClient.<init>(WSMiscSoap12HttpPortClient.java:20)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at client.base.connectivity.ClientRequestAgent.runWS(ClientRequestAgent.java:135)
at client.base.connectivity.ClientRequestAgent.run(ClientRequestAgent.java:44)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
ShacharTry this:
1. open the webService data controll in the Data Controls section and drag the method from the webService onto the method call activity in your task flow. This will overwrite the current method property (the one which pints to your bean, make a copy of this entry if you can't reproduce it by hand). This too will create an entry in the pageDef of the method call activity.
2. reenter (or paste) the original value in the method property, so that it again points to your bean. The entry in the pageDef will remain!
3. now in the bean method you can access the method via its binding like you access any other method from the binding:
// GET A METHOD FROM PAGEDEF AND EXECUTE IT
// get the binding container
BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
// get an Action or MethodAction
OperationBinding method = bindings.getOperationBinding("YourMethodActionNAME");
if (method == null)
// handle method not found error...
// if there are parameters to set...
Map paramsMap = method.getParamsMap();
paramsMap.put("param","value") ;
// execute the method
method.execute();
List errors = method.getErrors();
if (!errors.isEmpty())
// handle errors here errors is a list of exceptions!
// no error resume normal workTimo -
Hello Developers!
I deployed my ejb to OAS4081. I call that
from JDeveloper so it good. But when I try
to call from applet in IExpl5 I can't
instantiate the ORB. I've got a com.ms.security.SecurityException : oracle.oas.orb.CORBA.ORB.init
I coded the CLASSPATH(oasoorb(yoj),client,
ejbapi...) perfectly, I think.
If anybody could help, please...
Thanx!Hi there,
I saw someone on this group had a problem to locate proper classpath
to call EJB from JSP. I thought if you call EJB from classpath, you are
calling the bean. But you loss all the EJB functions. To be able to utilize
EJB features like object pooling. You need to call it from Weblogic server
using url/jndi, not from the jar directly.
Any comment? Am I right?
BTW, my question about calling EJB from JSP means calling through URL,
not a local path.
Thank you
>-------------------------------------------------------------------->
Jim wrote in message <[email protected]>...
>Hi there,
> Can I call EJB from JSP? Is there a particular security setting or
>concern for Weblogic? Is there an coding example?
>
>Thank you
>
>
-
HowTo talk to a Session bean from an Applet sample app. problem
Hi!
When I push the "Call EJB" button in the sample application I get the following exception:
2005.02.20. 15:49:27 com.evermind.server.rmi.RMIClient createRemoteInvocationHandlerFactory
WARNING: com.evermind.server.ejb.EJBRemoteInvocationHandlerFactory
java.lang.ClassNotFoundException: com.evermind.server.ejb.EJBRemoteInvocationHandlerFactory
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.evermind.server.rmi.RMIClient.createRemoteInvocationHandlerFactory(RMIClient.java:427)
at com.evermind.server.rmi.RMIClient.initHandlerFactories(RMIClient.java:415)
at com.evermind.server.rmi.RMIClient.<init>(RMIClient.java:61)
at com.evermind.server.rmi.RMIClient.getInstance(RMIClient.java:464)
at com.evermind.server.rmi.RMIInitialContext.<clinit>(RMIInitialContext.java:48)
at oracle.j2ee.rmi.RMIInitialContextFactory.getInitialContext(RMIInitialContextFactory.java:58)
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.init(Unknown Source)
at javax.naming.InitialContext.<init>(Unknown Source)
at oracle.otnsamples.EJBCaller.getInitialContext(Unknown Source)
at oracle.otnsamples.EJBCaller.callEjb(Unknown Source)
at oracle.otnsamples.EJBCaller.access$000(Unknown Source)
at oracle.otnsamples.EJBCaller$2.actionPerformed(Unknown Source)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed.
at sun.applet.AppletClassLoader.getBytes(Unknown Source)
at sun.applet.AppletClassLoader.access$100(Unknown Source)
at sun.applet.AppletClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 43 more
javax.naming.NamingException: Lookup error: java.net.ConnectException: Connection refused: connect; nested exception is:
java.net.ConnectException: Connection refused: connect [Root exception is java.net.ConnectException: Connection refused: connect]
at com.evermind.server.rmi.RMIContext.lookup(RMIContext.java:183)
at javax.naming.InitialContext.lookup(Unknown Source)
at oracle.otnsamples.EJBCaller.callEjb(Unknown Source)
at oracle.otnsamples.EJBCaller.access$000(Unknown Source)
at oracle.otnsamples.EJBCaller$2.actionPerformed(Unknown Source)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at com.evermind.server.rmi.RMIClientConnection.connect(RMIClientConnection.java:394)
at com.evermind.server.rmi.RMIClientConnection.lookup(RMIClientConnection.java:80)
at com.evermind.server.rmi.RMIClient.lookup(RMIClient.java:250)
at com.evermind.server.rmi.RMIContext.lookup(RMIContext.java:154)
... 26 more
javax.naming.NamingException: Lookup error: java.net.ConnectException: Connection refused: connect; nested exception is:
java.net.ConnectException: Connection refused: connect [Root exception is java.net.ConnectException: Connection refused: connect]
at com.evermind.server.rmi.RMIContext.lookup(RMIContext.java:183)
at javax.naming.InitialContext.lookup(Unknown Source)
at oracle.otnsamples.EJBCaller.callEjb(Unknown Source)
at oracle.otnsamples.EJBCaller.access$000(Unknown Source)
at oracle.otnsamples.EJBCaller$2.actionPerformed(Unknown Source)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at com.evermind.server.rmi.RMIClientConnection.connect(RMIClientConnection.java:394)
at com.evermind.server.rmi.RMIClientConnection.lookup(RMIClientConnection.java:80)
at com.evermind.server.rmi.RMIClient.lookup(RMIClient.java:250)
at com.evermind.server.rmi.RMIContext.lookup(RMIContext.java:154)
... 26 more
Thanks!Refer to the following link for a list of tutorials that will guide you through the steps you have queried about: http://www.oracle.com/technology/tech/java/ejb30.html
Also, if you are attempting to call a session bean from your applet code you may run into firewall issues depending on your corporate infrastructure. RMI does not run over the ever popular port 80 and therefore is not always open on company firewalls. If you run into trouble you may have to use HTTP Tunneling. A better alternative maybe to call your session bean as a web service which is provided to you by default in the EJB 3.0 spec. -
Hi everyone,
I deployed my EJB component in an Oracle 8.1.7 database and I try to access it from a servlet.
If I run my servlet from JDeveloper 3.2 (Web-to-Go), it all works fine. If I run my servlet from JRun 3.01 or from Tomcat 3.2.1, I get the following exception:
javax.naming.NoInitialContextException: Need to specify class name in environmen
t or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Compiled Code)
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Compiled Code)
at javax.naming.NamingException.<init>(NamingException.java:104)
at javax.naming.NoInitialContextException.<init>(NoInitialContextException.java:58)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:649)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:242)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:279)
at javax.naming.InitialContext.lookup(InitialContext.java:349)
at com.cognicase.framework.base.U0003.AbstractORB.getBean(AbstractORB.java:285)
at com.cognicase.framework.base.U0003.AbstractORB.getBean(Compiled Code)
at com.cognicase.demo.U2007BL.U2007WP_Users.lookupBean(U2007WP_Users.java:60)
at com.cognicase.framework.is.U0103.AbstractBeanWrapper.beforeBeanCall(AbstractBeanWrapper.java:121)
at com.cognicase.demo.U2007BL.U2007WP_Users.valideUser(U2007WP_Users.java:77)
at com.cognicase.demo.U2000WB.U2000MW_WorkSpace.CallEjb(Compiled Code)
at com.cognicase.demo.U2000WB.U2000MW_WorkSpace.doValidateLogin(Compiled Code)
at com.cognicase.demo.U2000WB.U2000MW_WorkSpace.processService(U2000MW_WorkSpace.java:98)
at Demo_0100_01.service(Demo_0100_01.java:128)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
at org.apache.tomcat.core.Handler.service(Compiled Code)
at org.apache.tomcat.core.ServletWrapper.service(Compiled Code)
at org.apache.tomcat.core.ContextManager.internalService(Compiled Code)
at org.apache.tomcat.core.ContextManager.service(Compiled Code)
at org.apache.tomcat.service.connector.Ajp13ConnectionHandler.processConnection(Compiled Code)
at org.apache.tomcat.service.TcpWorkerThread.runIt(Compiled Code)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(Compiled Code)
at java.lang.Thread.run(Compiled Code)
If I add my servlet classes, aurora_client.jar, mts.jar, vbjapp.jar and vbjorb.jar files to the CLASSPATH, it works fine.
The behavior is the same in JRun and Tomcat.
I don't like this solution since I have to make the CLASSPATH point to my application classes at the web server level instead of at the application context level.
Has anyone been able to solve this problem?
Thanks for your help.
nullYes, I did. Actually, if I run my servlet in JDeveloper (Web-to-Go), it all works fine. I also extracted the code that calls the EJB from the servlet and I tested it in a small Java application, and it also works fine.
Things stop to work when I deploy my servlet in JRun or in Tomcat.
It appears that my code is correct, but the environment I try to run it is not, and I can't figure out what's wrong.
Can anyone help me?
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Sandeep Desai ([email protected]):
Have you provided the environmental settings in the servlet.
It should be :
import oracle.aurora.jndi.sess_iiop.ServiceCtx;
env.put(Context.URL_PKG_PREFIXES, "oracle.aurora.jndi");
env.put(Context.SECURITY_PRINCIPAL, username);
env.put(Context.SECURITY_CREDENTIALS, password);
env.put(Context.SECURITY_AUTHENTICATION, ServiceCtx.NON_SSL_LOGIN);
InitialContext ctx = new InitialContext(env);
Object obj = ctx.lookup("test/EJBHome");
HomeObject home = PortableRemoteObject.narrow(
obj,"HomeObject.class");
RemoteObject remote = home.create();
This should make it work!!
<HR></BLOCKQUOTE>
null -
Challenge: call local ejb from remote ejb on weblogic 9.2
Hi ALL,
How do I call to local ejb from remote ejb object. The jar file is deployed on weblogic server 9.2, if you want get it http://geocities.yahoo.com.br/lindembe/BEAProject.jar and the source code are http://geocities.yahoo.com.br/lindembe/BEAProject.zip. It is a sample app with two ejb that works so good on JBOSS, JOnAS, but BEA Weblogic.....
The complete problem you watch http://forum.java.sun.com/thread.jspa?threadID=768718&messageID=4387570#4387570
or
http://forums.bea.com/bea/message.jspa?messageID=600043148&tstart=0Your code in SigemFacadeBean should just do:
InitialContext ctx = new InitialContext();
when you lookup the local EJB. (This will work on all app servers. There's no need to put an app-server specific intial context factory in your code.)
Also, you can remove the jndi-name setting for the local ejb from your weblogic-ejb-jar.xml. jndi-name is only applied to remote ejbs.
-- Rob
WLS Blog http://dev2dev.bea.com/blog/rwoollen/
Maybe you are looking for
-
MacBook Pro now works with wireless encryption
I am offering my two cents. After spending a morning on the phone with TDS and part of the afternoon with apple yesterday, today I finally have my MacBook Pro talking wireless with an encryption key. My MBP would connect without an encryption key but
-
How to record full screen but display in lower resolution project
I'm preparing a training video which shows full screen movement but will be delivered in a smaller resolution project size. I can't seem to figure out how to do this in captivate. Does anyone have suggestions? Thanks!
-
Can i use sql server 2000 instead of oracle9i or aoracle 10g
presently i am working in oracle10g it work fine. for retiveing the data, know requirement is sql server 2000 so please guide can i do it if so how to configure, its very ergent for me,
-
Last night, I connected my iphone 4 to my computer for the first time in a VERY long time. I have not had any of the updates installed and was finally getting around to it. When I plugged it in, it autmotically started synching and "restoring" my p
-
hi can i use parameter query in command export (exp) to do query for more than one table ..? where my database is oracle database 10g if possible can you provide me any simple command for that? thanks for all