on 02-13-2009 5:58 AM
HI All,
I am working with webdynpro and MDM java API. I had added the respecive jars and now i want to test whether i am able to make a connection to the MDM server.
Please provide me the sample code.
Thanks,
Jyothi.
Hi,
I am using the below code given by you.
ConnectionPool simpleConnection;
RepositoryIdentifier repIdentifier;
String session;
String connection = "servername";
String repository = "repository";
DBMSType dbmsType = DBMSType.ORACLE;
try {
simpleConnection = ConnectionPoolFactory.getInstance(connection);
repIdentifier = new RepositoryIdentifier(repository, connection, dbmsType);
CreateServerSessionCommand createServerSessionCmd = new CreateServerSessionCommand(simpleConnection);
createServerSessionCmd.execute();
session = createServerSessionCmd.getSession();
AuthenticateServerSessionCommand auth= new AuthenticateServerSessionCommand(simpleConnection);
auth.setSession(session);
auth.setUserName("Admin");
auth.setUserPassword("****");
auth.execute();
session = auth.getSession();
} catch (ConnectionException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (CommandException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
I am getting the error java.lang.NoClassDefFoundError: com/sap/mdm/commands/CommandException
Kindly suggest.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I have added all the jars
and the imports i am using are
import com.sap.mdm.commands.AuthenticateServerSessionCommand;
import com.sap.mdm.commands.CommandException;
import com.sap.mdm.commands.CreateServerSessionCommand;
import com.sap.mdm.net.ConnectionException;
import com.sap.mdm.net.ConnectionPool;
import com.sap.mdm.net.ConnectionPoolFactory;
import com.sap.mdm.server.DBMSType;
import com.sap.mdm.server.RepositoryIdentifier;
Thanks,
Jyothi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I had added the jar files and build the project.
And for the mdm and jar file the version and patch are same but hot fix is different. Does that matter?
Edited by: jyothi beera on Feb 13, 2009 10:17 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jitesh,
I am getting the below error when i use the code
java.lang.NoClassDefFoundError: com/sap/mdm/commands/CommandException
My MDM version is 5.5.62.33 and the jar file version is 5.5.62.63. is that the problem?
Kindly suggest.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I have used the above code by jitesh and i am getting the below error when i deploy my application.
I have added the jars
mdm-admin
mdm-common
mdm-core
mdm-date
mdm-extension
mdm-protocol.
java.lang.NoClassDefFoundError: com/sap/mdm/commands/CommandException
Is it because of version problem or is there some thing else i am missing.
Kindly suggest.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jyothi,
You need to copy the jar files in the lib folder of your webdynpro project.
Archive repository create .a2a file and you can move that file to any other MDM Server and UnArchive it. It is a transport mechanism to move the MDM repository from one server to another.
No need to print the output. If the execution of program is successful then you will get a file created in the folowing path
{MDM Installable directory|/Server/Archives
e.g.
C:\Program Files\SAP MDM\Server\Archives
Regards,
Jitesh Talreja
Hi Jitesh,
Can u tel me what is this archive repositorycommand and what is it's use
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jitesh,
Thanks for the code.
And can you tell me something i can print from the above code to know that the connection to the repository is working.
Thanks,
jyothi
Edited by: jyothi beera on Feb 13, 2009 9:21 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I just has used the below code just for testing. But it is giving me the error "No class def found error". Can you suggest me.
SimpleConnection connection=null;
String host="server:port";
try {
connection=SimpleConnectionFactory.getInstance(host);
} catch (ConnectionException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
wdComponentAPI.getMessageManager().reportSuccess("connection is"+connection);
connection.close();
Thanks,
Prasanthi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jyothi,
Check the below sample code for Archieving the repository
public class TestArchiveRepository
{
public static ConnectionPool simpleConnection;
public static RepositoryIdentifier repIdentifier;
public static String session;
public static String connection = "TEST";
public static String repository = "REPO_TEST";
public static DBMSType dbmsType = DBMSType.MS_SQL;
public static void main(String[] args)throws CommandException, ConnectionException
{
simpleConnection = ConnectionPoolFactory.getInstance(connection);
repIdentifier = new RepositoryIdentifier(repository, connection, dbmsType);
CreateServerSessionCommand createServerSessionCmd = new CreateServerSessionCommand(simpleConnection);
createServerSessionCmd.execute();
session = createServerSessionCmd.getSession();
AuthenticateServerSessionCommand auth= new AuthenticateServerSessionCommand(simpleConnection);
auth.setSession(session);
auth.setUserName("Admin");
auth.setUserPassword("Pass123");
auth.execute();
session = auth.getSession();
ArchiveRepositoryCommand archiveRepCmd = new ArchiveRepositoryCommand(simpleConnection);
archiveRepCmd.setArchiveFileName("REPO_TEST_ARC");
archiveRepCmd.setRepositoryIdentifier(repIdentifier);
archiveRepCmd.setSession(session);
archiveRepCmd.execute();
}
}
Regards,
Jitesh Talreja
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
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.