on 02-13-2006 4:51 PM
Ciao!
I have implemented test outbound proxy scenario.
When I try to run a java test program from NWDS, i received the following error:
Path to object does not exist at java:comp, the whole lookup name is java:comp/env/ejb/MIZPROTOTIPOOUT_PortTypeBean.
count = 0, total = 11
I initialize context in this mean:
......
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,"com.sap.engine.services.jndi.InitialContextFactoryImpl");
p.put(Context.PROVIDER_URL, "server:50004");
p.put(Context.SECURITY_PRINCIPAL, "user");
p.put(Context.SECURITY_CREDENTIALS, "pwd");
Context ctx = new InitialContext(p);
// Look up jndi name of proxy bean
queryOutLocalHome = (MIZPROTOTIPOOUT_PortTypeLocalHome)ctx.lookup("java:comp/env/ejb/MIZPROTOTIPOOUT_PortTypeBean");
......
where is the error??
Thanks in advances
Ale
When you call an EJB from outside of the server then you have to put the JNDI name directly into the query string.
An java:comp/env/ejb environment is only available, when you call an EJB from another EJB or from a servlet/jsp.
queryOutLocalHome = (MIZPROTOTIPOOUT_PortTypeLocalHome)ctx.lookup("<Your_JNDI_name>");
Look in the visual admin for the correct JNDI name.
Check out this how-to guide for further details:
Regards
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, thanks for link.
I call proxy from an external java class.
Now i change initialization but i receive the message:
null
count = 0, total = 11
my ejb.jar.xml is:
<?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>
<description>EJB JAR description</description>
<display-name>EJB JAR</display-name>
<enterprise-beans>
<session>
<display-name>MIZPROTOTIPOOUT_PortTypeBean</display-name>
<ejb-name>MIZPROTOTIPOOUT_PortTypeBean</ejb-name>
<home>prototipoIcms.MIZPROTOTIPOOUT_PortTypeHome</home>
<remote>prototipoIcms.MIZPROTOTIPOOUT_PortTypeRemote</remote>
<local-home>prototipoIcms.MIZPROTOTIPOOUT_PortTypeLocalHome</local-home>
<local>prototipoIcms.MIZPROTOTIPOOUT_PortTypeLocal</local>
<ejb-class>prototipoIcms.MIZPROTOTIPOOUT_PortTypeBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<ejb-local-ref>
<ejb-ref-name>ejb/MIZPROTOTIPOOUT_PortTypeBean</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>prototipoIcms.MIZPROTOTIPOOUT_PortTypeLocalHome</local-home>
<local>prototipoIcms.MIZPROTOTIPOOUT_PortTypeLocal</local>
<ejb-link>MIZPROTOTIPOOUT_PortTypeBean</ejb-link>
</ejb-local-ref>
</session>
</enterprise-beans>
</ejb-jar>
any suggestion?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I receive this message when I call proxy from my external java class.
I created this class in a simple java project inside mi NWDS.
Java proxy are deployed inside J2EE server (XI).
The code of this class is the following.
public class JavaProxyCall {
public static void main(String[] args) {
MIZPROTOTIPOOUT_PortTypeLocalHome queryOutLocalHome=null;
MIZPROTOTIPOOUT_PortTypeLocal queryOutLocal=null;
String data1 = "aaaa";
String data2 = "11111";
String Out = "";
// check for EJB class on server
try {
// Get naming context
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,"com.sap.engine.services.jndi.InitialContextFactoryImpl");
p.put(Context.PROVIDER_URL, "server:50004");
p.put(Context.SECURITY_PRINCIPAL, "user");
p.put(Context.SECURITY_CREDENTIALS, "pwd");
Context ctx = new InitialContext(p);
// Look up jndi name of proxy bean
queryOutLocalHome = (MIZPROTOTIPOOUT_PortTypeLocalHome)ctx.lookup("MIZPROTOTIPOOUT_PortTypeBean");
// Cast to Home interface
queryOutLocal = queryOutLocalHome.create();
MessageSpecifier msg = queryOutLocal.$messageSpecifier();
msg.setSenderService("BS_XID_PROXY");
queryOutLocal.$messageSpecifier(msg);
DTZPROTOTIPOOUT_Type reqtype = new DTZPROTOTIPOOUT_Type();
DTZRETURN_Type ciccio = new DTZRETURN_Type();
reqtype.setData1(data1);
reqtype.setData2(data2);
.........
.........
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.