on 08-22-2007 10:19 PM
Hi All,
I am working on a J2EE DC project. We are using EJBs to call BAPIs from SAP system. I am using following code to create a JCO connection with SAP system
<b>JCO.Pool pool = JCO.getClientPoolManager().getPool(Constants.Pool.JCO_POOL_NAME);
if (pool == null){
JCO.addClientPool(Constants.Pool.JCO_POOL_NAME,
5,
"600",
"ABCDEF", "test1234", "EN", "host name", "80"
);
}
fdbconnection = JCO.getClient(Constants.Pool.JCO_POOL_NAME);</b>
After writting this code in EJB if I say JCO.Attributes attr = fdbConnection.getAttributes() and if I return any aatribute such as attr.getClient() the I am able to show this in JSP. That means connection to SAP system is established as I am able to print connection attributes.
But while getting the functionTemplate
<b>JCO.Function testBAPI = repository.getFunctionTemplate("ZBAPI").getFunction();</b>
this line from my code throws an error.
This is the default trace that i got
<b>Processing HTTP request to servlet [jsp] finished with error. The error is: java.lang.NullPointerException
at com.abc.cde.service.test.SiteAccess.getdata(SiteAccess.java:51)
at jsp_site1187811520390._jspService(jsp_site1187811520390.java:11)
at com.sap.engine.services.servlets_jsp.server.jsp.JspBase.service(JspBase.java:112)
at com.sap.engine.services.servlets_jsp.server.servlet.JSPServlet.service(JSPServlet.java:544)
at com.sap.engine.services.servlets_jsp.server.servlet.JSPServlet.service(JSPServlet.java:186)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:160)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
</b>
Please Help me ASAP this is really urgent.
Dont worry about points
cheers
jayant
And just in case the developer has missed it, make sure the BAPI is RFC-Enabled! I've missed this so many times when developing BAPI's and spent ages tracing through my Java only to realise I've forgottton to enable it!
Gareth.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Does ZBAPI exist in backend system and user has authorization for it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
The user id and password that I am using for JCO connection is of developer who created ZBAPI. How to test whethere ZBAPI is there in the backend or not?
And what type of Authorizations are needed for accessing ZBAPI? Even if I try to acess standard BAPI it's giving me same error. This user id don't have authorization for transaction sm59 in SAP system.
cheers
jayant
User | Count |
---|---|
95 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.