J2EE Client Application (weblogic.ClientDeployer)
Hello,
I'm experimenting with the ClientDeployer utility as described in the 6.1
documentation, and I face some odd behavior.
I created a jar file (cli.jar) containing the class files of my client application,
and a META-INF/application-client.xml file.
This jar file then gets stored in an ear file, together with a cli.runtime.xml
file
and a META-INF/application.xml file.
Afterwards, I tried running this client application by using
java weblogic.ClientDeployer clients.ear cli
Now, all of this works, as long as I leave the cli.runtime.xml file in the
current directory. But as soon as I remove this file from the current
directory, it stops working. This means that ClientDeployer doesn't read
the cli.runtime.xml file from the ear file, but only from the current directory.
Is that the way it is supposed to work ? I would expect it to read the
runtime file form the ear file ?
Thanks,
Francois Staes.
Hi Sandy,
If I understand you correctly, then you are asking how to make
a stand-alone java client, right? According to the J2EE spec, a
stand-alone java client also needs to be deployed to a container.
A long time ago (before OC4J, when there was only OrionServer)
I struggled for about a week before finally figuring out how to
do this.
However, I then discovered that, with OrionServer (and therefore
also with OC4J), your stand-alone java client does not have
to be deployed to a container and can be launched from the command
line with the "java" command.
If you do want to deploy your java client, then the only way
I know to launch it is by using the "applicationlauncher.jar"
file. This file was part of the first OC4J (version 1.0.2.2).
It disappeared in the next version (9.0.2) and now has reappeared
in the latest version (9.0.3) -- go figure! Like I said, by the
time I started using OC4J, I was only using non-deployed clients,
so I had no need for "applicationlauncher.jar", so the fact it
was missing from version 9.0.2 didn't affect me.
In any case, I recall information on how to use the "applicationlauncher.jar"
file on the following web sites:
http://www.orionserver.com
http://www.orionsupport.com
http://www.atlassian.com
http://www.elephantwalker.com
I also recall answering similar questions several times previously
on this forum, so a search of the forum archives may also help.
I hope I have correctly interpreted your question and given you
a helpful answer.
Good Luck,
Avi.
Similar Messages
-
Help:How can I run the J2EE Client Application? Thanks
Help:How can I run the J2EE Client Application that will access the remote J2EE1.4 application server which runs on another host computer?
I have developped a stateles senterprise java bean name converter and deloyed it in the j2ee1.4 application server on the host machine A. The converterbean provides the remote home interface and remote interface. At the same time I have developped the j2ee application client named convertappclient. When I access the conveter bean at host computer A through the script 'appclient.bat' as 'appclient -client convertappclient.jar', the client can access the bean sucessfully. Now I want to access the bean through the script 'appclient.bat' at host computer B,what files should I copy from host computer A to host computer B;and what the command line should be like? Thanks!
The following are the code of the enterprise java bean and it's home interface .
The client code is also provided.
The enterprise java bean:
package converter;
import java.rmi.RemoteException;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
import java.math.*;
public class ConverterBean implements SessionBean {
BigDecimal yenRate = new BigDecimal("121.6000");
BigDecimal euroRate = new BigDecimal("0.0077");
public ConverterBean() {
public BigDecimal dollarToYen(BigDecimal dollars) {
BigDecimal result = dollars.multiply(yenRate);
return result.setScale(2, BigDecimal.ROUND_UP);
public BigDecimal yenToEuro(BigDecimal yen) {
BigDecimal result = yen.multiply(euroRate);
return result.setScale(2, BigDecimal.ROUND_UP);
public void ejbCreate() {
public void ejbRemove() {
public void ejbActivate() {
public void ejbPassivate() {
public void setSessionContext(SessionContext sc) {
The bean's remote home interface :
package converter;
import java.rmi.RemoteException;
import javax.ejb.CreateException;
import javax.ejb.EJBHome;
public interface ConverterHome extends EJBHome {
Converter create() throws RemoteException, CreateException;
The bean's remote interface:
package converter;
import javax.ejb.EJBObject;
import java.rmi.RemoteException;
import java.math.*;
public interface Converter extends EJBObject {
public BigDecimal dollarToYen(BigDecimal dollars) throws RemoteException;
public BigDecimal yenToEuro(BigDecimal yen) throws RemoteException;
The j2ee application client:
import converter.Converter;
import converter.ConverterHome;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;
import java.math.BigDecimal;
public class ConverterClient {
public static void main(String[] args) {
try {
Context initial = new InitialContext();
System.setProperty("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
System.setProperty("java.naming.provider.url","jnp://10.144.97.250:3700");
Context myEnv = (Context) initial.lookup("java:comp/env");
Object objref = myEnv.lookup("ejb/SimpleConverter");
ConverterHome home =
(ConverterHome) PortableRemoteObject.narrow(objref,
ConverterHome.class);
Converter currencyConverter = home.create();
BigDecimal param = new BigDecimal("100.00");
BigDecimal amount = currencyConverter.dollarToYen(param);
System.out.println(amount);
amount = currencyConverter.yenToEuro(param);
System.out.println(amount);
System.exit(0);
} catch (Exception ex) {
System.err.println("Caught an unexpected exception!");
ex.printStackTrace();
}Surprisingly I find an upsurge in the number of posts with this same problem. I recently found a post which gave a nice link for this. Follow the steps and it should help:
http://docs.sun.com/source/819-0079/dgacc.html#wp1022105 -
Small weblogic.jar for jms/j2ee clients of weblogic
We are trying to create a smaller footprint for the ~38M weblogic.jar for distribution
to our client applications to use the JMS and J2EE features of Weblogic 7.0sp2.
I attempted to use the whitepaper document distributed by BEA for creating a smaller
jar file, but it did not work. Has anyone else in the user community successfully
created the jar file and if so could they give me some insight on how they did
it.
Thanks,
Ashish
Hi Ashish,
I've personally used the "URL" class loader option with success,
and I know that several customers have also used this option, as
well as the other options for years. Feel free to
post more detail than "it did not work", and I may be able
to help you out.
Tom, BEA
P.S. If 8.1 is an option, you may with to consider using the
thin client jars it supplies.
Ashish Bisarya wrote:
> We are trying to create a smaller footprint for the ~38M weblogic.jar for distribution
> to our client applications to use the JMS and J2EE features of Weblogic 7.0sp2.
> I attempted to use the whitepaper document distributed by BEA for creating a smaller
> jar file, but it did not work. Has anyone else in the user community successfully
> created the jar file and if so could they give me some insight on how they did
> it.
>
> Thanks,
> Ashish
-
Get URL for J2EE client application
Please forgive me if this question has an obvious answer, but I can't see it.
Once Web Start has downloaded and started my J2EE Swing application client, how can my client get the name of the host (or entire URL) from which the client was downloaded?
I would rather not have to hard code this into my client, so that the WAR file I deploy to the server is platform independent.
bobj5000Use the JNLP BasicSevice API getCodeBase() to get the URL of the server.
BasicService bs = (BasicService)ServiceManager.lookup("javax.jnlp.BasicService");
URL url = bs.getCodeBase();
Hope this helps
Jeff -
Intercept J2EE Client EJB2.x Invocations
Hi all,
I want to intercept EJB2.x invocations (*all requests and responses*) *only from
J2EE Client application side*(from WebSphere, Weblogic
vendors)
not from server side. My target is to record/save these invocations in XML.
Also i don't have any access to the source code of this existing J2EE Client application(have only binary distribution) so i cannot modify
anything in client application code.
I found this article with various possiblities
[http://www.elca.ch/site_repository/resources/InvokersNeedToBeAddedToJ2EE5_2.pdf]
1. CORBA PortableInterceptors but Weblogic has no support for PortableInterceptors.
2. Java's Dynamic Proxy Classes - maybe someone can elaborate it
3. AOP - which framework allows me to intercept ejb invocations only from client side without knowing the client internals
If anybody who has idea to solve this problem please help me.No response. Very strange!
-
Running a J2EE client on a Remote machine
How do you run a J2EE client application on a remote machine?
and what about running on remote client .
the things i know is , ok leave i am pasting a client which is on different machine (i.e not on the machine on which the server is ) copy
1. the client jar file which is return when u deploy the beans .
* Remember to add jar path in the class path
2. client class / java file on the remote client
and then run the client
for eg . client code
change Properties 's prop accoding to u
import javax.ejb.*;
import javax.naming.*;
import java.rmi.*;
import javax.rmi.PortableRemoteObject;
import java.util.*;
public class TestClient {
public static void main(String[] args) {
try {
System.out.println("IDFactory");
Properties prop = new Properties();
/* prop.put("org.omg.CORBA.ORBInitialHost","192.168.10.5");
prop.put("org.omg.CORBA.ORBInitialPort","1050");
prop.put(Context.PROVIDER_URL, "iiop://192.168.10.5:1050");
prop.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.cosnaming.CNCtxFactory");
InitialContext initial = new InitialContext(prop);
Object objref = initial.lookup("TimeReport/Data/TestHome");
TestHome home = (TestHome)PortableRemoteObject.narrow(objref,TestHome.class);
System.out.println("looking up IDFactory Session Bean");
Test TestRemote = home.create();
System.out.println("IDFactory Created ");
long roleID = TestRemote.getID("TR_ROLE","Role_ID");
System.out.println("RoleID is " + roleID);
TestRemote.remove();
} catch (Exception ex)
System.err.println("Caught an unexpected exception!" + ex.getMessage());
ex.printStackTrace();
if it works then let know on [email protected]
cheers
Deepak Sumani -
NameNotFoundException - ${j2ee.client} not bound
Good day, all. I'm new to J2EE, so apologies up front if this is a brain-dead
question. I have done some searching around on the site, and have found similar
issues, but none which contain a working solution for me, as far as I can tell.
I'm attempting to write a J2EE client application using JBoss. I have a main function
which is attempting to look up entries from the server's Global JNDI context, and isn't
finding them.
My main():
package nameredacted;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import nameredacted.log.AccountingLog;
import nameredacted.log.AccountingLogFactory;
public class JobMain {
private static final AccountingLog log = AccountingLogFactory.getAccountingLog(JobMain.class);
public static void main(String[] args)
try
Context ctx = new InitialContext();
// v--- Explosion occurs below: ---v
String lookupName = (String)ctx.lookup("java:comp/env/name_space_root");
Context globalCtx = (Context)ctx.lookup(lookupName); // I don't ever get here.
if (log.isInfoEnabled())
log.info(null,"Loaded Global Context");
System.out.println("Yay");
System.out.println(globalCtx);
catch (NamingException e2)
log.warn("There was an error looking up the name_space_root: " + e2);
e2.printStackTrace();
}My jndi.properties file:
#jboss JNDI properties
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.provider.url=jnp://localhost:1099
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
java.naming.factory.url.pkgs=org.jboss.naming.client
j2ee.clientName=PaymentQuartzMy application-client.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<application-client id="Application-client_ID" version="1.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application-client_1_4.xsd">
<display-name>PaymentQuartz</display-name>
<env-entry>
<env-entry-name>name_space_root</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>cell/persistent</env-entry-value>
</env-entry>
<ejb-ref id="EjbRef_1">
<ejb-ref-name>ejb/MyEjbHome</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>nameredacted.beans.MyEjbHome</home>
<remote>nameredacted.beans.MyEjb</remote>
</ejb-ref>
</application-client>My jboss-client.xml file:
<jboss-client>
<jndi-name>PaymentQuartz</jndi-name>
<ejb-ref>
<ejb-ref-name>ejb/MyEjbHome</ejb-ref-name>
<jndi-name>ejb/nameredacted/beans/MyEjbHome</jndi-name>
</ejb-ref>
</jboss-client>And finally, an excerpt from the error text:
[java] [2007-05-21 14:27:16,342] WARN quartz.main.JobMain - There was an error looking up the name_space_root: javax.naming.NameNotFoundException: PaymentQuartz not bound
[java] javax.naming.NameNotFoundException: PaymentQuartz not bound
[java] at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
[java] at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
[java] at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
[java] at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
[java] at sun.reflect.GeneratedMethodAccessor13.invoke(Unknown Source)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:585)
[java] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
[java] at sun.rmi.transport.Transport$1.run(Transport.java:153)
[java] at java.security.AccessController.doPrivileged(Native Method)
[java] at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
[java] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
[java] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
[java] at java.lang.Thread.run(Thread.java:595)
[java] at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
[java] at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
[java] at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
[java] at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
[java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
[java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
[java] at javax.naming.InitialContext.lookup(InitialContext.java:351)
[java] at org.jboss.naming.client.java.javaURLContextFactory$EncContextProxy.invoke(javaURLContextFactory.java:129)
[java] at $Proxy0.lookup(Unknown Source)
[java] at javax.naming.InitialContext.lookup(InitialContext.java:351)
[java] at nameredacted.JobMain.main(JobMain.java:26)
BUILD SUCCESSFULThanks in advance for your help: I think my monitor is beginning to bruise from repeated
head impacts...
Er, something.
kev
Message was edited by:
kevjava [added application-client.xml]I'm not familiar with the specifics of how the JBoss implementation requires that Application Client
components be executed so I'd recommend checking their documentation. There is often a
special command needed to run an Application Client within an Application Client container. It's
typically more than just configuring the client to bootstrap a particular naming provider.
For example, in the Java EE SDK, we have a special command called "appclient" that is used to
start an Applicaiton Client component. The Application Client container bootstraps the
correct naming provider, sets up the private component naming environment (java:comp/env),
handles any authentication, etc. You can find more information on the difference between
an Application Client and a "stand-alone java client" in our EJB FAQ :
https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html
--ken -
Steps to deploy an ejb application and running an ejb client in weblogic server6.1
steps to deploy an ejb application and steps to run an ejb client in weblogic server6.1
if the client is an simple java application and if the client is a servletHi.
Check out the beanManaged example that ships with WLS and read the accompanying docs. This
is a simple EJB with a servlet that invokes it.
Michael
shekhar sachdev wrote:
steps to deploy an ejb application and steps to run an ejb client in weblogic server6.1
if the client is an simple java application and if the client is a servlet--
Michael Young
Developer Relations Engineer
BEA Support -
Jar for weblogic client applications?
I am developing a client applications that accesses some session beans from
WLS 6.1 SP1.
I am currently putting the weblogic.jar file in the classpath in order to
be able to access the WLS JNDI server using T3/T3S.
This weblogic.jar file is very large (about 25MB) and includes many things
I am not using.
Is there a way to make a client applications that accesses EJBs in a
weblogic server without using that large file?
Regards,
VegetaPlease don't cross post. see my reply in weblogic.developer.interest.ejb.
thanks,
Michael
Vegeta wrote:
I am developing a client applications that accesses some session beans from
WLS 6.1 SP1.
I am currently putting the weblogic.jar file in the classpath in order to
be able to access the WLS JNDI server using T3/T3S.
This weblogic.jar file is very large (about 25MB) and includes many things
I am not using.
Is there a way to make a client applications that accesses EJBs in a
weblogic server without using that large file?
Regards,
Vegeta--
Michael Young
Developer Relations Engineer
BEA Support -
How to run a Java EE client application ?
Greetings,
I have a Java EE Application Project created with Eclipse (OEPE) and I don't know how to run it ? I asked the question on the OEPE forum but didn't manage to have any pertinent answer. I have also looked at Developing Java EE Application Clients (Thin Clients) in the Programming Stand-alone Clients book and tried to use commands as weblogic.clientDeployer and weblogic.j2eeclient.Main but haven't been able to get them working. And anyway, they are not done to be used in Eclipse as I didn't find any ant tasks for them.
Many thanks in advance for any help.
NicolasI have an ear with the following content:
0 Thu Apr 23 12:20:52 CEST 2009 APP-INF/
0 Thu Apr 23 12:20:52 CEST 2009 APP-INF/classes/
0 Thu Apr 23 12:20:52 CEST 2009 APP-INF/lib/
6843 Thu Apr 23 12:20:52 CEST 2009 APP-INF/lib/ww204-jpa.jar
0 Thu Apr 23 12:20:52 CEST 2009 META-INF/
542 Thu Apr 23 12:19:44 CEST 2009 META-INF/application.xml
25 Thu Apr 23 12:20:52 CEST 2009 META-INF/MANIFEST.MF
659 Mon Apr 20 18:37:56 CEST 2009 META-INF/weblogic-application.xml
1220 Thu Apr 23 12:20:52 CEST 2009 ww204-client.jar
4040 Thu Apr 23 12:20:52 CEST 2009 ww204-ejb.jar
I'm running the following command:
java -classpath C:\bea\wlserver_10.3\server\lib\weblogic.jar weblogic.ClientDeployer ww204.ear ww204-client
This creates the jar with the following content:
764 Thu Apr 23 12:04:42 CEST 2009 Main.class
0 Thu Apr 23 12:20:52 CEST 2009 META-INF/
351 Thu Apr 23 12:10:08 CEST 2009 META-INF/application-client.xml
43 Thu Apr 23 12:02:26 CEST 2009 META-INF/MANIFEST.MF
And of course, when I try to run the client using the command:
C:\Users\nicolas>java -classpath C:\bea\wlserver_10.3\server\lib\weblogic.jar weblogic.j2eeclient.Main ww204-client t3://localhost:7001
it raises the following exception:
java.lang.Exception: Stack trace
at java.lang.Thread.dumpStack(Thread.java:1206)
at weblogic.j2eeclient.Main.run(Main.java:194)
at weblogic.j2eeclient.Main.main(Main.java:926)
java.lang.Exception: Stack trace
at java.lang.Thread.dumpStack(Thread.java:1206)
at weblogic.j2eeclient.Main.run(Main.java:196)
at weblogic.j2eeclient.Main.main(Main.java:926)
Exception in thread "Main Thread" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at weblogic.j2eeclient.Main.run(Main.java:201)
at weblogic.j2eeclient.Main.main(Main.java:926)
Caused by: java.lang.NoClassDefFoundError: fr/simplex_software/slsb/FacadeRemote
at Main.main(Main.java:10)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at weblogic.j2eeclient.Main.run(Main.java:201)
at weblogic.j2eeclient.Main.main(Main.java:928)
The ww204-client.jar was created as an OEPE J2EE Application Project and it was extracted with weblogic.ClientDeployer from the ear exported by OEPE. But it doesn't contain the required classes. -
Urgent: How to execute a Client application
Hi All,
I have deployed a very simple ear file ( consisting of 1 session bean ) called
HelloEjbsApp.ear in Weblogic 6.1. I want to access the method in this ejb from
a client application. Please can anybody tell me the steps to do the same? I have
referred to the documentation, but it isn't too clear.
I have a HelloClient.java class inside a jar file called HelloClientJAR.jar,
which is inside the client application called HelloClientApp.ear. As I understand,
I should have the following 3 files for the same.
application.xml
application-client.xml
HelloClientJAR.runtime.xml ( This exists in the same directory as the HelloClientApp.ear
I then ran the following command
java appclient.ClientDeployer HelloClientApp.ear HelloClientJAR
It deployed properly, without any errors.
After this, how do I exceute the HelloClient class? Please if anybody knows the
solution to my problem, help me.
Thanks,
VaniUnless it's a J2EE "application client" which is packaged in the ear.
Unfortunately 6.1 still doesn't support that standard.
"Vani" <[email protected]> wrote in message
news:[email protected]...
>
Thank you very much. It works now. As you said, I should use only the JNDIname
to do lookup outside an ejb.
Thanks,
Vani
"Cameron Purdy" <[email protected]> wrote:
That means that you can only look up java:comp/env/* from inside (for
example) an EJB. You cannot do that from a Java client. From a Java
client,
you look up the EJB using its "global" JNDI name. Use the WL console
to
peruse your JNDI tree.
Peace,
Cameron Purdy
Tangosol Inc.
Tangosol Coherence: Clustered Coherent Cache for J2EE
Information at http://www.tangosol.com/
"Vani" <[email protected]> wrote in message
news:[email protected]...
Hi All,
I am able to execute the client application. But when I do that,I get
the following
exception.
javax.naming.NamingException: java:comp/env namespace is only availablefrom within
a J2EE component
at
com.sun.enterprise.naming.java.javaURLContext.getComponentContext(javaURLCon
text.java:392)
at
com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:51)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at HelloClient.main(Unknown Source)
Please if anybody knows the reason for this, help me.
Thanks,
Vani
"Vani" <[email protected]> wrote:
Hi All,
I have deployed a very simple ear file ( consisting of 1 session
bean
) called
HelloEjbsApp.ear in Weblogic 6.1. I want to access the method in this
ejb from
a client application. Please can anybody tell me the steps to do the
same? I have
referred to the documentation, but it isn't too clear.
I have a HelloClient.java class inside a jar file calledHelloClientJAR.jar,
which is inside the client application called HelloClientApp.ear.As
I understand,
I should have the following 3 files for the same.
application.xml
application-client.xml
HelloClientJAR.runtime.xml ( This exists in the same directory asthe
HelloClientApp.ear
I then ran the following command
java appclient.ClientDeployer HelloClientApp.ear HelloClientJAR
It deployed properly, without any errors.
After this, how do I exceute the HelloClient class? Please if anybody
knows the
solution to my problem, help me.
Thanks,
Vani -
Creating And Deploying A JWSDP Web Service Client to Weblogic 8.1
This setup produces an EAR containing a message driven bean in a jar file. When the MDB receives a message
it checks to see if there is any data in a database table and if so calls the web service with that data. These instructions
are for MS-Windows environments.
In my setup I have:
the weblogic domain at c:\b2b80
the jwsdp at c:\apps\jwsdp-1.3
extra jar files for the app server in c:\b2b80\lib
the main weblogic installation at c:\apps\weblogic810\
1> Download the the JWSDP version you wish to use and install it. (In this example I'm using 1.3)
2> Create a project structure for you client like this:
/project
/earbuild
/META-INF
/ejbbuild
/META-INF
/ejbsource
/wssource
3> in the /project directory you will need a build.xml file that looks something like this: (the ant build targets are described at the end of this document)
==============================================================
<?xml version="1.0"?>
<project name="svcowner" default="buildall" basedir=".">
<property file="classpath.settings"/>
<property name="wssource" value="wssource"/>
<property name="ejbsource" value="ejbsource"/>
<property name="compileejbdest" value="ejbbuild"/>
<property name="earbuilddest" value="earbuild"/>
<property name="jarfilename" value="svcownerejb.jar"/>
<property name="earfilename" value="svcowner.ear"/>
<property name="debug" value="true"/>
<property name="deprecation" value="true"/>
<!-- this runs the create.bat which has all of the wscompile parameters -->
<target name="cmdline_wscompile">
<exec executable="wssource/create.bat"/>
</target>
<target name="compileejb" depends="cmdline_wscompile">
<javac debug="${debug}" srcdir="${wssource}" classpath="${BUILD_CLASSPATH}"
destdir="${compileejbdest}" includes="**/*.java" deprecation="${deprecation}"/>
<javac debug="${debug}" srcdir="${ejbsource}" classpath="${BUILD_CLASSPATH}"
destdir="${compileejbdest}" includes="**/*.java" deprecation="${deprecation}"/>
</target>
<target name="buildejbjar" depends="compileejb">
<jar jarfile="${earbuilddest}/${jarfilename}" manifest="${compileejbdest}/META-INF/MANIFEST.txt">
<fileset dir="${compileejbdest}">
<include name="**/*.*"/>
</fileset>
</jar>
</target>
<target name="buildear" depends="buildejbjar">
<jar jarfile="${earfilename}">
<fileset dir="${earbuilddest}">
<include name="**/*.*"/>
</fileset>
</jar>
</target>
<target name="deploy">
<copy file="${earfilename}" todir="../../config/domain/applications"/>
</target>
<target name="buildall" description="build everything" depends="buildear, deploy">
</target>
</project>
==============================================================
4> You need a matching classpath.settings file in the same directory, something like this:
==============================================================
BUILD_CLASSPATH=/b2b80/lib/saaj-impl.jar;/b2b80/lib/saaj-api.jar;/b2b80/lib/jaxrpc-api.jar;/b2b80/lib/jaxrpc-impl.jar;c:/b2b80/lib/jaxrpc-spi.jar/b2b80/classes/;/b2b80/classes;/apps/weblogic810/server/lib/weblogic.jar;/apps/weblogic810/server/lib/weblogic_sp.jar;/apps/weblogic810/server/lib/xmlx.jar;/apps/weblogic810/server/ext/weblogic-tags.jar;/apps/weblogic810/server/ext/jdbc/oracle/920/ojdbc14_g.jar;/b2b80/lib/log4j.jar
==============================================================
5> In the /project/earbuild/META-INF directory you need an application.xml file:
==============================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE application PUBLIC '-//Sun Microsystems, Inc.//DTD J2EE Application 1.2//EN' 'http://java.sun.com/j2ee/dtds/application_1_2.dtd'>
<application>
<display-name>svcownerb2b</display-name>
<description>Application description</description>
<module>
<ejb>svcownerejb.jar</ejb>
</module>
</application>
==============================================================
6> The /project/ejbsource directory contains the source for the client application. In my case this is a message driven bean (note that code below isn't complete). The most important part of the code below is the setting of the javax.xml.soap.MessageFactory system property.
System.getProperties().put("javax.xml.soap.MessageFactory","com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl");
If you don't do this a weblogic class will be used and the code will fail.
==============================================================
package com.svcclient.ejb.svcownershipment;
import java.text.*;
import java.io.*;
import java.sql.*;
import java.util.Properties;
import javax.ejb.*;
import javax.jms.*;
import javax.naming.*;
import javax.sql.DataSource;
import com.svcclient.util.*;
import org.w3c.dom.*;
import com.svcclient.websvc.svcowner.*;
import javax.xml.rpc.Stub;
public class SvcOwnerShipmentSubscriberMDB implements MessageDrivenBean, MessageListener
private transient MessageDrivenContext mdc = null;
private static Context context;
private final static String CLASSNAME = "SvcOwnerShipmentSubscriberMDB";
private String DATASOURCE_JNDI = "svcclient.b2b";
private static DataSource mDS = null;
private SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
public SvcOwnerShipmentSubscriberMDB()
System.getProperties().put("javax.xml.soap.MessageFactory","com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl");
try
if (context == null)
context = new InitialContext() ;
if (mDS == null)
mDS = (DataSource)context.lookup(DATASOURCE_JNDI);
catch (NamingException ex)
ex.printStackTrace();
catch(Exception ex)
ex.printStackTrace();
public void onMessage(javax.jms.Message message)
TextMessage msg = null;
String ordernumber = null;
String lineid = null;
try
if (message instanceof TextMessage)
msg = (TextMessage) message;
ordernumber = msg.getStringProperty("ordernumber");
// the JMS message contains a property that is an order number
createAndSendXML(ordernumber);
catch (Throwable ex)
ex.printStackTrace();
private void createAndSendXML(String ordernumber)
if(ordernumber==null)
return;
PreparedStatement statement = null;
ResultSet rset = null;
java.sql.Connection conn = null;
try
conn = DBHelper.getConnection(mDS,"SvcOwnerShipmentSubscriberMDB.createAndSendXML");
statement = conn.prepareStatement("select * from ..."); // you SQL here
statement.setString(1,ordernumber);
rset = statement.executeQuery();
StringBuffer data = new StringBuffer();
data.append("<? version=\"1.0\"?>\n");
data.append("<shippingRequest>\n");
while(rset.next())
data.append("\t<order_date>"+dateFormat.format(new java.util.Date(rset.getTimestamp("SCHEDULE_SHIP_DATE").getDate()))+"</order_date>\n");
data.append("\t<brand_name>svcclient</brand_name>\n");
data.append("\t<shipRequestType>Sale</shipRequestType>\n");
data.append("</shippingRequest>\n");
// call the web service with the data from the database
DataExchanger_Impl impl = new DataExchanger_Impl();
Stub stub = (Stub)(impl.getDataExchangerSoap());
DataExchangerSoap dx = (DataExchangerSoap)stub;
String resp = dx.exchangeData("svcclient", "mypassword", "Sales", data.toString());
catch(SQLException sqle)
sqle.printStackTrace();
catch(Exception e)
e.printStackTrace();
finally
try
if (rset != null)
rset.close();
if (statement != null)
statement.close();
if (conn != null)
conn.close();
catch(Exception x){}
public void ejbCreate() { System.out.println("In SvcOwnerShipmentSubscriberMDB.ejbCreate()"); }
public void setMessageDrivenContext(MessageDrivenContext mdc) { this.mdc = mdc; }
public void ejbRemove() throws javax.ejb.EJBException { System.out.println("In SvcOwnerShipmentSubscriberMDB.remove()"); }
==============================================================
7> The /project/ejbbuild/META-INF directory needs a MANIFEST.txt file.
Manifest-Version: 1.0
8> The /project/ejbbuild/META-INF directory needs a ejb-jar.xml file. This just sets up the MDB which is the client.
==============================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
<ejb-jar>
<display-name>SvcOwnerShipmentSubscriberMDB</display-name>
<enterprise-beans>
<message-driven>
<display-name>SvcOwnerShipmentSubscriberMDB</display-name>
<ejb-name>SvcOwnerShipmentSubscriberMDB</ejb-name>
<ejb-class>com.svcclient.ejb.svcownershipment.SvcOwnerShipmentSubscriberMDB</ejb-class>
<transaction-type>Container</transaction-type>
<message-driven-destination>
<destination-type>javax.jms.Topic</destination-type>
<subscription-durability>NonDurable</subscription-durability>
</message-driven-destination>
</message-driven>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>SvcOwnerShipmentSubscriberMDB</ejb-name>
<method-name>onMessage</method-name>
<method-params>
<method-param>javax.jms.Message</method-param>
</method-params>
</method>
<trans-attribute>NotSupported</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
==============================================================
9> The /project/ejbbuild/META-INF directory needs a weblogic-ejb-jar.xml file.
==============================================================
<?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>SvcOwnerShipmentSubscriberMDB</ejb-name>
<message-driven-descriptor>
<pool>
<max-beans-in-free-pool>5</max-beans-in-free-pool>
<initial-beans-in-free-pool>1</initial-beans-in-free-pool>
</pool>
<!-- JNDI Name of the Topic that the SvcOwnerShipmentSubscriberMDB listens for messages on -->
<destination-jndi-name>jms.svcownerShipmentsTopic</destination-jndi-name>
</message-driven-descriptor>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>
==============================================================
10> The /project/wssource directory needs a dataexchange.wsdl file. This is the WSDL describing the web service
we want to connect to with our client.
==============================================================
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:tns="https://www.svcowner.com/mfg/DataExchange/"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
targetNamespace="https://www.svcowner.com/mfg/DataExchange/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
name="">
<wsdl:types>
<s:schema elementFormDefault="qualified"
targetNamespace="https://www.svcowner.com/mfg/DataExchange/">
<s:element name="exchangeData">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="sender" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="password" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="transactionType" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="data" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="exchangeDataResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="exchangeDataResult" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</wsdl:types>
<wsdl:message name="exchangeDataSoapIn">
<wsdl:part name="parameters" element="tns:exchangeData" />
</wsdl:message>
<wsdl:message name="exchangeDataSoapOut">
<wsdl:part name="parameters" element="tns:exchangeDataResponse" />
</wsdl:message>
<wsdl:portType name="DataExchangerSoap">
<wsdl:operation name="exchangeData">
<wsdl:input message="tns:exchangeDataSoapIn" />
<wsdl:output message="tns:exchangeDataSoapOut" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="DataExchangerSoap" type="tns:DataExchangerSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="exchangeData">
<soap:operation soapAction="https://www.svcowner.com/mfg/DataExchange/exchangeData"
style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="DataExchanger">
<wsdl:port name="DataExchangerSoap" binding="tns:DataExchangerSoap">
<soap:address location="https://svc.svcowner.com/mfg/dataexchange.php" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
==============================================================
10> The /project/wssource directory needs a websvc_config.xml file. This file tells wscompile where
to find the WSDL file and the package name for the generated classes.
==============================================================
<?xml version="1.0" encoding="UTF-8"?>
<configuration xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/config">
<wsdl location="wssource/dataexchange.wsdl" packageName="com.svcclient.websvc.svcowner"/>
</configuration>
==============================================================
11> The /project/wssource directory needs a create.bat file. This just sets up the environment
and calls the wscompile batch file in the JWSDP. I had to tweak the wscompile.bat file to match
my environment as well.
==============================================================
SETLOCAL
SET WSDP=C:\apps\jwsdp-1.3\
SET ANT_HOME=%WSDP%;apache-ant
SET PATH=%ANT_HOME%\bin;%WSDP%jaxrpc\bin;%PATH%
SET JAVA_HOME=c:\apps\weblogic810\jrockit81sp2_141_05
call wscompile -gen:client -s ./wssource -keep -g -d ejbbuild wssource/websvc_config.xml
==============================================================
12> The /project directory needs a build.bat file. Just a way for me to make sure my
environment is set up right before doing the build.
==============================================================
SETLOCAL
SET ANT_HOME=c:\apps\jakarta-ant-1.4.1
SET PATH=%ANT_HOME%\bin;%PATH%
SET JAVA_HOME=c:\apps\weblogic810\jrockit81sp2_141_05
call ant -buildfile build.xml %1 %2 %3 %4 %5 %6 %7 %8 %9
==============================================================
13> You need to copy the following jar files from the JWSDP into a location they can be used by the
app server during run time and also for the build process. In my set up this is c:\b2b80\lib. Note that
these are pointed to by the file in step 4.
c:\apps\jwsdp-1.3\jaxrpc\lib\jaxrpc-api.jar
c:\apps\jwsdp-1.3\jaxrpc\lib\jaxrpc-impl.jar
c:\apps\jwsdp-1.3\jaxrpc\lib\jaxrpc-spi.jar
c:\apps\jwsdp-1.3\saaj\lib\saaj-api.jar
c:\apps\jwsdp-1.3\saaj\lib\saaj-impl.jar
14> You must make sure that the jar file in step 13 are at the front of the classpath for the
weblogic server. WL comes with classes that conflict with these jars.
15> I also had to add the root ssl certificate from the partners certificate authority to the java keystore
using the keytool because this service uses SSL:
C:\apps\weblogic810\jrockit81sp2_141_05\jre\bin>keytool -import -keystore ..\lib\security\cacerts -alias svcownerroot -keypass password -file c:\temp\svcownerroot.cer
==============================================================
So the idea is this, you run the /project/build.bat file from within the /project directory. This
calls ant which uses the build.xml file to create everything and copy the EAR to the weblogic deployment
directory. The default ant target is buildall.
The cmdline_wscompile target runs the /project/wssource/create.bat file which in turn runs the wscompile.bat
file from the jwsdp. This causes the dataexchange.wsdl file to processed and the client files to be generated.
The generated java files go into the /project/wssource directory. The generated class files go into the
/project/ejbbuild directory. They need to be there so the MDB can use them.
Next the compileejb ant target compiles the MDB java file and places the resulting class file into the
/project/ejbbuild directory.
Next the buildejbjar ant target takes everything in the /project/ejbbuild directory and creates the ejb jar
file that will be included in the EAR. This file is placed in the /project/earbuild directory.
Finally the buildear ant target takes everything in the /project/ejbbuild directory and produces the EAR
file for deployment. The EAR file is placed in the /project directory.
The deploy task simply copies the EAR file into the weblogic domain applications directory.It's really the web service that determines what kind of authentication is required. You can't just use any old strategy. If the web service isn't expecting it in that form, it won't work. Typically, either HTTP BASIC Auth or WS-Security is used. You'd have to contact the people responsible for the web service to know what kind of auth it requires.
-
I've read the not-so-good dox about running a J2EE client in WL6:
- make a jar packaged with the standard META-INF/application-client.xml
- put an xml called <jarname>.runtime.xml in the dir with the client jar
(for WL6 specific jndi mappings)
- run the jar with weblogic.j2eeclient.Main [jar] urlthis is cumbersome in development. my J2EE client is mostly made of junit
testcases that call entities and session beans. There are dozens of "Main"
classes in the jar, that I might want to run individually!
I would like to run the testcases directly using the compiled classes
directory - but then the jndi mappings between the standard, logical names
like "java:comp/env/ejb/mySessionHome" and the WL-specific names like
"ejb.myapp.mySessionHome" fail.
actually, if I run the client using in code the actual WL6 jndi names, no
deployment info is necessary, but I want to use in code only the logical
names.
so, my question is : how do I run an unpackaged client that picks up the
jndi mappings specified in the .runtime.xml ??
Edo
PS - I basically want to replicate on the client-side the way I work on the
server-side : I use WL6 dynamic deployment of an unpackaged ear : no
explicit calls to jar and ejbc - which helps my code-complie-test cycle a
lot !Hi Sandy,
If I understand you correctly, then you are asking how to make
a stand-alone java client, right? According to the J2EE spec, a
stand-alone java client also needs to be deployed to a container.
A long time ago (before OC4J, when there was only OrionServer)
I struggled for about a week before finally figuring out how to
do this.
However, I then discovered that, with OrionServer (and therefore
also with OC4J), your stand-alone java client does not have
to be deployed to a container and can be launched from the command
line with the "java" command.
If you do want to deploy your java client, then the only way
I know to launch it is by using the "applicationlauncher.jar"
file. This file was part of the first OC4J (version 1.0.2.2).
It disappeared in the next version (9.0.2) and now has reappeared
in the latest version (9.0.3) -- go figure! Like I said, by the
time I started using OC4J, I was only using non-deployed clients,
so I had no need for "applicationlauncher.jar", so the fact it
was missing from version 9.0.2 didn't affect me.
In any case, I recall information on how to use the "applicationlauncher.jar"
file on the following web sites:
http://www.orionserver.com
http://www.orionsupport.com
http://www.atlassian.com
http://www.elephantwalker.com
I also recall answering similar questions several times previously
on this forum, so a search of the forum archives may also help.
I hope I have correctly interpreted your question and given you
a helpful answer.
Good Luck,
Avi. -
JNDI lookup fails for client applications
I am currently porting our j2ee application to weblogic 7.0. The application already
runs successfully on Orion and Jboss. I have got everything working now except
for our client applications, which all fail with a JNDI lookup error. The exception
is:
javax.naming.NameNotFoundException: Unable to resolve 'java:comp.env/ejb/QualiferInstance'
Resolved: '' Unresolved:'java:comp' ; remaining name 'java:comp.env
/ejb/QualifierInstance'
at weblogic.rmi.internal.BasicOutboundRequest.sendReceive(BasicOutbound
equest.java:109)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemote
ef.java:262)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemote
ef.java:229)
at weblogic.jndi.internal.ServerNamingNode_WLStub.lookup(Unknown Source
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:338)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:333)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at BatchIndexer.main(BatchIndexer.java:89)
I have looked up numerous postings on various mailing lists describing similar
problems, but none of them give an explanation which helps me.
I am convinced that I have the ejb deployment descriptors correct because all
our JSPs, servlets and session beans successfully lookup and use the EJBs.
I am also convinced that I have the correct code for the JNDI lookup in our client
applications, because they work perfectly well on Orion and Jboss and use syntax
which is described as correct in the jsee specification, i.e. "java:comp/env/..."
Here is the descriptor from weblogic-ejb-jar.xml for the EJB mentioned in the
example exception above:
<weblogic-enterprise-bean>
<ejb-name>QualifierInstance</ejb-name>
<jndi-name>comp/env/ejb/QualifierInstance</jndi-name>
</weblogic-enterprise-bean>
And here is the descriptor in the application-client.xml file:
<ejb-ref>
<ejb-ref-name>ejb/QualifierInstance</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type> <home>com.espritsoutron.xengine.ejb.metamodel.QualifierInstanceHome</home>
<remote>com.espritsoutron.xengine.ejb.metamodel.QualifierInstance</remote>
<ejb-link>QualifierInstance</ejb-link>
</ejb-ref>
And here is the code in the client application that attempts to perform the lookup:
qiHome = (QualifierInstanceHome)PortableRemoteObject.narrow(context.lookup("java:comp/env/ejb/QualifierInstance"),
QualifierInstanceHome.class);
The annoying thing is that I know I can make this work if I change the code to
omit the "java:" prefix, but I don't want to do this because then it would no
longer work on either Orion and Jboss.
P.S. I have also tried changing the jndi-name in the weblogic-ejb-jar descriptor
to "ejb/QualifierInstance" and just "QualifierInstance", but neither of these
make any difference. I even tried chaning it to "java:comp/env/ejb/QualifierInstance"
but that totally breaks the server.
Can anyone can please help with this?you can find the JNDI name in the JNDI tree from the admin console
right click on your server and choose "view jndi tree".
if you bind your ejb to ejb/QualifierInstance
you look it up with that exact same name ejb/QualifierInstance
Julian Fawcett wrote:
I am currently porting our j2ee application to weblogic 7.0. The application already
runs successfully on Orion and Jboss. I have got everything working now except
for our client applications, which all fail with a JNDI lookup error. The exception
is:
javax.naming.NameNotFoundException: Unable to resolve 'java:comp.env/ejb/QualiferInstance'
Resolved: '' Unresolved:'java:comp' ; remaining name 'java:comp.env
/ejb/QualifierInstance'
at weblogic.rmi.internal.BasicOutboundRequest.sendReceive(BasicOutbound
equest.java:109)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemote
ef.java:262)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemote
ef.java:229)
at weblogic.jndi.internal.ServerNamingNode_WLStub.lookup(Unknown Source
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:338)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:333)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at BatchIndexer.main(BatchIndexer.java:89)
I have looked up numerous postings on various mailing lists describing similar
problems, but none of them give an explanation which helps me.
I am convinced that I have the ejb deployment descriptors correct because all
our JSPs, servlets and session beans successfully lookup and use the EJBs.
I am also convinced that I have the correct code for the JNDI lookup in our client
applications, because they work perfectly well on Orion and Jboss and use syntax
which is described as correct in the jsee specification, i.e. "java:comp/env/..."
Here is the descriptor from weblogic-ejb-jar.xml for the EJB mentioned in the
example exception above:
<weblogic-enterprise-bean>
<ejb-name>QualifierInstance</ejb-name>
<jndi-name>comp/env/ejb/QualifierInstance</jndi-name>
</weblogic-enterprise-bean>
And here is the descriptor in the application-client.xml file:
<ejb-ref>
<ejb-ref-name>ejb/QualifierInstance</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type> <home>com.espritsoutron.xengine.ejb.metamodel.QualifierInstanceHome</home>
<remote>com.espritsoutron.xengine.ejb.metamodel.QualifierInstance</remote>
<ejb-link>QualifierInstance</ejb-link>
</ejb-ref>
And here is the code in the client application that attempts to perform the lookup:
qiHome = (QualifierInstanceHome)PortableRemoteObject.narrow(context.lookup("java:comp/env/ejb/QualifierInstance"),
QualifierInstanceHome.class);
The annoying thing is that I know I can make this work if I change the code to
omit the "java:" prefix, but I don't want to do this because then it would no
longer work on either Orion and Jboss.
P.S. I have also tried changing the jndi-name in the weblogic-ejb-jar descriptor
to "ejb/QualifierInstance" and just "QualifierInstance", but neither of these
make any difference. I even tried chaning it to "java:comp/env/ejb/QualifierInstance"
but that totally breaks the server.
Can anyone can please help with this? -
Error while invoking a Dataservice from client application
Hi,<br><br>
Code snippet of Client to invoke DataService is....<br><br>
Hashtable h = new Hashtable();<br>
h.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");<br>
h.put(Context.PROVIDER_URL,"t3://10.1.5.31:7001");<br>
h.put(Context.SECURITY_PRINCIPAL,"weblogic");<br>
h.put(Context.SECURITY_CREDENTIALS,"weblogic"); <br>
Context context = new InitialContext(h);<br>
DataService ds =DataServiceFactory.newDataService(context, "HLCApp","ld:HLCAppDataServices/com/pfizer/hlc/dataservices/HCP_DETAILS"); <br>
<u>DataObject obj= (DataObject) ds.invoke("HCP_DETAILS", null);</u><br>
System.out.println(" HCP details : \n" + obj);
<br><br><br>
The line(which is underlind) is causing the error(I checked by putting some System.outs).
<br>
While invoking a DataService from the Client application(Java Client) I am getting the following error in the console.
<br><br>
Exception in thread "main" com.bea.ld.dsmediator.client.exception.SDOMediatorExc
eption: com.bea.ld.dsmediator.client.exception.SDOMediatorException: weblogic.rj
vm.PeerGoneException: ; nested exception is:
java.io.EOFException
at com.bea.ld.dsmediator.client.XmlDataServiceBase.invoke(XmlDataService
Base.java:114)
at com.pfizer.hlc.DSClient.HCP.main(HCP.java:23)
Caused by: com.bea.ld.dsmediator.client.exception.SDOMediatorException: weblogic
.rjvm.PeerGoneException: ; nested exception is:
java.io.EOFException
at com.bea.ld.dsmediator.client.XmlDataServiceBase.invokeQuery(XmlDataSe
rviceBase.java:183)
at com.bea.ld.dsmediator.client.XmlDataServiceBase.invoke(XmlDataService
Base.java:102)
... 1 more
Caused by: weblogic.rjvm.PeerGoneException: ; nested exception is:
java.io.EOFException
at weblogic.rjvm.BasicOutboundRequest.sendReceive(BasicOutboundRequest.j
ava:108)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteR
ef.java:290)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteR
ef.java:248)
at com.bea.ld.Server_ydm4ie_EOImpl_816_WLStub.executeFunction(Unknown So
urce)
at com.bea.ld.dsmediator.client.XmlDataServiceBase.invokeQuery(XmlDataSe
rviceBase.java:157)
... 2 more
Caused by: java.io.EOFException
at weblogic.rjvm.t3.T3JVMConnection.endOfStream(T3JVMConnection.java:897
at weblogic.socket.SocketMuxer.deliverExceptionAndCleanup(SocketMuxer.ja
va:599)
at weblogic.socket.SocketMuxer.deliverEndOfStream(SocketMuxer.java:549)
at weblogic.socket.SocketMuxer.readReadySocketOnce(SocketMuxer.java:707)
at weblogic.socket.SocketMuxer.readReadySocket(SocketMuxer.java:654)
at weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java:2
82)
at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:
32)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
<br><br><br><br>
<b>And in the server's log file the exception is like below</b><br><br>
<Nov 1, 2006 4:29:31 PM IST> <Error> <RJVM> <gsipl-c2-8> <cgServer> <ExecuteThread: '1' for queue: 'weblogic.socket.Muxer'> <<WLS Kernel>> <> <BEA-000503> <Incoming message header or abbreviation processing failed
<b>java.io.InvalidClassException: javax.xml.namespace.QName; local class incompatible: stream classdesc serialVersionUID = 4418622981026545151, local class serialVersionUID = -9120448754896609940</b>
java.io.InvalidClassException: javax.xml.namespace.QName; local class incompatible: stream classdesc serialVersionUID = 4418622981026545151, local class serialVersionUID = -9120448754896609940
at java.io.ObjectStreamClass.initNonProxy(Ljava.io.ObjectStreamClass;Ljava.lang.Class;Ljava.lang.ClassNotFoundException;Ljava.io.ObjectStreamClass;)V(Unknown Source)
at java.io.ObjectInputStream.readNonProxyDesc(Z)Ljava.io.ObjectStreamClass;(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Z)Ljava.io.ObjectStreamClass;(Unknown Source)
at java.io.ObjectInputStream.readObject0(Z)Ljava.lang.Object;(Unknown Source)
at java.io.ObjectInputStream.readObject()Ljava.lang.Object;(Unknown Source)
at weblogic.rjvm.ClassTableEntry.readExternal(ClassTableEntry.java:33)
at java.io.ObjectInputStream.readExternalData(Ljava.io.Externalizable;Ljava.io.ObjectStreamClass;)V(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Z)Ljava.lang.Object;(Unknown Source)
at java.io.ObjectInputStream.readObject0(Z)Ljava.lang.Object;(Unknown Source)
at java.io.ObjectInputStream.readObject()Ljava.lang.Object;(Unknown Source)
at weblogic.rjvm.InboundMsgAbbrev.readObject(InboundMsgAbbrev.java:65)
at weblogic.rjvm.InboundMsgAbbrev.read(InboundMsgAbbrev.java:37)
at weblogic.rjvm.MsgAbbrevJVMConnection.readMsgAbbrevs(MsgAbbrevJVMConnection.java:212)
at weblogic.rjvm.MsgAbbrevInputStream.readMessageContext(MsgAbbrevInputStream.java:251)
at weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:748)
at weblogic.rjvm.t3.T3JVMConnection.dispatch(T3JVMConnection.java:782)
at weblogic.socket.NTSocketMuxer.processSockets(NTSocketMuxer.java:105)
at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:32)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
<br><br><br>
<b>My workstation environment is</b>
Weblogic 8.1 SP6,Aqualogic 2.0 ,os is WindowsXP and JDK is jrockit81sp6_142_10.
<br><br><br>
Does anyone have any idea, why i am getting this error.
<br><br>
Thanks,<br>
Suresh varma.Hi Suresh varma
Did you get any answer for your problem?
I'm having the exact same problem. Working with Weblogic 8.1 SP6 and getting this strange message whenever I'm calling my data service.
I've followed the guidlines given on the URL posted here, and still getting the same message.
Let me know if you have any idea.
Cheers
Rod
Maybe you are looking for
-
How do I resolve a (-50) error message?
When I try to share a music video with iDVD, it returns the error message, "Unable to prepare project for publishing. The project could not be prepared for publishing because an error occurred. (-50)" I tried sharing with iTunes and Media Browser, bu
-
When create new apple id, they always me to contact to itune support, why?
When create new apple id, they always me to contact to itune support, why?
-
Hi all Can any please explain me about validation steps. My requirement to validate cost center. When ever I enter customer invoice with a particular customer (Ex: 20001) cost center should be Admin, if I give another one it should give error messa
-
When using Airplay mirroring between macbook pro and apple tv I cannot see video, only hear the audio. Worked fine before. Any suggestions on what the problem could be?
-
My cd of cs6 will not install?
I have tried mmany times to download my new CS6 software but it keeps ceasing computer. usually at 25%. I have shut down all applications. It was plugged in. As I haven't got serial number yet I was trying to do free trial. I had had a free trial rec