This is a question related to linux jar.

Asked 2 years ago, Updated 2 years ago, 129 views

Currently using Linux, turn tomcat server to war,

We are building a server to run java application through jar.

Socket communication is required through jar.

If you run with Eclipse, it works normally without any problems.

I've been touching the server for the first time since two weeks ago, so it's very hard.

In addition, it's my first time to even touch Linux, so I'm struggling with this and that.

You have to parse QurryProcess.xml and SqlMapConfig.xml while executing jar.

I think it is an error that cannot access the xml inside the jar, so I've been looking for it for 3 days, but I haven't solved it yet <

I leave a question just in case. I'll upload the error code as well.

If you need anything else, I can show you information that doesn't count as much ㅠ<

java.lang.RuntimeException: Error occurred. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: java.io.IOException: Could not find resource ./com/swt/server/db/ibatis/QueryProcess_Main.xml at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:49) at com.ibatis.sqlmap.client.SqlMapClientBuilder.buildSqlMapClient(SqlMapClientBuilder.java:63) at com.swt.server.db.ibatis.MyAppSqlMapConfig.(MyAppSqlMapConfig.java:17) at com.swt.server.core.Swt_Process_Core.processProtocol(Swt_Process_Core.java:204) at com.swt.server.core.Swt_Process_Core.run(Swt_Process_Core.java:114) Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: java.io.IOException: Could not find resource ./com/swt/server/db/ibatis/QueryProcess_Main.xml at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:53) at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:46) ... ... 4 more

linux sql java tomcat jar

2022-09-21 15:29

1 Answers

Could not find resource ./com/swt/server/db/ibatis/QueryProcess_Main.xml

I don't think I can find the xml file.

The reason why I can't find it is because I find the xml file in classpath.

The xml file must be located in the classes directory within jar.

And the other way is to modify and test as below,

Reader reader = Resources.getResourceAsReader ("relative xml file path");

If you are using the

Reader reader = new java.io.FileReader ("/home/aaa/bbb/"); // absolute path

SqlMapClient sqlMap = SqlMapClientBuilder.buildSqlMapClient(reader);

Try changing it like this.


2022-09-21 15:29

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.