1

Hello I am new to java development, I am trying to modify an application developed by a colleague however when I try to deploy it I get this error:

javax.servlet.ServletException: org.apache.ibatis.exceptions.PersistenceException:

Error building SqlSession.

The error may exist in SQL Mapper Configuration

Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.io.IOException: Could not find

resource database.properties org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:373) org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:372) org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:335) org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:218) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

org.apache.ibatis.exceptions.PersistenceException:

Error building SqlSession.

The error may exist in SQL Mapper Configuration

Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.io.IOException: Could not find

resource database.properties org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23) org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:79) org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:67) com.jeeutils.db.ConnectionBuilderAction.(ConnectionBuilderAction.java:30) com.jeeutils.db.ConnectionBuilderAction.getSqlSession(ConnectionBuilderAction.java:45) com.utils.dbsession.DbSession.newSessionKey(DbSession.java:47) com.utils.dbsession.DbSession.getSession(DbSession.java:147) com.webapp.actions.BusinessAction.loadProfileMenuList(BusinessAction.java:391) com.webapp.actions.BusinessAction.preprocessRequest(BusinessAction.java:158) com.webapp.actions.LoginAction.addForm(LoginAction.java:56) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:497) org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81) org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:140) org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:158) org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:152) org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:101) org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:353) org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:343) org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102) org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:237) org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) org.glassfish.jersey.internal.Errors$1.call(Errors.java:267) org.glassfish.jersey.internal.Errors.process(Errors.java:315) org.glassfish.jersey.internal.Errors.process(Errors.java:297) org.glassfish.jersey.internal.Errors.process(Errors.java:267) org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:318) org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:211) org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:982) org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:359) org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:372) org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:335) org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:218) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

I would like to know what the cause of this error is and how I can fix it.

1 Answer 1

1

Ibatis is a data mapping framework (it is in the middle between your database and the object oriented logic... provides object in return of a query) and it does have a configuration file and this "database.properties". Once deployed, your program cannot find it. I can't tell you more without knowing more details.

Maybe this could help too, the response suggest a place where the property file could be placed.

Sign up to request clarification or add additional context in comments.

4 Comments

Found the configuration file however I noticed it is src/main/local/ and mybatisConfig.xml has the following property <properties resource="database.properties" />. What can I do to make it work?
Hey at least he made an effort. I'm grateful. His info was very useful.
Well I posted an answer because it is at least a partial answer. He asked what is the cause (and gave him an answer) and how to solve it (and I couldn't answer on this, I agree)
There's no denying It may have helped, and of course it is to be commended that Marco offered what he could - but it is still not an answer. According to SO guidelines, commentary, requests for clarification, links, background info, etc should be posted as comments, not answers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.