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

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

NullPointer Exception when getting current session

abasRyan
10-Marble

NullPointer Exception when getting current session

Hello, I have been demoing the otk java examples and decided to create my own project.
My custom action listener class is working fine within the otkexamples project.

Now that I created my own project, I am having issues in my main class. I practically copied and pasted the structure of otkExamplesmain.java but removed all the example methods.

The exception is throwing when trying to get the current session on launch when setting up the ribbon commands. I must have missed something when setting up my project but cannot figure out what that is.

Exception caught: java.lang.NullPointerException
com.ptc.cipjava.CIPRemoteApp.getTransport(CIPRemoteApp.java:40)

 private void SetupRibbonCommands()
{
try
{
System.out.println("Get Session");
session = pfcSession.GetCurrentSession();
wSession = (WSession)session;

wSession.RibbonDefinitionfileLoad(ribbonFile);

//startCreoson();
addAbasCommands();

}
ACCEPTED SOLUTION

Accepted Solutions

After playing around, and comparing the contents of each jar, there was something off in my artifacts settings. I noticed it was packaging the external otk libraries in with the jar, I'm not sure why. It's runnning correctly now that the otk library is not packaged in the jar. I'm not sure what the main issues were in intellij and if someone could comment on that it would be great.


Library settings.
Artifact settings
etc

View solution in original post

2 REPLIES 2

After playing around, and comparing the contents of each jar, there was something off in my artifacts settings. I noticed it was packaging the external otk libraries in with the jar, I'm not sure why. It's runnning correctly now that the otk library is not packaged in the jar. I'm not sure what the main issues were in intellij and if someone could comment on that it would be great.


Library settings.
Artifact settings
etc

sjuraj
15-Moonstone
(To:abasRyan)

session = pfcGlobal.GetProESession();

Announcements


Top Tags