The application.properties file is already created in src/resources folder ; it contains :
ARTICLE_XML = D:\\Projets\\Oxalys\\XML\\Exemple_export_Articles_.xml
FOURNISSEUR_XML = D:\\Projets\\Oxalys\\XML\\Exemple_export_Fournisseurs.xml
FACTURE_XML = D:\\Projets\\Oxalys\\XML\\Exemple_export_Factures.xml
COMMANDE_XML = D:\\Projets\\Oxalys\\XML\\Exemple_export_Commandes.xml
RECEPTION_XML = D:\\Projets\\Oxalys\\XML\\Exemple_export_Réceptions.xml
ARTICLE_CSV = D:\\Projets\\Oxalys\\CSV\\
FOURNISSEUR_CSV = D:\\Projets\\Oxalys\\CSV\\
FACTURE_CSV = D:\\Projets\\Oxalys\\CSV\\
COMMANDE_CSV = D:\\Projets\\Oxalys\\CSV\\
RECEPTION_CSV = D:\\Projets\\Oxalys\\CSV\\
Inside a class I reference a property :
public class Article {
@Autowired
private static Environment env;
static File xml = new File(env.getProperty("ARTICLE_XML")); // it is the line 31 in the console error
static File out = new File(env.getProperty("ARTICLE_CSV") + "out_article.csv");
public static synchronized void process() throws IOException, InterruptedException {
Thread th = new Thread() {
@Override
public void run() {
try {
.....
After compiling and making maven package , when I run the app then I get a console error :
Exception in thread "main" java.lang.ExceptionInInitializerError
at com.axian.oxalys.main.App.main(App.java:22)
Caused by: java.lang.NullPointerException
at com.axian.oxalys.classes.Article.<clinit>(Article.java:31)
... 1 more
So what is wrong ?