cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Check in code for mks integrity using java api

vk
1-Visitor
1-Visitor

Check in code for mks integrity using java api

Hi,

We need to develop check in option to connect to integrity using java API in our project.

What are the options I need to pass for check in?

Here is my code for options:

Command cmd = new Command(Command.SI,"ci");

cmd.addOption(new Option("sandbox",""));

cmd.addOption(new Option("cwd",""));

cmd.addSelection("");

I am getting the following error when i run the code: MKS125335: Out of tree members and subprojects (not located in the project directory or a subdirectory of the project directory) are not supported.

With these options and selection I am unable to connect.

Could you please suggest what options do I need to pass for doing checkin? And please let me know what was the error given above.

Your help is most required. Thanks in advance.

ACCEPTED SOLUTION

Accepted Solutions
KaelLizak
16-Pearl
(To:vk)

Hello Vasavi,

Check Out resynchronizes the member to the current member revision (by default, you can change this in the dialog), and locks the member.

Lock Member only locks the member.

Regards,
Kael

P.S. Please mark the answer as Correct Answer if it solved your issue.  It makes it clear to everyone what you considered to be the correct answer by posting it directly under your questions, and lets us know the issue is resolved.


Kind Regards,
Kael Lizak

Senior Technical Support Engineer
PTC Integrity Lifecycle Manager

View solution in original post

9 REPLIES 9
KaelLizak
16-Pearl
(To:vk)

Hello Vasavi,

I don't think the option cwd will indicate the curent working directory.  Have you tried explicitly passing the directory the sandbox is located in?

Regards,
Kael


Kind Regards,
Kael Lizak

Senior Technical Support Engineer
PTC Integrity Lifecycle Manager
vk
1-Visitor
1-Visitor
(To:KaelLizak)

Hi Kael,

Yes that option is available to perform checkin. And Its working now.

I need some information regarding the difference between locking the member in Integrity using check out and Lock option available from the Member menu.

Could you please differentiate these two?

Regards,

Vasavi

KaelLizak
16-Pearl
(To:vk)

Hello Vasavi,

Check Out resynchronizes the member to the current member revision (by default, you can change this in the dialog), and locks the member.

Lock Member only locks the member.

Regards,
Kael

P.S. Please mark the answer as Correct Answer if it solved your issue.  It makes it clear to everyone what you considered to be the correct answer by posting it directly under your questions, and lets us know the issue is resolved.


Kind Regards,
Kael Lizak

Senior Technical Support Engineer
PTC Integrity Lifecycle Manager
vk
1-Visitor
1-Visitor
(To:KaelLizak)

Hi Kael,

Thank you very much for your response.

It would be great if you can provide the solution for below.

I am facing problem in order to perform check in operation.

I tried to access MKS server by using this command: : si ci –g –sandbox=” sandbox_loc” through command prompt, which gives a page where I can enter the description and also can select the change package like when performing check in through Integrity client.

But If I pass the same options through Java Code I am getting the below error:

Below is the piece of code I have written and the error I am facing:

Please help me on this:

public void submit(final String cwd, final String sandboxLoc, final String selectedFile){

        System.out.println("Inside Submit method");

       

        Command submitChangesCmd = new Command(Command.SI, "ci");

        submitChangesCmd.addOption(new Option("sandbox", sandboxLoc));

        submitChangesCmd.addOption(new Option("cwd", cwd));

        submitChangesCmd.addOption(new Option("-g"));

        submitChangesCmd.addSelection(selectedFile);

        try {

            cr.execute(submitChangesCmd);

        } catch(APIException e) {

            System.out.println(e.getMessage());

            e.printStackTrace();

        }

       

    }

Error:

MKS124804: Internal error detected: Error was: mks.frame.exception.ApplicationError: An internal error has been detected.  The following information may be useful:

java.lang.NullPointerException

java.lang.NullPointerException

    at mks.ic.si.model.ProjectTypeSettings.getActiveChangePackages(ProjectTypeSettings.java:2434)

    at mks.ic.si.ui.swing.ChangePackageJPanel.getActiveChangePackages(ChangePackageJPanel.java:155)

    at mks.ic.si.ui.swing.ChangePackageJPanelBase.populateChangePackages(ChangePackageJPanelBase.java:395)

    at mks.ic.si.ui.swing.ChangePackageJPanel.populateChangePackages(ChangePackageJPanel.java:146)

    at mks.ic.si.ui.swing.SwingCheckInMembersSettingsJDialog.getSettings(SwingCheckInMembersSettingsJDialog.java:252)

    at mks.ic.si.ui.swing.SwingCheckInMembersSettingsJDialog.primeUI(SwingCheckInMembersSettingsJDialog.java:173)

    at mks.ic.si.ui.swing.SwingCheckInMembersSettingsJDialog.<init>(SwingCheckInMembersSettingsJDialog.java:125)

    at mks.ic.si.ui.swing.SwingCheckInMembersSettings.initializeAsk(SwingCheckInMembersSettings.java:63)

    at mks.frame.app.ui.swing.SwingPresenter$InitializeAskUserHandler.run(SwingPresenter.java:2466)

    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:241)

    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)

    at java.awt.EventQueue.access$200(EventQueue.java:103)

    at java.awt.EventQueue$3.run(EventQueue.java:694)

    at java.awt.EventQueue$3.run(EventQueue.java:692)

    at java.security.AccessController.doPrivileged(Native Method)

    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)

    at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)

    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)

    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)

    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)

    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)

    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)

    at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

PTC IntegrityCheck in code for mks integrity using java api

KaelLizak
16-Pearl
(To:vk)

Hello vasavi k‌,

It looks like Rahul Chandrashekar‌ and you are running into the same issue on different releases, since your stacktraces look very similar but not identical at the top.  In both of your cases, I don't have enough information available based on what has been supplied to make any suggestions, and recommend you both contact PTC Integrity Support to open a case to investigate these issues.  It might be helpful to refer the answering TSE to this thread as well.

Regards,
Kael


Kind Regards,
Kael Lizak

Senior Technical Support Engineer
PTC Integrity Lifecycle Manager

Hi Kael,

Thanks for your inputs, i am making use of - mksapi-jar-4.10.9049.jar.

Kindly let me know which version is most suitable for connecting to MKS integrity 2009

Kindly let me know if i have to change the version.

Regds

Rahul.

Hi Kael,

An another question, i see that the API requests me to provide me the following:-

createLocalIntegrationPoint(VersionNumber apiRequestVersion)

Kindly let me know what is apiRequestVersion

Also an another clarification:-

What is the project configPath?  -- is this the path in the MKS repository ?

What is the relativepath ?  -- is this the local sandbox path ?

because i found an another approach using the APISession instead of using CommandRunner.

Looking forward for your inputs 🙂

Regds

Rahul.

Hi Kael,

I am also facing the same issue and when i am about to do the check-in using the MKS API, i always get the MKS124804 error.

This is urgent and request for your suggestions.

Command submitChangesCmd = new Command(Command.SI, "ci");

      submitChangesCmd.addOption(new Option("-g"));

      submitChangesCmd.addOption(new Option("sandbox", "sandbox path"));

      submitChangesCmd.addOption(new Option("cwd", "current working directory filepath"));

      //      submitChangesCmd.addOption(new Option("changepackageid", "change package id"));

      submitChangesCmd.setSelectionList(fileList);

      try {

        cr.execute(submitChangesCmd);

      } catch(APIException e) {

        System.out.println("Exception" + e.getMessage());

        e.printStackTrace();

      }

ExceptionMKS124804: Internal error detected: Error was: mks.frame.exception.ApplicationError: An internal error has been detected.  The following information may be useful:

java.lang.NullPointerException

java.lang.NullPointerException

    at mks.ic.si.model.ProjectTypeSettings.getActiveChangePackages(ProjectTypeSettings.java:2419)

    at mks.ic.si.ui.swing.ChangePackageJPanel.getActiveChangePackages(ChangePackageJPanel.java:155)

    at mks.ic.si.ui.swing.ChangePackageJPanelBase.populateChangePackages(ChangePackageJPanelBase.java:395)

    at mks.ic.si.ui.swing.ChangePackageJPanel.populateChangePackages(ChangePackageJPanel.java:146)

    at mks.ic.si.ui.swing.SwingCheckInMembersSettingsJDialog.getSettings(SwingCheckInMembersSettingsJDialog.java:252)

    at mks.ic.si.ui.swing.SwingCheckInMembersSettingsJDialog.primeUI(SwingCheckInMembersSettingsJDialog.java:173)

    at mks.ic.si.ui.swing.SwingCheckInMembersSettingsJDialog.<init>(SwingCheckInMembersSettingsJDialog.java:125)

    at mks.ic.si.ui.swing.SwingCheckInMembersSettings.initializeAsk(SwingCheckInMembersSettings.java:63)

    at mks.frame.app.ui.swing.SwingPresenter$InitializeAskUserHandler.run(SwingPresenter.java:2362)

    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)

    at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)

    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)

    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)

    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)

    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)

    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)

    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

Regds
Rahul.

Hi All,

I found out a working solution 🙂

Thanks all for your support

Regds
Rahul.

Announcements


Top Tags