Reputation: 5534
I have a project which in the meantime runs locally on Tomcat but I'm planning to deploy to some server in the future. I have a few questions:
tomcat-jdbc.jar
. How should I include that jar in the project? copy it to WEB-INF/lib
or add a library reference to tomcat? is the latter portable? Can I use this jar even if the server I'm deploying to is using jetty?JRE
, eclipse asked me to point it to the JRE
path. The line that was added in the classpath was classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"
How does eclipse figure out from this line where the JRE is at?
My guess is:
<project name>
----<build> (.class files)
----<WebContent>
--------<META-INF>
------------MANIFEST.MF
--------<WEB-INF>
------------<lib>
----------------external_jar.jar
------------web.xml
---------index.html
Is this correct? if so, how will the runtime know where to find the JRE? or the tomcat-jdbc.jar which is in the Tomcat installation folder?
Upvotes: 2
Views: 3092
Reputation: 1
my error is solved with this: i copied jar files on my clipboard and paste them in WEB-INF --->"lib" folder and reRun the project and you can change your browser
Upvotes: 0
Reputation: 163
1) Pool connections, it's a service provided by Application Server (Tomcat in this case). IMHO you have to avoid bind your application with specific implementation, in that case use generic javax.sql.DataSource for expample, and then "inject" or lookup the implmementation from the server. Then if you use Jetty, configure what you want as connection pool implementation https://wiki.eclipse.org/Jetty/Howto/Configure_JNDI_Datasource
So dont´t include in your web-inf/lib tomcat-jdbc.jar.
2) The "org.eclipse.jdt.launching.JRE_CONTAINER" it's a internal variable of eclipse and the value is what you configure on eclipse properties. It's used for eclipse to compile and run your app.
3) in your project structure ".class" files, must go in "WEB-INF/classes". That it's defined by servlet specification. Eclipse automatically generate the correct structure if you select yor project and with right click run "Export" --> "War file". Or you can use maven.
Upvotes: 0
Reputation: 5524
Your application needs the following three types of "resources"
So, to answer your questions:
Regarding the portability of tomcat-jdbc.jar Unfortunately this depends on the tomcat library and version. There might be more dependencies of this jar file which might cause problems later on. I would recommend not relying on this jar unless you plan to deploy on tomcat.
Upvotes: 1
Reputation: 44
3.Your project hierarchy is correct. The runtime will get the JRE from the JAVA_HOME environment variable set on the server.
Upvotes: 0
Reputation: 41
When you uses a server like tomcat, it uses the configuration you setted on it.
Upvotes: 0