I'm attempting to load my war file to Tomcat 6 and constantly get this error:
May 20, 2014 12:35:42 AM org.apache.catalina.startup.ContextConfig init SEVERE: Exception fixing docBase for context [/MyService] java.util.zip.ZipException: error in opening zip file at java.util.zip.ZipFile.open(Native Method)
...
May 20, 2014 12:35:42 AM org.apache.catalina.core.StandardContext resourcesStart SEVERE: Error starting static Resources java.lang.IllegalArgumentException: Invalid or unreadable WAR file : error in opening zip file
I've found several suggestions and tried them all, still stumped.
- Moved the file to a diff directory, then copied to webapps
- Changed the file permissions before moving to webapps
- Stopped Tomcat, delete the old, add the new, then restart
- Added a random class to the war before re-deploying
- Uninstalled tomcat6 (also removing the tomcat6 directory) and re-installed tomcat6 fully
Here's the strangest part - I've also taken old wars (older versions of the same app) that used to work on this same server, and those don't work either (same error), even after re-installing Tomcat. This leads me to believe it's a Tomcat problem, however the uninstall didn't fix anything. Also, I've created war files from this same project (Eclipse) and deployed them fine to a different tomcat6 server. Also, when I run the app on my dev box localhost Eclipse/Tomcat connecting to the same database remotely, everything works fine.
When I actually make an http request, the app is deployed, however I have a static initializer that is not working and causing a null pointer exception. I assume this is related to the
SEVERE: Error starting static Resources
Here is the static initializer, it is creating a BoneCP connection pool, which also has always worked and I confirmed that MySQL is working fine (replication is also still occurring - it is a slave MySQL). The connectionPool object is null and I don't get a stack trace in my logs for the openPool() method, I also don't see any root connections to MySQL:
protected static BoneCP connectionPool = null;
static
{
openPool();
}
protected static void openPool()
{
try
{
Class.forName("com.mysql.jdbc.Driver").newInstance();
BoneCPConfig config = new BoneCPConfig();
config.setJdbcUrl("jdbc:mysql://localhost:3306/mydatabase");
config.setUsername("root");
config.setPassword("mypassword"); //SLAVE
config.setMinConnectionsPerPartition(2);
config.setMaxConnectionsPerPartition(6);
config.setPartitionCount(7);
connectionPool = new BoneCP(config);
}
catch (Exception ex)
{
ex.printStackTrace();
}
}