I have also done a "build warConsole" to generate a new .jar file, but
I altered the DbStarter.java as follows:
public void contextInitialized(ServletContextEvent
servletContextEvent) {
try {
org.h2.Driver.load();
// This will get the setting from a context-param in
web.xml if defined:
ServletContext servletContext =
servletContextEvent.getServletContext();
String url = getParameter(servletContext, "db.url", null);
String user = getParameter(servletContext, "db.user",
null);
String password = getParameter(servletContext,
"db.password", null);
conn = DriverManager.getConnection(url, user, password);
servletContext.setAttribute("connection", conn);
} catch (Exception e) {
e.printStackTrace();
}
}
note, that I am forcing the config to reside in the web.xml, which is:
<context-param>
<param-name>db.url</param-name>
<param-value>jdbc:h2:file:D:/Java/apache-tomcat-6.0.20/webapps/
handle/WEB-INF/data/handle</param-value>
</context-param>
<context-param>
<param-name>db.user</param-name>
<param-value>sa</param-value>
</context-param>
<context-param>
<param-name>db.password</param-name>
<param-value>test123?</param-value>
</context-param>
This all works fine on my local machine, pointing to tomcat server
"localhost:8080/handle/console", but when I port it to the dev server,
and go to "remoteIP:8080/handle/console" I keep getting that pesky
"Sorry, remote connections ('webAllowOthers') are disabled on this
server. " . I simply need to find a way of allowing access to the
console servlet on a locally available embedded h2, and stop it from
trying to use a tcp connection.
Thanks.