Java Connector & classpath
hello,
I'm trying to connect to my database but i have the following error :
"no suitable driver".
I think i've all configured well but i don't know what's the "classpath" for, and when i need it to get connected.
i've got a .classpath file which contains the following code :
<?xml version="1.0" encoding="UTF-8" ?>
- <classpath>
<classpathentry kind="src" path="" />
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER" />
<classpathentry kind="lib" path="D:/exonum/projet/debut/driver/mysql-connector-java-3.1.7-bin.jar" />
<classpathentry kind="output" path="" />
</classpath>
What should i do to resolve my problem ? I would appreciate any explanations.
thanx
tamtam
that's a standalone application...
Here's the code for the connection
public static Connection getConnection() throws SQLException, IOException {
Properties props = new Properties();
FileInputStream in = new FileInputStream("G:/exonum/Projet/debut/database.properties");
props.load(in);
in.close();
String drivers = props.getProperty("jdbc.drivers");
if (drivers != null)
System.setProperty("jdbc.drivers", drivers);
String url = props.getProperty("jdbc.url");
String username = props.getProperty("jdbc.username");
String password = props.getProperty("jdbc.password");
return DriverManager.getConnection(url, username, password);
}and the file database.properties contains :
jdbc.drivers=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://url
jdbc.username=login
jdbc.password=********
Similar Messages
-
SAP Business One - Java Connector
Hi All,
<br/><br/>
We have a SAP Business One Application installed on a laptop. The requirement is to be able to use the SAP Java API to update tables in the system. We are not allowed to connect directly to the database and was advised to use the API instead.
<br/><br/>
The downloaded API that we are using is "sapjco30P_6-10005324 32 bit.zip". I have included the dll file contained in this package in the WINDOWS/system32 folder. I am using Eclipse as IDE and already included the "sapjco3.jar" in the classpath.
<br/><br/>
First question: Am I using the right Java Connector for SAP Business One?
<br/><br/>
I got sample code on how to connect using JCO:
<br/><br/>
package sample;<br/><br/>
import java.io.File;<br/>
import java.io.FileOutputStream;<br/>
import java.util.Properties;<br/>
import java.util.concurrent.CountDownLatch;<br/><br/>
import com.sap.conn.jco.AbapException;<br/>
import com.sap.conn.jco.JCoContext;<br/>
import com.sap.conn.jco.JCoDestination;<br/>
import com.sap.conn.jco.JCoDestinationManager;<br/>
import com.sap.conn.jco.JCoException;<br/>
import com.sap.conn.jco.JCoField;<br/>
import com.sap.conn.jco.JCoFunction;<br/>
import com.sap.conn.jco.JCoFunctionTemplate;<br/>
import com.sap.conn.jco.JCoStructure;<br/>
import com.sap.conn.jco.JCoTable;<br/>
import com.sap.conn.jco.ext.DestinationDataProvider;<br/><br/>
public class StepByStepClient<br/>
{<br/>
static String ABAP_AS = "ABAP_AS_WITHOUT_POOL";<br/>
static String ABAP_AS_POOLED = "ABAP_AS_WITH_POOL";<br/>
static String ABAP_MS = "ABAP_MS_WITHOUT_POOL";<br/>
static<br/>
{<br/>
Properties connectProperties = new Properties();<br/>
connectProperties.setProperty(DestinationDataProvider.JCO_ASHOST, "localhost");<br/>
connectProperties.setProperty(DestinationDataProvider.JCO_SYSNR, "06");<br/>
connectProperties.setProperty(DestinationDataProvider.JCO_CLIENT, "000");<br/>
connectProperties.setProperty(DestinationDataProvider.JCO_USER, "manager"); //sapuser<br/>
connectProperties.setProperty(DestinationDataProvider.JCO_PASSWD, "manager"); //sap1234<br/>
connectProperties.setProperty(DestinationDataProvider.JCO_LANG, "en");<br/>
createDataFile(ABAP_AS, "jcoDestination", connectProperties);<br/><br/>
connectProperties.setProperty(DestinationDataProvider.JCO_POOL_CAPACITY, "3");<br/>
connectProperties.setProperty(DestinationDataProvider.JCO_PEAK_LIMIT, "10");<br/>
createDataFile(ABAP_AS_POOLED, "jcoDestination", connectProperties);<br/><br/>
connectProperties.clear();<br/>
connectProperties.setProperty(DestinationDataProvider.JCO_MSHOST, "localhost");<br/>
connectProperties.setProperty(DestinationDataProvider.JCO_R3NAME, "SID");<br/>
connectProperties.setProperty(DestinationDataProvider.JCO_CLIENT, "000");<br/>
connectProperties.setProperty(DestinationDataProvider.JCO_USER, "manager"); //sapuser<br/>
connectProperties.setProperty(DestinationDataProvider.JCO_PASSWD, "manager"); //sap1234<br/>
connectProperties.setProperty(DestinationDataProvider.JCO_GROUP, "GROUP");<br/>
connectProperties.setProperty(DestinationDataProvider.JCO_LANG, "en");<br/>
createDataFile(ABAP_MS, "jcoDestination", connectProperties);<br/>
}<br/><br/>
static void createDataFile(String name, String suffix, Properties properties)<br/>
{<br/>
File cfg = new File(name"."suffix);<br/>
if(!cfg.exists())<br/>
{<br/>
try<br/>
{<br/>
FileOutputStream fos = new FileOutputStream(cfg, false);<br/>
properties.store(fos, "for tests only !");<br/>
fos.close();<br/>
}<br/>
catch (Exception e)<br/>
{<br/>
throw new RuntimeException("Unable to create the destination file " + cfg.getName(), e);<br/>
}<br/>
}<br/>
}<br/><br/>
public static void step1Connect() throws JCoException<br/>
{<br/>
JCoDestination destination = JCoDestinationManager.getDestination(ABAP_AS);<br/>
System.out.println("Attributes:");<br/>
System.out.println(destination.getAttributes());<br/>
System.out.println();<br/><br/>
destination = JCoDestinationManager.getDestination(ABAP_MS);<br/>
System.out.println("Attributes:");<br/>
System.out.println(destination.getAttributes());<br/>
System.out.println();<br/>
}<br/><br/>
public static void main(String[] args) throws JCoException<br/>
{<br/>
step1Connect();<br/>
}<br/>
}<br/>
<br/><br/>
Each time I run the application I run into an error:
<br/><br/>
Attributes:<br/>
Exception in thread "main" com.sap.conn.jco.JCoException: (102) JCO_ERROR_COMMUNICATION: Connect to SAP gateway failed<br/>
Connection parameters: TYPE=A DEST=ABAP_AS_WITHOUT_POOL ASHOST=localhost SYSNR=06 PCS=1<br/><br/>
LOCATION CPIC (TCP/IP) on local host with Unicode<br/>
ERROR connection to partner '127.0.0.1:3306' broken<br/>
TIME Mon May 09 10:46:46 2011<br/>
RELEASE 720<br/>
COMPONENT NI (network interface)<br/>
VERSION 40<br/>
RC -6<br/>
MODULE gwxx.c<br/>
LINE 646<br/>
DETAIL NiIRead: P=127.0.0.1:3306; L=0.0.0.0:50496<br/>
SYSTEM CALL GwRead<br/>
ERRNO 10054<br/>
ERRNO TEXT WSAECONNRESET: Connection reset by peer<br/>
COUNTER 2<br/><br/>
at com.sap.conn.jco.rt.MiddlewareJavaRfc.generateJCoException(MiddlewareJavaRfc.java:662)<br/>
at com.sap.conn.jco.rt.MiddlewareJavaRfc$JavaRfcClient.connect(MiddlewareJavaRfc.java:1362)<br/>
at com.sap.conn.jco.rt.ClientConnection.connect(ClientConnection.java:721)<br/>
at com.sap.conn.jco.rt.PoolingFactory.init(PoolingFactory.java:103)<br/>
at com.sap.conn.jco.rt.ConnectionManager.createFactory(ConnectionManager.java:293)<br/>
at com.sap.conn.jco.rt.DefaultConnectionManager.createFactory(DefaultConnectionManager.java:46)<br/>
at com.sap.conn.jco.rt.ConnectionManager.getFactory(ConnectionManager.java:262)<br/>
at com.sap.conn.jco.rt.RfcDestination.initialize(RfcDestination.java:509)<br/>
at com.sap.conn.jco.rt.RfcDestination.getAttributes(RfcDestination.java:347)<br/>
at com.sap.conn.jco.rt.RfcDestination.getAttributes(RfcDestination.java:27)<br/>
at sample.StepByStepClient.step1Connect(StepByStepClient.java:74)<br/>
at sample.StepByStepClient.main(StepByStepClient.java:304)<br/>
Caused by: RfcException: [null]<br/>
message: Connect to SAP gateway failed<br/>
Connection parameters: TYPE=A DEST=ABAP_AS_WITHOUT_POOL ASHOST=localhost SYSNR=06 PCS=1<br/>
<br/><br/>
Second question: What seems to be the problem with my sample application? Do I need to use a different Java Connector for SAP Business One or SAP Business One does not support Java Connector?
<br/><br/>
Please help.
<br/><br/>
Thank you all.
Edited by: kevinroy on May 9, 2011 4:51 AMHi,<br/>
Thank you very much for the reply. I am now able to move forward with what I am doing.<br/>
I used the following code in connecting but am encountering an error:<br/>
public class ConnectSAP {
// company interface
public ICompany company;
private SBOErrorMessage errMsg = null;
public static void main(String[] args) {
ConnectSAP company = new ConnectSAP();
company.conn();
//method make connection andinitialize company instance
public int conn() {
int rc = 0;
try {
company = SBOCOMUtil.newCompany();
company.setServer("192.168.0.216"); //192.168.0.216
company.setCompanyDB("SBODemoUS");
company.setUserName("manager");
company.setPassword("manager");
company.setDbServerType(SBOCOMConstants.BoDataServerTypes_dst_MSSQL2005);
company.setUseTrusted(new Boolean(false));
company.setLanguage(SBOCOMConstants.BoSuppLangs_ln_English);
company.setDbUserName("username");
company.setDbPassword("password");
//company.setAddonIdentifier("...");
//company.setLicenseServer("...");
rc = company.connect();
if (rc == 0) {
System.out.println("Connected!");
} else {
errMsg = company.getLastError();
System.out.println(
"I cannot connect to database server: "
+ errMsg.getErrorMessage()
+ " "
+ errMsg.getErrorCode());
} catch (Exception e) {
e.printStackTrace();
return -1;
return rc;
public void freeConnection(){
company.disconnect();
}<br/>
I am getting the error "Failed to Connect to SBOCommon -111".<br/>
Error is still the same even if I set UseTrusted to true and comment the DbUserName and DbPassword.<br/>
Do I need to specify the license? Or login to SAP before connecting?<br/>
Thank you. -
How to install the SAP Java Connector
Hi,
I am unsure how to install the SAP Java Connector on Linux (Suse Linux Enterprise 10). The SAP Integration Kit install and admin guide says:
===
u2022 Copy the librfccm library and the libsapjcorfc library to busines
sobjects_root/enterprise120/PLATFORM_PATH, where busines
sobjects_root is the full path to your businessobjects directory,
and PLATFORM_PATH is your platform. For example, PLATFORM_PATH
is solaris_sparc for an installation on Solaris.
u2022 Use symbolic links for the location of the librfccm library and the lib
sapjcorfc library.
u2022 Add the location of the librfccm library and the libsapjcorfc library
to the library path.
===
Do I have to do all 3 steps or is the 1st one (copying of files) enough?
On the other hand, the SAP Java Connector guide says:
===
Then add {sapjco-install-path} to the LD_LIBRARY_PATH environment variable.
Finally, add {sapjco-install-path}/sapjco.jar to your CLASSPATH environment variable.
===
So, what to do?
Thanks!Thanks for your help. So i copied the 2 files as mentioned in point 1.
Where do I have to copy the file sapjco.jar to? There is no shared lib folder after installing BO Edge 3.1 on a Linux system.
I copied the sapjco.jar to /bobje/tomcat/common/lib but still get the message that the Java Connector files are not in the correct directory.
I already copied the files librfccm.so and libsapjcorfc.so to /bobje/enterprise120/linux_x86 .
Thanks again!
Edit: problem solved: Copying the sapjco.so to tomcat/shared/lib is correct, if the directory doesn't exist then just create it (mkdir). The message is just plain information 7 hint. -
Java Connector. "sapjcorfc.dll already loaded in another classloader"
Dear all:
I'm fighting against a Java Connector problem.
I'm using:
-JCO version 2.16
-Apache Tomcat 5.5.17
I have written the environment variables:
CLASSPATH pointing where I have sapjco.jar, sapjcorfc.dll
Path where i have sapjco.jar, sapjcorfc.dll.
I try to make a webservice which calls a RFC function in SAP.
Java program compiles and Deploy OK.
I load the web service in Tomcat.
When I call the java server page, I get this error message from Tomcat:
org.apache.jasper.JasperException: JCO.classInitialize(): Could not load middleware layer 'com.sap.mw.jco.rfc.MiddlewareRFC'
JCO.nativeInit(): Could not initialize dynamic link library sapjcorfc Native Library C:\Traspas\Projecte\lib\sapjcorfc.dll already loaded in another classloader. java.library.path C:\Tomcat5.5.17\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Java\jdk1.5.0_07\bin;C:\Traspas\Projecte\lib
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
Seems that is trying to load twice sapjcorfc.dll?
I would be grateful if someone can give me help.
Thanks in advance.
JordiI received a message asking for further clarification. I try to further explain.
Be sure sapjco.jar is not included in the application. Doing so will lead the system to load more than one time the SAP Java Connector. Sapjco.jar has to be loaded only once in the server.
To do so (in Windows & Tomcat environment):
1-Be sure sapjco.jar is not included in the WEB-INF folder.
2-Put sapjcorfc.dll and librfc32.dll in c:Windowssystem32
3-Put sapjco.jar in c:Tomcatcommonlib
4-Add a reference to sapjco.jar in the project (In Eclipse: Project/Properties/Java Build Path, Tab Libraries, Add External JARs.
5-Compile and deploy the application. Generate War file. If ant gives problems, add proper command to find sapjco.jar (section <path id=u201Dpath.baseu201D>, <include name=u201Dsapjco.jaru201D>)
6-Load the WAR file in Tomcat.
7-Stop and Start Tomcat.
8-Run the application.
A related thread: [SAP J2EE engine problem|SAP J2EE engine problem]
Hope this helps. -
Hello!
I am new with the Java Connector, and I am sure this problem is something easy to solve; I just can not figure it out.
I am on XP Pro, and I have the files extracted to the directory C:\JCo. I have the PATH and CLASSPATH environment variables updated, but I am guessing that I might have the incorrect values there.
Here is the problem. I can compile Example1 (or any of the other examples) from the demo directory fine, but when I try to run it I get the error message "Exception in thread "main" java.lang.NoClassDefFoundError: Example1," which does not make sense since it was compiled correctly.
My guess is that the CLASSPATH (or PATH) variable is not set correctly. Can anyone send me what they have for that value, or what I should be using? I checked the Intro.html file and I think I am just not putting it in correctly or not understanding the intent.
I am always fast with returning points for helpful answers!
Thanks!
JohnHello John,
as the demos compile without any errors your classpath settings for the JCO libs should be ok. How did you try to run the examples? If you're using the commandline you have to add the parameter -cp <path_to_your_demos> or add the demopath also to your global classpath definition.
Hope this helps.
Cheers Lars
PS: Don't forget the points if my answer helped you -
Error while deploying MDM Java Connector for EP
Hi,
i am a newbie to MDM.i am trying to develop a portal component with the blog "Using MDM5.5 Java Connector with SAP Enterprise Portal 6.0" as reference.
i created an MDM system in portal and the connection tests passed.
But when i deploy the code i get the following exception-
java.lang.NullPointerException
at com.sap.mdm.connector.connection.MdmConnectionFactory.getConnectionEx(MdmConnectionFactory.java:170)
at com.sap.portal.ivs.internalconnector.ConnectionProvider.getConnection(ConnectionProvider.java:304)
at com.sap.portal.ivs.internalconnector.ConnectionProvider.getConnection(ConnectionProvider.java:258)
at com.sapportals.portal.ivs.cg.ConnectorService.getConnection(ConnectorService.java:478)
at com.sapportals.portal.ivs.cg.ConnectorService.getConnection(ConnectorService.java:85)
at com.cts.mdm.MDMtestcomp.doContent(MDMtestcomp.java:36)(this points to the line <b>connection = cgService.getConnection("MDM_SYSTEM_ALIAS", prop);</b>)
at com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:209)
at com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114)
at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
This is my code-
IConnectorGatewayService cgService = (IConnectorGatewayService)
PortalRuntime.getRuntimeResources().getService(IConnectorService.KEY);
ConnectionProperties prop =
new ConnectionProperties(request.getLocale(), request.getUser());
IConnection connection = null;
connection = cgService.getConnection("MDM_SYSTEM_ALIAS", prop);
INative nativeInterface = connection.retrieveNative();
CatalogData catalog = new CatalogData();
catalog = (CatalogData)
nativeInterface.getNative(CatalogData.class.getName());
ResultSetDefinition rsd = new ResultSetDefinition("Customers");
rsd.AddField("Name");
Search search = new Search("Customers");
A2iResultSet rs = null;
rs = catalog.GetResultSet(search,rsd,"Name",true,0);
response.write(rs.GetFields().toString());
Have i missed anything?
Should i deploy any .jar file? (i've already deployed MDM4J.jar) and referenced it in portalapp!
Thanks in advance
SwarnaDeepikaHello Swarna:
I believe than rather than deploying the MDM4J.jar, you should deploy this components:
com.sap.mdm.tech.mdm4j.sda
com.sap.mdm.tech.connector.sda
BPMDMTECHN00_0.sca
BPMDMAPPLI00_0.sca
Once you deploy those, you should have no problems. Another solution would be to take your MDM4J.jar and wrap it into an SDA, then deploy, but that would be pretty much the same.
Those components are included on your MDM CD. Please ensure you use the same Version/support package/hotfix all over your landscape.
I hope that helps
Alejandro -
RFC JAVA CONNECTOR CAUSING THE JAVA TO BE IN SAFE MODE
Hi GURUS :
We have SolMan with JAVA as Add in . Now during the JSPM Launch the JSPM Aborts with the Err Messages as shown :
in trace file dev_jrfc.trc and in defaultTrace we have this same message :
>>>>
#1.5 #0003BA951BE1004C0000000500007486000456B88DE8595D#1221250561628#com.sap.engine.services.rfcengine##com.sap.engine.services.rfcengine#J2EE_GUEST#0##n/a##d7e28da080f311ddc3de0003ba951be1#SAPEngine_Application_Thread[impl:3]_27##0#0#Error#1#/System/Server#Plain###Bean SLDJAVA_ACCESSOR_REQUESTnot found on host <fqdn of host name> ProgId =JCOLDAPI: Path to object does not exist at rfcaccessejb_stateful, the whole lookup name is rfcaccessejb_stateful/SLDJAVA_ACCESSOR_REQUEST.registered entries for FuctionName=JNDIName : {}#
#1.5 #0003BA951BE1004C0000000600007486000456B88DE85D04#1221250561629#com.sap.engine.services.rfcengine##com.sap.engine.services.rfcengine.handleRequest#J2EE_GUEST#0##n/a##d7e28da080f311ddc3de0003ba951be1#SAPEngine_Application_Thread[impl:3]_27##0#0#Error##Plain###java.lang.RuntimeException: Bean SLDJAVA_ACCESSOR_REQUESTnot found on host <fqdn of host name>, ProgId =JCOLDAPI: Path to object does not exist at rfcaccessejb_stateful, the whole lookup name is rfcaccessejb_stateful/SLDJAVA_ACCESSOR_REQUEST.#
#1.5 #0003BA951BE1004C0000000700007486000456B88DE85E8C#1221250561629#com.sap.engine.services.rfcengine##com.sap.engine.services.rfcengine.handleRequest#J2EE_GUEST#0##n/a##d7e28da080f311ddc3de0003ba951be1#SAPEngine_Application_Thread[impl:3]_27##0#0#Error##Plain###java.lang.RuntimeException: Bean SLDJAVA_ACCESSOR_REQUESTnot found on host <fqdn of host name>, ProgId =JCOLDAPI: Path to object does not exist at rfcaccessejb_stateful, the whole lookup name is rfcaccessejb_stateful/SLDJAVA_ACCESSOR_REQUEST.
at com.sap.engine.services.rfcengine.RFCDefaultRequestHandler.handleRequest(RFCDefaultRequestHandler.java:138)
at com.sap.engine.services.rfcengine.RFCJCOServer$J2EEApplicationRunnable.run(RFCJCOServer.java:254)
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:102)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)
<<<
Now , this JCOLDAPI is Java RFC Connector with User PORTALADMIN and at the ABAP Side we see that the J2EE_ADMIN pwd was changed by this PORTALADMIN !! We had at the same time stamp, the message in the log file of the JSPM that credential supplied to log in to J2EE Engine is not valid ( 'cause, the PORTALADMIN had changed the PW
of the J2EE_ADMIN ) - While attempting to Launch the JSPM for JAVA Patches > It aborts with the same above message !!
Half of the SW Comp were updated and rest half aborts repeatedly with the above message.
Same way the Vis Admin won't start with the msg that Credential to connect J2EE is not valid. Although there was no change at the Config Tool Secure Store > J2EE Admin and SAPSR3DB passwords !!
I have changed both the J2EE_ADMIN and the PORTAL ADMIN to the User Type Service User ( note 622464 ) ..have
kept the same pw at ABAP and configtool secure store. But the java is not coming up neither through SMICM nor through the startsap j2ee command as SMPADM.
i.e. it would comeup only in SAFE Mode !!
This JCOLDAPI RFC Java Connector 's PORTALADMIN has several rights at the ABAP Side and is used for EWA Purpose.
JAVA is running in SAFE mode and no matter how many time I try at the config tool Side to bring it in normal mode it is not swithcing to normal mode > I disble the safe mode at the ConfigTool Side > Apply > Save . > Restart the JAVA through the jcmon > shutdown and restart cluster under #10 Cluster Admin Menu > it is coming up only in SAFE mode again with the abvoe error message !!! Restart through the SMICM don't even work at all !!. Also, the system is slow ..even to come in safe
mode JAVA takes about 45 minutes !!!
Also, since the JAVA is coming up only in safe mode the SLD and the browser page is not available. The jcomon displays the instance status as ' Synchronizing Binaries' since
last 20 hours ..this means that the instance is in hang state.
Any idea how to solve this problem ?
Thanks a Lot in Advance,
Regards,
- Ishan
Edited by: ISHAN P on Sep 13, 2008 2:54 PMhi ishan,
do you have solved the problem?? as ??
thanks
umberto -
How to get pdf file from sap presentation server using java connector
Hi Friends,
with the below code i am able to get po details in pdf in presentation server.
DATA : w_url TYPE string
VALUE 'C:\Documents and Settings\1011\Solutions\web\files\podet.pdf'.
CALL FUNCTION 'ECP_PDF_DISPLAY'
EXPORTING
purchase_order = i_ponum
IMPORTING
PDF_BYTECOUNT =
pdf = file " data in Xsting format
*Converting Xstring to binary_tab
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = file
APPEND_TO_TABLE = ' '
IMPORTING
OUTPUT_LENGTH =
TABLES
binary_tab = it_bin " data in binary format
**Downloading into PDF file
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
filename = w_url
filetype = 'BIN'
TABLES
data_tab = it_bin
when i am using java connector , to retirve the file from presentation server , the follwoing error i am getting...
init:
deps-jar:
compile-single:
run-single:
com.sap.mw.jco.JCO$Exception: (104) RFC_ERROR_SYSTEM_FAILURE: Error in Control Framework
at com.sap.mw.jco.rfc.MiddlewareRFC$Client.nativeExecute(Native Method)
at com.sap.mw.jco.rfc.MiddlewareRFC$Client.execute(MiddlewareRFC.java:1244)
at com.sap.mw.jco.JCO$Client.execute(JCO.java:3842)
at com.sap.mw.jco.JCO$Client.execute(JCO.java:3287)
at PdfGen.<init>(PdfGen.java:35)
at PdfGen.main(PdfGen.java:78)
Java Result: 1
BUILD SUCCESSFUL (total time: 1 second)
i debugged too, problem with <b>gui_download......</b>
I am very glad to all with your suggestions!!
Regards,
Madhu..!!Hi
You can try to create an external command (transaction SM69).......sorry I've forgotten,,,,they works on application
How do you call CL_GUI_FRONTEND_SERVICES=>EXECUTE?
Max
Edited by: max bianchi on Oct 13, 2011 10:27 AM -
Enterprise JavaBeans and SNMP Java Connector
There is possible to develop a Java Connector that will allow my J2EE application to collaborate ( send , receive) SNMP commands with various network devices ( sensors, Access Points, hardware devices).
The information eventualy will be pushed back to the subscribed users using AJAX technologies.
MikeHi,
I do not get your question.....
You want to connect from MI7.1 directly to a BAPI in the Middleware? Well, in 7.0 there was Generic Sync to do that - and I think this should be still there. With Generic sync it was possible to connect to call any BAPI in the middleware directly - if your user had appropiate rights. Check MDK for details.
And if you want to do that in our own app - if this is the intention of your question.... well.... then I would tell you this is under SAP (C), so as you know you could decompile the MI client code, but this is not allowed.
But I guess it was the first thing you are after, so see if that answer helps. But even there you need the running MI middleware - and this thing confused me in your question - are you using MI already or not and what do you want to do?
Regards,
Oliver -
Is this possible: SAP Java Connector - XI - R3 with XI RFC Adapter?
Hi,
I try to call a RFC on a remote R/3 System over the XI Server in a Java Application with SAP Java Connector.
I have configured a RFC Sender Adapter in XI. I get the
following Exception:
"lookup of alternativeServiceIdentifier via CPA-cache failed for channel 'SenderChannel_RFC"!
Is this scenario possible? Or do the connection from
a SAP Java Connector App to the XI RFC Adapter not work?
You can't set the Client and System ID of a Third-Party or
Standalone Java system in the SLD.
Thanks for any help!
Regards
WolfgangHi,
We use a JCO for directly connecting to sap systems.
In that case we need not use any XI also.
But if you want to use RFC adapter and java application the best way is to use java proxies as sender and reciever as RFC adapter.
I donot think there is any architectural significance in using rfc adapter of XI while using JCO.
Let me know if I mis-understood the context. -
Hi Friends,
In the code ....
I am calling Remote Function module ZRFC_PO_VEND_VALID using java connector and passing PO_Number and Vendor Number as input parameters and after execution it returns (E_POVALID =1 [PO_NUMBER exists for Vendor number] otherwise E_POVALID = 0 )
when i am executing the below code ....in both cases it is returning Zero value.
I tested the function module in se37 its working....
may i know the reason for this....
import com.sap.mw.jco.*;
@author Thomas G. Schuessler, ARAsoft GmbH
http://www.arasoft.de
public class TutorialBapi1 extends Object {
JCO.Client mConnection;
JCO.Repository mRepository;
public TutorialBapi1() {
try {
// Change the logon information to your own system/user
mConnection =
JCO.createClient("100", // SAP client
"abap", // userid
"abap", // password
"en", // language
"sapdev1", // application server host name
"00"); // system number
mConnection.connect();
mRepository = new JCO.Repository("ARAsoft", mConnection);
catch (Exception ex) {
ex.printStackTrace();
System.exit(1);
JCO.Function function = null;
JCO.Table codes = null;
try {
function = this.createFunction("ZRFC_PO_VEND_VALID");
if (function == null) {
System.out.println("ZRFC_PO_VEND_VALID" +
" not found in SAP.");
System.exit(1);
//mConnection.execute(function);
JCO.Field vendID = function.getImportParameterList().getField("I_EBELN");
JCO.Field poID = function.getImportParameterList().getField("I_LIFNR");
vendID.setValue("20081");
poID.setValue("4500000017");
try {
mConnection.execute(function);
catch (Exception ex) {
ex.printStackTrace();
System.exit(1);
JCO.Field povalid =
function.getExportParameterList().getField("E_POVALID");
//if (povalid.getValue() == null ){
// System.out.println("Error Message");
System.out.println(povalid.getValue());
//if (povalid == null ){
//System.out.println(povalid.getValue("E_POVALID"));
//System.out.println("Error Message");
//System.exit(1);
catch (Exception ex) {
ex.printStackTrace();
System.exit(1);
mConnection.disconnect();
public JCO.Function createFunction(String name) throws Exception {
try {
IFunctionTemplate ft =
mRepository.getFunctionTemplate(name.toUpperCase());
if (ft == null)
return null;
return ft.getFunction();
catch (Exception ex) {
throw new Exception("Problem retrieving JCO.Function object.");
public static void main (String args[]) {
TutorialBapi1 app = new TutorialBapi1();
with warm regards,
Madhu.Hi Ravi ,
I tried as per your sugggestion..still getting the same problem.
Regards,
Madhu!! -
Need Standard BAPI To Create Opportunity in SAP Using Java Connector.
Hi All,
What is the standard BAPI to create an opportunity in SAP CRM through Java Connector.
Please share code if available for doing same. I have found BAPI_OPPORTUNITY_CREATE_MULTI .
How to create opportunity in SAP through java connector using BAPI_OPPORTUNITY_CREATE_MULTI .Hi,
I think you can search for it or you can create a thread at ABAP section. -
Hi,
where can i find the BI Java Connector Files:
bi_sdk_jdbc.rar
bi_sdk_xmla.rar
bi_sdk_sapq.rar
bi_sdk_odbo.rar
Can anyone help me?hi Christian,
these files should be included in bi java sdk
https://www.sdn.sap.com/irj/sdn/downloaditem?rid=/webcontent/uuid/78b3db58-0501-0010-b895-f75cd8fdf674 [original link is broken]
hope this helps. -
Integrating SAP Java Connector with SAP XI
Hi XI experts
We are about to integrate our SAP ERP2004 system with a new WMS system. The vendors of the WMS system normally integrates with ERP directly through SAP Java Connector, but we would like to put SAP XI between the two systems so we have good way of monitoring the messages beeing sent.
I would like to make a synchronous test scenario where we send a ARTMAS idoc from SAP to XI which sends it to the WMS. After WMS system receives the ARTMAS Idoc it sends an acknowledgement back to XI which passes it on to SAP.
The integration would then look like this:
SAP ERP <-> SAP XI <-> WMS (Jco)
Is this scenario possible? And if so, how would you suggest to set it up?
I was thinking of using the RFC adapter to connect to the Java Connector of WMS, but am not sure if this is the right approach or how it should be set up.
Any help or comments would be greatly appreciated.
Best Regards
ChrisI have made a setup like this:
SAP <-> XI <-> WMS
The Scenario is like this:
SAP sends an ARTMAS03 idoc to XI which maps it directly to the same ARTMAS03 idoc structure (need a few changes in the future so thats why im not using IDOC tunnelling) then it uses a RFC receiver adapter to connect to our SAP gateway, where the WMS is registrered through JCO.
When I first sent the idoc, i got a "RfcAFWException: failed to read funtionname from XML document: missing namespace declaration(2)" then after reading Q23 in note 730870, I used the RFCNormalizer xslt to change the namespace to a "urn:sap-com:document:sap:rfc:fuctions" instead of the "urn:sap-com:document:sap:idoc:messages". The error is now "functiontemplate from repository was <null>".
As far as i can see the error is because the metadata repository defined in the RFC adapter cant find the function module that normally would be in the root of a RFC-XML. But I dont know how I can send an Idoc through the rfc adapter to the gateway then. Anyone got some ideas?
Thanks
Chris -
SAP - Lumira - ECC 6.0 - Source by java connector - timeout
Hi,
I try , to create a dataset for ERP 6.0 data by java connector ( SQL-Source).
After connection to ERP, I can select an ERP-infoset .
By selection of an infoset a SQL-Statement is created .
( select * from "Local"."INFOSET"."id of erp-infoset" )
After click "preview" and a long time I get " timeout....".
can anybody help me ?
Regards WolfgangHi,
I work with version 1.15.
Without where - condition, I get the data.
(select * from Z_SD_ADR)
But by where condition I see only the header line ( Field-names)
without data.
My select statement:
select * from Z_SD_ADR where 'KNVV-KUNNR' = '1000'
( I tried also with 6 leading-Zero).
The Query contains a join from KNVV to KNA1.
Regards Wolfgang
Maybe you are looking for
-
Attachments appearing as inline text
Certain attachments that I receive in Mail appear as inline text. This makes it impossible to save the attachment and open it in another program. The most aggravating is .cpp files. These contents of these attached files all appear as inline text, on
-
How can I retrieve photos when it says my cloud and iTunes backups are empty or not backed up? When I tried to update my iPhone 5s to iOS 8.1, I was forced to choose to restore or back up. Back up wasn't working so I had no choice but to restore. I
-
Regarding error message from a transaction
Hello all, I have a scenario where i need to collect all the error message from a trasaction and display it in a pop up. i am calling a function module and inturn calling transaction 'FB08' using bdc. i may get one or more error message.
-
FORM auth-method not working, it still gives a BASIC type pop-up box.
Hi All, I'm trying to secure a web application running on Web As 7. I created a login module stack and put it into web-j2ee-engine.xml along with the security role map... <login-module-configuration> <login-module-stack> <lo
-
Dynamic Table setup (Infobus)
Hi, I will first describe my environment application and then the problem. I want to create an Infobus GridControl, without using the designer. To setup the Rowsetinfo to which the GridControl will be bound, I perform a "select * from TABLE", using a