1
votes

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

1 Answers

1
votes

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.