lundi 4 mai 2015

InjectionException Error creating managed object

Hello Stackoverflow Community,

I made a jsf projekt. With maven. It works fine. But I would like to split my projekt in two. The idea is: make a ejb (ejb) and a web(war) project. But riht now i don't need ejb (in later versions I will). An I have a class which parses a csv-file from the gl-server.

public class CSVParser implements javax.servlet.ServletContextListener{

        private Logger logger = Logger.getLogger(CSVParser.class);
        private final String file = "data.csv";
        private static String glassfishInstanceRootPropertyName = "com.sun.aas.instanceRoot";
        private static String glassfishFolderName = "csv";
        private BufferedReader br;
        private String line = "";
        private String cvsSplitBy = ",";
        private List<String> columns;
        private List<String> parametersActLine;
        private Feeler actFeeler = new Feeler();

        public CSVParser() {

        }

    public void parseCSV() {

...
...
...}
...
...
        @Override
        public void contextInitialized(ServletContextEvent sce) {
                parseCSV();
                
        }

        @Override
        public void contextDestroyed(ServletContextEvent sce) {
                // TODO Auto-generated method stub
                
        }

This is the way I start parsing (web.xml):

    <listener>
                <listener-class>com.saphirwerk.configurator.util.CSVParser
        </listener-class>
        </listener>

As I said: This works on my jsf project, but when I start my application as a enterprise application (ear) I got the following exception:

cannot Deploy configurator_ear deploy is failing=Error occurred during deployment: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.IllegalArgumentException: javax.servlet.ServletException: com.sun.enterprise.container.common.spi.util.InjectionException: Error creating managed object for class: class com.saphirwerk.configurator.util.CSVParser. Please see server.log for more details.

I added the ejb project to the build path of the web project.

What can it be?

Thanks




Aucun commentaire:

Enregistrer un commentaire