on 02-16-2006 2:14 PM
Hello!
i configured a test xi scenario: JSP->(JAVA Proxy)-> XI -> file adapter.
Jsp is in the same bean of proxy.
I deploy this j2ee application in the same j2ee of XI.
When I open jsp page with browser and send data, nothing appened.
I check also in adapter engine monitor and xml monitor but i can't see any message.
I think the problem is inside java bean because if i fix the output data, after post action i see data in jsp page.
this is the class for call proxy:
public class InvokeProxy {
public String getRole(String name, String pwd){
String role="";
UsersSyncMI_PortTypeLocalHome queryOutLocalHome=null;
UsersSyncMI_PortTypeLocal queryOutLocal=null;
try{ Context ctx = null; Object ref = null; 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");
ctx = new InitialContext();
queryOutLocalHome = (UsersSyncMI_PortTypeLocalHome)ctx.lookup("java:comp/env/ejb/UsersSyncMI_PortTypeBean");
queryOutLocal = queryOutLocalHome.create();
MessageSpecifier msg = queryOutLocal.$messageSpecifier();
msg.setSenderService("BS_XID_PROXY");
queryOutLocal.$messageSpecifier(msg);
UserDT_Type reqtype = new UserDT_Type();
reqtype.setUsername(name);
reqtype.setPassword(pwd);
UsersDBDTResponse_Type response = new UsersDBDTResponse_Type();
response = queryOutLocal.usersSyncMI(reqtype);
role = role + response.getStatementResponse().get_as_listRow().getRow(0).getRole();
} catch(Exception ex){
System.out.println(ex.getMessage()); } return role; }
.....
....
any suggestion
thanks Ale
Hi Alessandro,
Check in your web.xml that you have applied local refernces, as you call the localhome/localremote interfaces:
<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>ejbProxyPrototype.jar#MIZPROTOTIPOOUT_PortTypeBean</ejb-link>
</ejb-local-ref>
Or you change your code and use home and remote interfaces.
Regards
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Alessandro,
Did you apply the EJB reference in the web.xml?
Regards
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Stefan!
yes, I apply.
This is my web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>WEB APP</display-name>
<description>WEB APP description</description>
<servlet>
<servlet-name>InvokeProxyPrototype.jsp</servlet-name>
<jsp-file>/InvokeProxyPrototype.jsp</jsp-file>
</servlet>
</web-app>
thanks,
but when I goto web.xml tab EJB and i try to add the EJB references i receive this error:
"No reference to EJB Module Projects"
"To create EJB references, project references to EJB Module Projects are required. These projects must contains EJBs."
It's strange because the web project have reference inside a ejb module...
My web modules is in the same ear of proxy.
I make all this step.
I try to send a test message but i don't see any message in Message Monitor or in XML monitor.
If i fix a text constant in return data i receive this data in jsp page.
I think the problem is in class InvokeProxy; the class don't call proxy.
I catch the exception:
com.sap.engine.services.jndi.persistent.UnsatisfiedReferenceImpl.
Any idea???
Message was edited by: Alessandro Pederiva
I haven't J2SE in my scenario. I can't try.
anyway, the code that i'm using now for call proxy is:
try{ Context ctx = null; Object ref = null; Properties p = new Properties();
ctx = new InitialContext();
ref = ctx.lookup("java:comp/env/ejb/MIZPROTOTIPOOUT_PortTypeBean");
queryOutLocalHome = (MIZPROTOTIPOOUT_PortTypeLocalHome)ctx.lookup("java:comp/env/ejb/MIZPROTOTIPOOUT_PortTypeBean");
queryOutLocal = queryOutLocalHome.create();
MessageSpecifier msg = queryOutLocal.$messageSpecifier();
msg.setSenderService("BS_XID_PROXY");
queryOutLocal.$messageSpecifier(msg);
DTZPROTOTIPOOUT_Type reqtype = new DTZPROTOTIPOOUT_Type();
reqtype.setData1(name);
reqtype.setData1(pwd);
DTZRETURN_Type response = new DTZRETURN_Type();
queryOutLocal.mIZPROTOTIPOOUT(reqtype);
String respons = "work!";
role = respons;
} catch(Exception ex){
System.out.println(ex.getMessage());
String error = ex.getMessage();
role = error;
}
return role; }
Hi Alessandro,
You need only a simple Java class where you write the code to call from your NDWI. First you should test, if you can access your EJB anyway, then try the JSP approach.
Another thing you have to check: The library references of the JSP project should be the same as in the EJB project. When you use the same EAR module that should be available anyway.
In your JSP now, what is the output?
Stefan
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
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.