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

ACL calling JAVA in Arbortext Editor 6.0 M010

ptc-4447136
1-Newbie

ACL calling JAVA in Arbortext Editor 6.0 M010

Hi Experts,

1) We are facing some issue while calling java class from ACL. From one of the menu item of Custom menu we are calling Java class but we getting error message like

a) [A30134] Can not find the java class com.XXX.XXX.XXX..

b) [A30133] No Java class for the object could be found.

2) We provided our all classes in custom/classes folder and mentioned all the jar files in the classpath variable. But still problem is existing.

Environment details:

Arbortext editor 6.0 M010

Arbortext PE 6.0 M010

Could you please help us.

1 ACCEPTED SOLUTION

Accepted Solutions

It might be safer to not use javaclasspath at all, but rather to put your class file where Arbortext expects to find it. Try this and see if it works any better:

1) Remove the code that modifies java class path (set javaclasspath and/or append_javaclass_path)

2) Put a copy of your class file into the Arbortext install path, under custom/classes.

3) Test, see if you can run it.

4) If that works, then you can try moving the class file out of the Arbortext install path to your own custom directory location, under custom/classes.

--Clay

View solution in original post

12 REPLIES 12

Hi Hiran--

Can you provide a little more information, such as the exact code your menu item invokes, and how your custom/classes folder is structured?

--Clay

Thanks Clay. For your reply. We solved the issue.

OK, I have the same problem. Can somebody explain what the solution was?

In my first attempt at using java with Arbortext Editor, I tried one of the provided samples; compiling it and trying to run it from both the command panel as instructed in the README and from an acl function:

function GoRussell() {

append_javaclass_path('\\\\res-aus-02\\nickel\\common\\arbortext\\custom\\classes')

java_static('TreeView', 'view')

} # GoRussell()

I also tried forward slashes, trailling slashes on the path, mapped drive letter, set javaclasspath=, and all combinations of these. Nothing, nada, zip, except the error "[A30134] Cannot find the java class TreeView".

I am unable to put the class into the install custom\classes directory as my company does not give me those admin rights.

Where am I going wrong?

Another Aussie!

Did you try a local filesystem classpath? I know you can't write to the install tree but I'm thinking like "My Documents" or somewhere writeable like that. It occurs to me that with a network file system you may be running into permissions problems, even if you have your slashes the right way around.

It might also be worth checking the Java logs, I'm on the road and not sure where they are from memory but a quick search in Help Center should turn up that info.

I'm back to working on this thorn in my side. I found that my original problem was because the path to my custom folder was not being included in the javaclasspath. I was trying to include it after the JVM had automatically started for something else (I believe). I now append it in an initialisation file when the program is opening. This however only give me a different error. I now get "[A30135] Cannot load class TreeView because a dependent class was not found."

It is now finding my class and the error seemed to indicate that the standard lib files that this Arbortext sample app required were not on the classpath. Using "eval option('javaclasspath')", I determined that this was the case, none of the jars in lib/classes were there.

I farkelled with this and eventually got them on to the javaclasspath but it made not a single miniscule jot of difference, I still get the same error and cannot run their sample file.

I can find no logs, no mention of logs in the literature, no clue as why it doesn't work. Any help would be much appreciated.

To see Java errors, display the Java Console:

Tools->Administrative Tools->Java Console

That will bring up a window where you will see Java error messages. After displaying the console, try running your static method and you should see a stack trace of the problem. In this case, it should tell you exactly what dependent class it can't find.

--Clay

That is what I thought too. But the java console does not display anything except its original "Java VM Version 1.6.0_31 -- Sun Microsystems Inc." line. Running the java_static("TreeView", "view") command produces no output on the java console, only a "[A30135] Cannot load class TreeView because a dependent class was not found." line on the status bar. The only classes imported by TreeView are from java.awt, javax.swing (both part of the jre), com.arbortext.epic (in aom.jar in lib/classes), and org.w3c.dom (also in lib/classes). These, according to the books of words, are standard jars that need no further referencing for my java class. So I am at a loss to identify which class is not being found and why.

It might be safer to not use javaclasspath at all, but rather to put your class file where Arbortext expects to find it. Try this and see if it works any better:

1) Remove the code that modifies java class path (set javaclasspath and/or append_javaclass_path)

2) Put a copy of your class file into the Arbortext install path, under custom/classes.

3) Test, see if you can run it.

4) If that works, then you can try moving the class file out of the Arbortext install path to your own custom directory location, under custom/classes.

--Clay

Thanks Clay but I tried that and it didn't work either. The issue seems to be that it is not finding other classes, it finds my class because the error message if it didn't would be A30134 (which is what I was originally getting) as opposed to A30135 which it is displaying. I can get no further detail on the class that is missing: it is not displayed in the error message, the jave console does not display anything at all, and I can find no logs or mention of logs.

I'm stumped.

Hi,

We got that error when we compiled with Java 1.8. When we went back to the 1.6 javac, the error went away.

-John

If your TreeView class is in a package, you'll need to do this:

java_static('package.path.TreeView', 'view')

My class is not part of a package, but I did try your suggestion in case it needed the "packages" prefix that is mentioned in the book of words. Made no difference. See my reply to Gareth, I have made a tiny step of progress but am still stuck. Thanks for you suggestion.

Top Tags