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

We are happy to announce the new Windchill Customization board! Learn more.

What is the best way to call a custom java class methods present in windchill codebase from outside Windchill Application

akattasubramany
1-Newbie

What is the best way to call a custom java class methods present in windchill codebase from outside Windchill Application

Hi,

Can anyone please let me know what are the different ways to call a custom javaclass methods outside windchill application.

Thanks in advance.

Regards,

Archana.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi Shreyas,

Thanks for ur info. It is working fine

View solution in original post

7 REPLIES 7

You can use RMI, Web Services to call any class. please refer below article for more details.


https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS118892&art_lang=en&posno=2&q=info%20engine%20client&source=search


Hope it helps !!!


Thanks

Shreyas

Hi Shreyas,

Thanks for ur information.

I am currently working on that and if I needed any help I will let u know. Thank u so much

Regards,

Archana

Hi ,


I have went through the link provided by u . But I couldnt call a custom java class from a jsp of an external application using RMI but strangly i am able to call by using a standalone java program in the same external application. Can u please let me know do I need to include anything to be able to call from jsp.


I have even tried by infoengine. In infoengine , first i am trying to call IE tasks in browser and i ended up with an exception as below. Please help me out on this.


<?xml version="1.0" encoding="UTF-8" ?>

- <wc:COLLECTION xmlns:wc="http://www.ptc.com/infoengine/1.0">

- <exception NAME="exception" TYPE="Exception" STATUS="-1">

<wc:MESSAGE>(wt.introspection.introspectionResource/9) wt.introspection.InfoNotFoundException: Class not registered in modelRegistry.properties: java.lang.String. Nested exception is: wt.introspection.InfoNotFoundException: Class not registered in modelRegistry.properties: java.lang.String. Nested exception is: wt.util.WTException: (wt.introspection.introspectionResource/9) wt.introspection.InfoNotFoundException: Class not registered in modelRegistry.properties: java.lang.String. Nested exception is: wt.introspection.InfoNotFoundException: Class not registered in modelRegistry.properties: java.lang.String.</wc:MESSAGE>

- <wc:INSTANCE>

<hierarchy>com.infoengine.util.IEException</hierarchy>

<hierarchy>javax.servlet.jsp.JspException</hierarchy>

<hierarchy>java.lang.Exception</hierarchy>

<hierarchy>java.lang.Throwable</hierarchy>

<hierarchy>java.lang.Object</hierarchy>

</wc:INSTANCE>

</exception>

</wc:COLLECTION>



Regards,

Archana

Hi Shreyas,

Thanks for ur info. It is working fine

jessh
5-Regular Member
(To:akattasubramany)

Well, it really depends on where you want to call it.

If it's to be run locally with file system visibility to the codebase (and possibly WT_HOME/lib as well, as some classes depend on jars therein, not just jars in WEB-INF/lib), then you can just put WT_HOME/codebase, WT_HOME/codebase/WEB-INF/lib/*, and WT_HOME/lib in your classpath and go.

If it's to be run remotely, then you can use a URL classloader with URLs to Windchill's server codebase and codebase/lib/*, but if this loads any substantive number of classes there will be a performance penalty for loading the classes on demand on each startup of your remote application.  If that is problematic, then at that point you need to look into using Java Web Start or the Windchill bootstrap classloader to download and cache jars, updating them only when they change on the server.

What you should not do is copy Windchill server classes and/or jars somewhere else and assume they will not change.  They can change in any patch or MOR, so you should have a plan for ensuring that they remain up-to-date, hence the use of Java Web Start or the bootstrap classloader.

Hi Jess,

Thanks for ur information.

Regards,

Archana

Just in case people hadn't run across it yet...  There is a group on here dedicated to Windchill Customization.  While it might not provide an answer to this question, if enough people get involved there it could become a really good resource for us all. (See link below.)

Windchill Customization

Top Tags