smile Problem using Ant, missing classes

This topic has been viewed 10155 times and has 18 replies
Thread status: Active
Questions about extending features and developing plug-ins [img]http://www.sweethome3d.com/images/flags/en_small.gif[/img]
mikeycast
Posts: 17
Joined: Sun May 06, 2012 6:51 pm
Country: France

Problem using Ant, missing classes

Post by mikeycast »

Good evening,

I come to ask you a question once more, because I now have an issue building my application with Ant. The build is successful (I tried the jarExecutable and MacOsInstaller preselection with the good VM arguments) but when I launch my application all the functionnalities I added in two new files placed in com.eteks.sweethome3d.swing don't work. Nothing happens when I click on the button I added, when a new window should appear. I precise that appart from the part I added SweetHome is working well.

I checked and my classes are in build/classes. I don't understand why my functionnalities don't work, because Ant is set to pack "all workspace".

Thanks for your help [:)] ,

Mikaël
User avatar
Puybaret
Posts: 9440
Joined: Mon Nov 07, 2005 12:00 pm
Country: Paris, France
Contact:

Re: Problem using Ant, missing classes

Post by Puybaret »

What exception stack trace do you get in /Applications/Utilities/Console program?
Emmanuel Puybaret, Sweet Home 3D creator
mikeycast
Posts: 17
Joined: Sun May 06, 2012 6:51 pm
Country: France

Re: Problem using Ant, missing classes

Post by mikeycast »

When I click on the button I added I get the error (I put what I found pertinent) :

.com.apple.JarLauncher: Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at com.eteks.sweethome3d.swing.ControllerAction.actionPerformed(Unknown Source)

...

Caused by: java.lang.reflect.InvocationTargetException

...

Caused by: java.lang.NoClassDefFoundError: com/lowagie/text/Elementat com.eteks.sweethome3d.swing.MonitoringFrame.createSensorPagePanel(Unknown Source)

...

Caused by: java.lang.ClassNotFoundException: Class com.lowagie.text.Element
at com.eteks.sweethome3d.tools.ExtensionsClassLoader.findClass(Unknown Source)
User avatar
Puybaret
Posts: 9440
Joined: Mon Nov 07, 2005 12:00 pm
Country: Paris, France
Contact:

Re: Problem using Ant, missing classes

Post by Puybaret »

com.lowagie is the package base of iText library.
Could you check the source code version you use?
Because I remember that I fixed in version 3.5 an issue about iText version that was wrong in SweetHome3DBootstrap.java.
Emmanuel Puybaret, Sweet Home 3D creator
mikeycast
Posts: 17
Joined: Sun May 06, 2012 6:51 pm
Country: France

Re: Problem using Ant, missing classes

Post by mikeycast »

Ok this fixes my issue, I just refreshed the file you cited. Now my window is lauching but I have some other issues :

- First, the "é,è,à" characters are not printed well, even though Ant is encoding in UTF-8...

- Secondly, I have a JPanel composed with JCheckBox which is absent [:(]

Can you continue to help me please? I don't have any error message in the console this time.
mikeycast
Posts: 17
Joined: Sun May 06, 2012 6:51 pm
Country: France

Re: Problem using Ant, missing classes

Post by mikeycast »

Hello,

an idea where it can come from? Of why my panel is not showed?

The panel is printed thanks to values from a distant database. Could it be a problem of connexion? Are the supplementary sql packages automatically added by Ant?

Thanks for your help,

Mikael
User avatar
Puybaret
Posts: 9440
Joined: Mon Nov 07, 2005 12:00 pm
Country: Paris, France
Contact:

Re: Problem using Ant, missing classes

Post by Puybaret »

Without source code, it's impossible to be sure. You probably didn't pay enough attention to the encoding of the files that contain accented letters, and executed your plug-in on a different OS.
Emmanuel Puybaret, Sweet Home 3D creator
mikeycast
Posts: 17
Joined: Sun May 06, 2012 6:51 pm
Country: France

Re: Problem using Ant, missing classes

Post by mikeycast »

Thank you, and what do you think about the sql connection problem?

I've added mysql-connector-java-5.1.18-bin.jar to the libs but Ant may not include it.

Should normally Ant add the .jar I added in /lib or do I have to force it by modifying the build.xml file?

I think about this because the symptoms are the same than when I had some problems connecting to the database.

Anyway, I don't have any messages in the Console.
mikeycast
Posts: 17
Joined: Sun May 06, 2012 6:51 pm
Country: France

Re: Problem using Ant, missing classes

Post by mikeycast »

Hello, I've juste read the post from Mitsaki and so I've added my packages to the SweetHome3DBootstrap, in the extensionJarsAndDlls array. And thanks to your link I know now that my .jar are included during the building, while they are in /lib.

Still the connection to the database doesn't work and I don't have any messages in the console.

Do you have any ideas of other things to do to make it work?

Please, I have 3 days left to fix it until my presentation...
User avatar
Puybaret
Posts: 9440
Joined: Mon Nov 07, 2005 12:00 pm
Country: Paris, France
Contact:

Re: Problem using Ant, missing classes

Post by Puybaret »

You may have to add the packages of your project in applicationPackages of SweetHome3DBootstrap too.
If you have nothing in the console, run in a Terminal window your JAR executable file with command:

Code: Select all

java -jar jarExecutableFile.jar
Without source code or a stack trace it will be difficult to help you further. I just can't guess what is wrong. I don't even know why you use a database and how!!!
Emmanuel Puybaret, Sweet Home 3D creator
Post Reply New Topic

Who is online

Users browsing this forum: No registered users and 2 guests