Quantcast
Channel: SCN : Popular Discussions - Java Development
Viewing all 518 articles
Browse latest View live

Calling RFC from Java Program?

$
0
0

Hello Experts,

 

I'm trying to call a simple RFC from ERP backend in my java program. I did all the setup in my local eclipse tool and able to run sample programs provided by SAP (i.e StepByStepClient.java & StepByStepServer.java) and got familiar a little bit on how it works.

 

I'm having bit trouble in understanding JCo API and coding it appropriately. Would anyone please provide me the code for my requirement.

 

This is my RFC:

 

RFC Name: Z_ASTU_GET_SUBSCRIPTIONS

Export Parameters:

Parameter Name: ELIGIBLE_LIST

Typing: TYPE

Associated Type: ZSU_EXISTING_SUBSCRIPTIONS (Table Type)

Line type: ZSSU_EXISTINGSUBSCRIPTIONS

Structure: ZSSU_EXISTSUBS; again it has some 50 fields.

Tables:

BLANK

 

How do I read/iterate this RFC into my java code? Please help with some code snippet on iterating or looping through this Export parameters.

 

This is what I tried but No Luck.

 

 

System.out.println(" List Details: " + function.getExportParameterList().getListMetaData().); 

OUTPUT:  

ELIGIBLE_LIST,ZSU_EXISTING_SUBSCRIPTIONS,h,0,0,290,574,0, ,Existing Subscriptions Table Type,EXPORT,OPTIONAL

JCoTable exportTable1 = function.getTableParameterList().getTable("ELIGIBLE_LIST");

OUTPUT: NullPointerException. I suspect such as this might not be a tabletype or incompatiable type.

System.out.println("Export Table1 " + exportTable1.getMetaData() + ":\n"); 

JCoStructure exportStructure = function.getExportParameterList().getStructure("ZSU_EXISTING_SUBSCRIPTIONS");

OUTPUT: Cannot convert Table type to Structure Record. I suspect such as this also related to incompatiable types. 

System.out.println("System info for " + exportStructure.getMetaData().getFieldCount() + ":\n"); 

 

Check attached screenshot of RFC. When I double click on ZSU_EXISTING_SUBSCRIPTIONS, It is opening a Dictionary screen with some info. Particularly a tab called "Line Type" is having "ZSSU_EXISTSUBS", when I double clik on it, then it is displaying a Structure screen with some fields info.

Thanks

VB


When will SAP Java AS for EE 6 see the light?

$
0
0

Hi all,

As far as I know, SAP's bleeding edge AS (NW73 AS) is based on EE5.

As several java AS vendors are releasing EE6 compliant products, I would like to know whether any deadline has been set for SAP's EE6 app server release.

 

Thanks in advance

regards

 

Vincenzo

LDAP acces via SSL - javax.net.ssl.SSLHandshakeException

$
0
0

Hello All

 

I'm trying to fing reason for non-working SSL connection from java app (EJB) to LDAP server.

 

Code is:

 

env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
System.setProperty("ssl.ServerSocketFactory.provider","oracle.security.ssl.OracleSSLServerSocketFactoryimpl");
env.put(Context.PROVIDER_URL, urlLdapServer + baseDN);
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL, "user");
env.put(Context.SECURITY_CREDENTIALS, "password");

 

And while trying to connect exception is thrown:

 

Exception while getting data from LDAP:

javax.naming.CommunicationException: simple bind failed: server_address:636 [Root exception is javax.net.ssl.SSLHandshakeException:

sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException:

unable to find valid certification path to requested target]

 

In portal's configuration there is key storage named TrustedCAs containing valid certificate for this LDAP server.

 

I'm bit stuck, so any help would be highly appreciated.

 

Thanks in advance

Best Regards

Maciej Gottfried

Sap System is very slow.

$
0
0

Hi,

 

We are using IDES system on windows NT and sql server as database.

 

But the system is very slow ....

 

I increased the dialog processes from 7 to 12 but there is no use.

 

Also tried st02 and saw some red alerts so increased the coressponding profile parameters.

 

Still The system is slow.

 

 

Please suggest your ideas.

 

 

Thanks,

Sagar.

DYNPRO_SEND_IN_BACKGROUND

$
0
0

Hi All,

 

I am executing a JCO Program which triggers a RFC using JCO's <b>execute(String functionName)</b> method.

 

RFC inturn calls an SAP interface which process the goods issue files.

 

After processing few files i get a connection closed error.

 

In seeing in Transaction ST22 the error was DYNPRO_SEND_IN_BACKGROUND

 

When executed in SAP GUI the error never comes and also when the abapDebug is set to true

 

and its strange that its coming after processing some few files.

 

Any Idea

 

Thomas

When will SAP Java AS for EE 6 see the light?

$
0
0

Hi all,

As far as I know, SAP's bleeding edge AS (NW73 AS) is based on EE5.

As several java AS vendors are releasing EE6 compliant products, I would like to know whether any deadline has been set for SAP's EE6 app server release.

 

Thanks in advance

regards

 

Vincenzo

How to call a (selfmade) Java REST Webservice in Netweaver? What's the URL?

$
0
0

Dear experts,

 

currently I'm trying out REST webservices in the Netweaver environment. I tried some how-to-start-manuals and built my first REST Webservice as an EJB with EAR project.

 

For testing the webservice I used a simple Client class with console output. Unfortunately it always says

"GET http://...~lib~ws~rest/rest/testMessage returned a response status of 404 Not Found".

 

I wanted to call the REST URL in the Browser as well, but I also got the 404 error.

For the URL "http://...~lib~ws~rest/" I get a 403 "Forbidden" error. For me this means the URL for my EAR ist correct, but forbidden to show. But if it is correct, why don't the REST-URLs work?

 

Here is the code for my Webservice (project name "lib/ws/rest", resp. "lib/ws/rest/ear"):

 

package testWebservice;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
@Path("/testMessage")
public class TestWebserviceRest {    @GET    @Produces(MediaType.TEXT_PLAIN)    public String messageText() {        return "Yea! It's working!";    }    @GET    @Produces(MediaType.TEXT_HTML)    public String messageHtml() {        return "<html> " + "<title>" + "testMessage" + "</title>"             + "<body><h1>" + "Yea! It's working!"            + "</body></h1>" + "</html> ";    }
}

 

 

Here is the code for my testclass to run locally:

 

package testWebservice.rest.client; 
import java.net.URI;  
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.UriBuilder;
import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.WebResource;
import com.sun.jersey.api.client.config.ClientConfig;
import com.sun.jersey.api.client.config.DefaultClientConfig;
public class RestTestClient {           public static void main(String[] args) {                  ClientConfig config = new DefaultClientConfig();        Client client = Client.create(config);        WebResource service = client.resource(getBaseURI());                // Fluent interfaces        System.out.println(service.path("rest").path("testMessage").accept(MediaType.TEXT_PLAIN).get(ClientResponse.class).toString());        // Get plain text        System.out.println(service.path("rest").path("testMessage").accept(MediaType.TEXT_PLAIN).get(String.class));        // The HTML        System.out.println(service.path("rest").path("testMessage").accept(MediaType.TEXT_HTML).get(String.class));      }      private static URI getBaseURI() {        return UriBuilder.fromUri("http://...lib~ws~rest").build();      }   
}

 

Is the URL wrong?

How to "build" the right URl for a REST webservice in Netweaver?

Or is there another problem I didn't find?

 

I appreciate every hint and hope your your support.

 

Thank you

Jana

JCO without setting timeout parameter

$
0
0


We met a question that PeripheralSystems access SAP application server through RFC calls and JCO controls the timeout threshold by parameters jco.session_timeout and jco.session_timeout.check_interval. If the call exceeds the timeout threshold and is monitored by JCO, the JCO.execute

will end the function module and the transaction will rollback. Now we want PeripheralSystems to control the timeout issue itself. It means that the function modules called by RFC client will be ended by PeripheralSystems, not JCO. How can we implement this? Thank you for your answers.


convert .txt file to .pdf using java code

$
0
0

Hi,

 

My requirement is to read the .txt file and convert it into .pdf file after changing certain text.

Searched the net got a document on iText ..is it the only way for conversion or any other method....please help.

 

Thanks in advance.

 

Pooja

Sap System is very slow.

$
0
0

Hi,

 

We are using IDES system on windows NT and sql server as database.

 

But the system is very slow ....

 

I increased the dialog processes from 7 to 12 but there is no use.

 

Also tried st02 and saw some red alerts so increased the coressponding profile parameters.

 

Still The system is slow.

 

 

Please suggest your ideas.

 

 

Thanks,

Sagar.

sapjco3.dll (32bit VS 64bit)

$
0
0

Hi All,

 

I using sapjco3.dll on 64bit Windows 2008 system for JCO Connector.

i am getting the below error

java.lang.UnsatisfiedLinkError: C:\Windows\System32\sapjco3.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform

 

Could any once please suggest how can i fix this issue with 64bit system.

If need to download sapjco3.dll compatible to 64bit system where can download?

 

Regards,

Narayana.

LDAP acces via SSL - javax.net.ssl.SSLHandshakeException

$
0
0

Hello All

 

I'm trying to fing reason for non-working SSL connection from java app (EJB) to LDAP server.

 

Code is:

 

env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
System.setProperty("ssl.ServerSocketFactory.provider","oracle.security.ssl.OracleSSLServerSocketFactoryimpl");
env.put(Context.PROVIDER_URL, urlLdapServer + baseDN);
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL, "user");
env.put(Context.SECURITY_CREDENTIALS, "password");

 

And while trying to connect exception is thrown:

 

Exception while getting data from LDAP:

javax.naming.CommunicationException: simple bind failed: server_address:636 [Root exception is javax.net.ssl.SSLHandshakeException:

sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException:

unable to find valid certification path to requested target]

 

In portal's configuration there is key storage named TrustedCAs containing valid certificate for this LDAP server.

 

I'm bit stuck, so any help would be highly appreciated.

 

Thanks in advance

Best Regards

Maciej Gottfried

Could not initialize dynamic link library sapjcorfc

$
0
0

We are tryibg to use Sap Jco under J2EE Tomcat application running on

AIX 5.3 64 bit, with JRe 1.4.2.

We are reciving this error :

 

HTTP Status 500 -

-


Type Exception report message

description The server encountered an internal error () that prevented

it from fulfilling this request.

 

Exception

 

javax.servlet.ServletException: #{pc_Index.doButton1Action}:

javax.faces.el.EvaluationException:

java.lang.ExceptionInInitializerError: JCO.classInitialize(): Could not

load middleware layer 'com.sap.mw.jco.rfc.MiddlewareRFC'

JCO.nativeInit(): Could not initialize dynamic link library sapjcorfc

[/opt/sapjco/libsapjcorfc.so: load ENOEXEC on shared library

(s) /opt/sapjco/libsapjcorfc.so]. java.library.path

[/usr/java14/jre/bin:/usr/java14/jre/bin/classic:/usr/java14/jre/bin:/opt/sapjco:.:/usr/lib]

javax.faces.webapp.FacesServlet.service(FacesServlet.java:209)

 

root cause

 

javax.faces.FacesException: #{pc_Index.doButton1Action}:

javax.faces.el.EvaluationException:

java.lang.ExceptionInInitializerError: JCO.classInitialize(): Could not

load middleware layer 'com.sap.mw.jco.rfc.MiddlewareRFC'

JCO.nativeInit(): Could not initialize dynamic link library sapjcorfc

[/opt/sapjco/libsapjcorfc.so: load ENOEXEC on shared library

(s) /opt/sapjco/libsapjcorfc.so]. java.library.path

[/usr/java14/jre/bin:/usr/java14/jre/bin/classic:/usr/java14/jre/bin:/opt/sapjco:.:/usr/lib]

com.sun.faces.application.ActionListenerImpl.processAction

(ActionListenerImpl.java:78)

javax.faces.component.UICommand.broadcast(UICommand.java:312)

javax.faces.component.UIViewRoot.broadcastEvents

(UIViewRoot.java:267)

javax.faces.component.UIViewRoot.processApplication

(UIViewRoot.java:381)

com.sun.faces.lifecycle.InvokeApplicationPhase.execute

(InvokeApplicationPhase.java:75)

com.sun.faces.lifecycle.LifecycleImpl.phase

(LifecycleImpl.java:200)

com.sun.faces.lifecycle.LifecycleImpl.execute

(LifecycleImpl.java:90)

javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)

 

Any suggestion ?

 

thansk in advance

convert .txt file to .pdf using java code

$
0
0

Hi,

 

My requirement is to read the .txt file and convert it into .pdf file after changing certain text.

Searched the net got a document on iText ..is it the only way for conversion or any other method....please help.

 

Thanks in advance.

 

Pooja

DYNPRO_SEND_IN_BACKGROUND

$
0
0

Hi All,

 

I am executing a JCO Program which triggers a RFC using JCO's <b>execute(String functionName)</b> method.

 

RFC inturn calls an SAP interface which process the goods issue files.

 

After processing few files i get a connection closed error.

 

In seeing in Transaction ST22 the error was DYNPRO_SEND_IN_BACKGROUND

 

When executed in SAP GUI the error never comes and also when the abapDebug is set to true

 

and its strange that its coming after processing some few files.

 

Any Idea

 

Thomas


LDAP acces via SSL - javax.net.ssl.SSLHandshakeException

$
0
0

Hello All

 

I'm trying to fing reason for non-working SSL connection from java app (EJB) to LDAP server.

 

Code is:

 

env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
System.setProperty("ssl.ServerSocketFactory.provider","oracle.security.ssl.OracleSSLServerSocketFactoryimpl");
env.put(Context.PROVIDER_URL, urlLdapServer + baseDN);
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL, "user");
env.put(Context.SECURITY_CREDENTIALS, "password");

 

And while trying to connect exception is thrown:

 

Exception while getting data from LDAP:

javax.naming.CommunicationException: simple bind failed: server_address:636 [Root exception is javax.net.ssl.SSLHandshakeException:

sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException:

unable to find valid certification path to requested target]

 

In portal's configuration there is key storage named TrustedCAs containing valid certificate for this LDAP server.

 

I'm bit stuck, so any help would be highly appreciated.

 

Thanks in advance

Best Regards

Maciej Gottfried

SAP NetWeaver Compostion Environment 7.3 trial version download

$
0
0

Hi

When I try to download the SAP NetWeaver Composition Environment 7.3 trial version download

 

located at SAP_NW_CE_7.3_TRIAL_VERSION_abstract

 

I get an error stating that the web page is not available.

 

Is this download still supposed to be available?

 

Thanks,

Daniel

LDAP acces via SSL - javax.net.ssl.SSLHandshakeException

$
0
0

Hello All

 

I'm trying to fing reason for non-working SSL connection from java app (EJB) to LDAP server.

 

Code is:

 

env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
System.setProperty("ssl.ServerSocketFactory.provider","oracle.security.ssl.OracleSSLServerSocketFactoryimpl");
env.put(Context.PROVIDER_URL, urlLdapServer + baseDN);
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL, "user");
env.put(Context.SECURITY_CREDENTIALS, "password");

 

And while trying to connect exception is thrown:

 

Exception while getting data from LDAP:

javax.naming.CommunicationException: simple bind failed: server_address:636 [Root exception is javax.net.ssl.SSLHandshakeException:

sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException:

unable to find valid certification path to requested target]

 

In portal's configuration there is key storage named TrustedCAs containing valid certificate for this LDAP server.

 

I'm bit stuck, so any help would be highly appreciated.

 

Thanks in advance

Best Regards

Maciej Gottfried

Options in RFC_READ_TABLE

$
0
0

Hi all,

 

In RFC_TABLE_READ as I can put in an option like? when the field type like * XXXX *.

 

It's more if someone could tell which are the operators that exist in the where clause.

 

Thank you very much

sapjco3.dll (32bit VS 64bit)

$
0
0

Hi All,

 

I using sapjco3.dll on 64bit Windows 2008 system for JCO Connector.

i am getting the below error

java.lang.UnsatisfiedLinkError: C:\Windows\System32\sapjco3.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform

 

Could any once please suggest how can i fix this issue with 64bit system.

If need to download sapjco3.dll compatible to 64bit system where can download?

 

Regards,

Narayana.

Viewing all 518 articles
Browse latest View live


Latest Images