Deploying to applicationserver: where is the root folder defined?

5
I want to deploy my model on a application server. I've downloaded the w32 service zipfile and configured the conf files. A java action is giving an error to find a font in my rootmap. While I think I placed the font in the root folder. Where can I find the configuration of the root folder when a model is being deployed as a service?
asked
3 answers
6

Your exception is probably something like this: can't find file fontname.ttf on location: c:\someFolder\someSubFolder\projectFolder\w32service\fontname.ttf
This means that the java usually thinks that the basepath is the path where the project is started from. On a windows server that folder is usually the w32service folder even though you have configured the basepath in your application.conf

To fix this problem you have to make some changes in java. In the code where the file location is used you should allways ask the Core what the basepath is and define the absolute path of the file location.

This means that when programming the java it isn't sufficient to do something like this if the font is in the root of the project folder

   File f = new File( "font.ttf" );

But you must ask the core the absolute path of the project folder and specify that in the file like this:

  File f = new File( Configuration.getBasePath().getAbsolutePath() + "font.ttf");
  //The Configuration class is located in package:  com.mendix.core.conf.Configuration
answered
4

You can find the root folder in the application.conf file which you can find in the w32service folder.

answered
-1

Fedor, thanks for your help. The basepath is defined correct. Any idea why Java doesn't find the font?

answered