Skip to Content
avatar image
Former Member

i have some problem with a BO connection from java WS

Hi expert,

I have some problem to make a connection to a BO.

this is my code:

import java.net.MalformedURLException;
import java.net.URL;

import javax.ejb.Stateless;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;

import org.apache.axis2.AxisFault;

import com.businessobjects.dsws.Connection;
import com.businessobjects.dsws.session.EnterpriseCredential;
import com.businessobjects.dsws.session.Session;
import com.businessobjects.dsws.session.SessionInfo;




/**
 * Session Bean implementation class bu_bi
 */
@WebService(name="bu_bi", portName="bu_biPort", serviceName="bu_bi", targetNamespace="http://com.ferrero/bu_bi/")
@Stateless
public class bu_bi {

    /**
     * Default constructor. 
     */
    public bu_bi() {
        // TODO Auto-generated constructor stub
    }

    
    @WebMethod(operationName="getEntity", exclude=false)
	public @WebResult(name = "Risultato") String getEntity(@WebParam(name="System") String System) throws MalformedURLException, AxisFault {
    	String result = "";
    	
    	String providerURL = "http://"+System+".gig.com/dswsbobje/services";
        
        // Create the URL for the Session Service and instantiate a new
        // Session Service
//            String providerURL = "http://localhost:8080/dswsbobje/services";
        
        URL sessConnURL = new URL(providerURL + "/session");
        Connection boConnection = new Connection(sessConnURL);
        Session boSession = new Session(boConnection);
              
        // Setup the Enterprise Credentials used to log in to the Enterprise System
        //
        // cmsname - the name of the Enterprise Central Management System (CMS)
        // username - the Enterprise user's user name
        // password - the password for the Enterprise user
        // authType - the authentication to use; can be one of the following:
//                           - secEnterprise: Enterprise authentication
//                           - secLDAP: LDAP authentication
//                           - secWinAD: Windows AD authentication
        
              String cmsname = "andre";
        String username = "andre";
        String password = "prova";
        String authType = "secWinAD";

   //         EnterpriseCredential boEnterpriseCredential = new EnterpriseCredential();
        EnterpriseCredential boEnterpriseCredential = EnterpriseCredential.Factory.newInstance();
        boEnterpriseCredential.setDomain(cmsname);
        boEnterpriseCredential.setLogin(username);
        boEnterpriseCredential.setPassword(password);
        boEnterpriseCredential.setAuthType(authType);

        // Log in to the Enterprise System and retrieve the SessionInfo
        SessionInfo boSessionInfo = boSession.login(boEnterpriseCredential);

        result = boSessionInfo.getSessionID();
//            boConnection.setURL(new URL(sessConnURL + "biplatform"));
//            String[] biPlatformURL = boSession.getAssociatedServicesURL("BIPlatform");
//            BIPlatform boBIPlatform = BIPlatform.getInstance(boSession,biPlatformURL[0]);
        // Logout
        boSession.logout();

    	return result;
    }
    
 

}

I create one developonent software and 4 development component (1 EJB for the code above and 1 ear to deploy, another one for the library and 1 for the ear to deploy the library). I follow the guide: How to reference external JAR files to web Dynpro DC in sap NW Portal 7.3 to create the reference and dependecy in the devlopment infrastructure but when try to deploy the EJB i get this error:

Edited by: Team BPM Italy on Jan 12, 2012 2:42 PM

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Jan 12, 2012 at 01:45 PM

    Description:

    1. Exception has been returned while the [ita18.ferrero.com/fce_ita18_bu_bi_ear] was starting. Warning/Exception :[

    ][ASJ.dpl_ds.006153 Error occurred while starting application [ita18.ferrero.com/fce_ita18_bu_bi_ear]: It is not started successfully on server nodes [3071150]. In order to bring the server in consistent state stop operation will be performed.

    Error occurred on server 3071150 during startApp of ita18.ferrero.com/fce_ita18_bu_bi_ear : com/businessobjects/dsws/session/Credential

    -> com.businessobjects.dsws.session.Credential

    -


    Loader Info -


    ClassLoader name: [ita18.ferrero.com/fce_ita18_bu_bi_ear]

    Loader hash code: 143b780

    Living status: unregistered

    Direct parent loaders:

    [system:Frame]

    [interface:webservices]

    [interface:cross]

    [interface:security]

    [interface:transactionext]

    [library:webservices_lib]

    [library:opensql]

    [library:jms]

    [library:ejb20]

    [service:p4]

    [service:ejb]

    [service:servlet_jsp]

    -


    Error occurred on server 3071150 during startApp of ita18.ferrero.com/fce_ita18_bu_bi_ear : com.sap.engine.services.deploy.exceptions.ServerDeploymentException: Exception during initial start of application

    [ita18.ferrero.com/fce_ita18_bu_bi_ear] in container [webservices_container].

    at com.sap.engine.services.deploy.server.application.StartInitiallyTransaction.makeStartInitially(StartInitiallyTransaction.java:272)

    at com.sap.engine.services.deploy.server.application.StartInitiallyTransaction.prepare(StartInitiallyTransaction.java:198)

    at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhasesOnOneServer(ApplicationTransaction.java:706)

    at com.sap.engine.services.deploy.server.application.StartTransaction.doStartInitiallyGlobal(StartTransaction.java:546)

    at com.sap.engine.services.deploy.server.application.StartTransaction.doStartInitially(StartTransaction.java:536)

    at com.sap.engine.services.deploy.server.application.StartTransaction.prepareCommon(StartTransaction.java:247)

    at com.sap.engine.services.deploy.server.application.StartTransaction.prepare(StartTransaction.java:233)

    at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhasesOnOneServer(ApplicationTransaction.java:706)

    .......

    other exception error

    .......

    Caused by: java.lang.NoClassDefFoundError: com/businessobjects/dsws/session/Credential

    .......

    other exception error

    .......

    com.sap.engine.services.deploy.server.application.StartInitiallyTransaction.makeStartInitially(StartInitiallyTransaction.java:251)

    ... 36 more

    Caused by: java.lang.ClassNotFoundException: com.businessobjects.dsws.session.Credential

    -


    Loader Info -


    ClassLoader name: [ita18.ferrero.com/fce_ita18_bu_bi_ear]

    Loader hash code: 143b780

    Living status: unregistered

    Direct parent loaders:

    [system:Frame]

    [interface:webservices]

    [interface:cross]

    [interface:security]

    [interface:transactionext]

    [library:webservices_lib]

    [library:opensql]

    [library:jms]

    [library:ejb20]

    [service:p4]

    [service:ejb]

    [service:servlet_jsp]

    -


    at com.sap.engine.boot.loader.MultiParentClassLoader.loadClass(MultiParentClassLoader.java:272)

    at com.sap.engine.boot.loader.MultiParentClassLoader.loadClass(MultiParentClassLoader.java:241)

    ... 49 more

    ]

    Result

    Status:Warning

    How can i resolve this problem??

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 13, 2012 at 11:04 AM

    I follow this tutorial to create the external library:

    [Tutorial|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/9517]

    and this one for the library:

    [Tutorial for java library|http://wiki.sdn.sap.com/wiki/display/BOBJ/WebServicese-BookChapter2-InstallationandConfiguration]

    and now i have this error:

    [javac] Compiling 1 source file to C:\Users\BERNAANDR1\Documents\Programmi\Developer Studio SP05\Workspace sp05.jdi\LocalDevelopment\t\222A5BE912E4A599F8FF5174649E56A5\classes
         [javac] ERROR: C:\Users\BERNAANDR1\Documents\Programmi\Developer Studio SP05\Workspace sp05.jdi\LocalDevelopment\BUD_SERVICES\ita18.ferrero.com\fce_ita18_bu_bi\_comp\ejbModule\ferrero\com\bu_bi\bu_bi.java:71: cannot access org.apache.xmlbeans.XmlObject
         [javac] ERROR: class file for org.apache.xmlbeans.XmlObject not found
         [javac] ERROR: 		        EnterpriseCredential boEnterpriseCredential = EnterpriseCredential.Factory.newInstance();
         [javac] ERROR: 		                                                                          ^
         [javac] 1 error
    Error: C:\Users\BERNAANDR1\Documents\Programmi\Developer Studio SP05\Workspace sp05.jdi\LocalDevelopment\t2\222A5BE912E4A599F8FF5174649E56A5\default\logs\build.xml:100: Compile failed; see the compiler error output for details.
    	at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:933)
    	at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:757)
    	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
    	at org.apache.tools.ant.Task.perform(Task.java:364)
    	at org.apache.tools.ant.Target.execute(Target.java:341)
    	at org.apache.tools.ant.Target.performTasks(Target.java:369)
    	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
    	at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
    	at com.sap.tc.buildplugin.techdev.ant.util.AntRunner.run(AntRunner.java:114)
    	at com.sap.tc.buildplugin.DefaultAntBuildAction.execute(DefaultAntBuildAction.java:57)
    	at com.sap.tc.buildplugin.DefaultPlugin.handleBuildStepSequence(DefaultPlugin.java:195)
    	at com.sap.tc.buildplugin.DefaultPlugin.performBuild(DefaultPlugin.java:167)
    	at com.sap.tc.buildplugin.DefaultPluginV3Delegate$BuildRequestHandler.handle(DefaultPluginV3Delegate.java:66)
    	at com.sap.tc.buildplugin.DefaultPluginV3Delegate.requestV3(DefaultPluginV3Delegate.java:48)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:597)
    	at com.sap.tc.buildtool.v2.impl.PluginHandler2.maybeInvoke(PluginHandler2.java:403)
    	at com.sap.tc.buildtool.v2.impl.PluginHandler2.request(PluginHandler2.java:149)
    	at com.sap.tc.buildtool.v2.impl.PluginHandler2.build(PluginHandler2.java:87)
    	at com.sap.tc.buildtool.PluginHandler2Wrapper.execute(PluginHandler2Wrapper.java:59)
    	at com.sap.tc.devconf.internal.DCProxyMake.make(DCProxyMake.java:318)
    	at com.sap.tc.devconf.internal.DCProxy.make(DCProxy.java:1432)
    	at com.sap.tc.devconf.internal.DCProxy.make(DCProxy.java:3875)
    	at com.sap.ide.dii05.lib.internal.commands.dc.BuildJob.build(BuildJob.java:370)
    	at com.sap.ide.dii05.lib.internal.commands.dc.BuildJob.doInWorkerThread(BuildJob.java:181)
    	at com.sap.ide.dii05.util.api.job.JdiJob$1.doInWorkerThread(JdiJob.java:77)
    	at com.sap.ide.dii05.util.internal.job.InternalJdiJob$3$1.run(InternalJdiJob.java:199)
    	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1800)
    	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1782)
    	at com.sap.ide.dii05.util.internal.job.InternalJdiJob$3.run(InternalJdiJob.java:208)
    	at com.sap.ide.dii05.util.internal.job.BusyBackgroundIndicator.showWhile(BusyBackgroundIndicator.java:74)
    	at com.sap.ide.dii05.util.internal.job.InternalJdiJob.internalRun(InternalJdiJob.java:189)
    	at com.sap.ide.dii05.util.internal.job.InternalDiiJob.runInternal(InternalDiiJob.java:306)
    	at com.sap.ide.dii05.util.internal.job.InternalDiiJob.runR(InternalDiiJob.java:204)
    	at com.sap.ide.dii05.util.internal.job.InternalDiiJob.run(InternalDiiJob.java:192)
    	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

    the error seem to be in this line of code:

    EnterpriseCredential boEnterpriseCredential = EnterpriseCredential.Factory.newInstance();

    i have change this line from the java sample that i have found on internet

    (the original code is that: EnterpriseCredential boEnterpriseCredential = new EnterpriseCredential();)

    because if i use the original code i get this error:

    Cannot instantiate the type EnterpriseCredential

    Someone have any idea how to resolve this problem?

    thank you

    Add comment
    10|10000 characters needed characters exceeded