Java don't work

Hello,

I’m working on a project with Ajax Developer (Natural for AJAX) and trying to define a control and corresponding XML Definition for a Macro Control with a Server-Side Representative. But I can’t get my custom control to work with the Handler java class that I wrote. My team noticed that all java classes don’t compile, and guess it needs to recognize Java and compile, but we don’t know how to enable this. I am using Software AG Designer 9.6. Has anyone ever experienced this? Can anyone help with this problem?

Best regards,

Alexandre Oliveira

Hi Alexandre,

you need to enable your project for Java. To do so:

  • right click on your project and select “Properties”
  • Select “Project Facets”
  • Click on “Convert to faceted from…”
  • Select Java

You need to set the source folders/output folders and libraries as described here
http://techcommunity.softwareag.com/ecosystem/documentation/naturalONE/natONE836/core/ajaxdev/ad-start.htm#ad-start-javaext

Once a project is Java enabled, setting/changes source folders/output folders and libaries is always possible via the project properties/Java Build Path

Best Regards,
Christine

1 Like

In an earlier post [url]http://tech.forums.softwareag.com/techjforum/posts/list/55439.page[/url] I have uploaded a working example for custom controls. You can also use this as an example to see how the the Java build path needs to be set up.

Kind regards, Thomas

1 Like

Looking at an example is a very good hint.
Also the NaturalAjaxDemos are a Java enabled project. If you import it from the welcome page of ONE, you can see the settings as well.

Best Regards,
Christine

Thank you and sorry for reply so late, I can compile and build Java now and I did some progress developing new controls. You were a great help, but I’m still having a problem. The classes are generated locally, but they are not sent to the server automatically. I am doing it manually and I wonder if is possible to automate this task.

Hi Alexandre,

be sure to follow the following naming conventions. Let’s assume is the folder for a User Interface Component myui. Then the folder names for Java must be:
/src - Java source folder
/appclasses/classes: Java output folder for the .class files.

If not yet done yet, switch on “Build automatically” in the Project menu of Eclipse.

Right click you Natural project and select “Ajax Developer”. Select “Monitoring”. This will open the Monitoring tool. To refresh the .class files in the Tomcat of ONE, click the buttons in the System Management area at the bottom.
I always have the Monitoring tool open during development.

As an alternativ you can activate “Build User Interface Component” - right click on , select Ajax Developer/Build. This will also automatically refresh the .class files in the ONE Tomcat.

When deploying to an external application server, all .class files will be packaged for you automatically into your .war file when using the ant war deployment tool.

Best Regards,
Christine

1 Like