Note that there are some explanatory texts on larger screens.

plurals
  1. POjavax.servlet cannot be resolved fo OpenShift Tomcat 7 (JBoss EWS 2.0)
    primarykey
    data
    text
    <p>I was building the first project for OpenShift the PaaS. Decided to go with java so downloaded the JBoss Developer Studio and created the first poject. Openshift kind of already created the template so it should run. But in the developer studio, there is error:</p> <blockquote> <p>javax.servlet cannot be resolved</p> </blockquote> <p>I know this could be simple for Java EE people but my question is that for OpenShift, would the solution be same. Can we just copy an apache tomcat jar to the project folder? JBoss Develper Studio is not exactly Eclipse I guess? So I added the jar and the error disappeared. Then there is this warning:</p> <blockquote> <p>Classpath entry .. tomecat-7.0.42/lib/servlet-api.jar will not be exported or published ClassNotFoundException may result.</p> </blockquote> <p><strong>Question</strong></p> <p>What is the right thing for the error and warning to disappear? Should Openshift already have the jar since it's a PaaS, not IaaS. Do we just need the jar to build but this jar will not be part of the web app?</p> <p><strong>Info</strong></p> <p>The JBoss Developer Studio does have pom.xml</p> <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt; &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt; &lt;groupId&gt;tom&lt;/groupId&gt; &lt;artifactId&gt;tom&lt;/artifactId&gt; &lt;packaging&gt;war&lt;/packaging&gt; &lt;version&gt;1.0&lt;/version&gt; &lt;name&gt;tom&lt;/name&gt; &lt;repositories&gt; &lt;repository&gt; &lt;id&gt;eap&lt;/id&gt; &lt;url&gt;http://maven.repository.redhat.com/techpreview/all&lt;/url&gt; &lt;releases&gt; &lt;enabled&gt;true&lt;/enabled&gt; &lt;/releases&gt; &lt;snapshots&gt; &lt;enabled&gt;true&lt;/enabled&gt; &lt;/snapshots&gt; &lt;/repository&gt; &lt;/repositories&gt; &lt;pluginRepositories&gt; &lt;pluginRepository&gt; &lt;id&gt;eap&lt;/id&gt; &lt;url&gt;http://maven.repository.redhat.com/techpreview/all&lt;/url&gt; &lt;releases&gt; &lt;enabled&gt;true&lt;/enabled&gt; &lt;/releases&gt; &lt;snapshots&gt; &lt;enabled&gt;true&lt;/enabled&gt; &lt;/snapshots&gt; &lt;/pluginRepository&gt; &lt;/pluginRepositories&gt; &lt;properties&gt; &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt; &lt;maven.compiler.source&gt;1.6&lt;/maven.compiler.source&gt; &lt;maven.compiler.target&gt;1.6&lt;/maven.compiler.target&gt; &lt;/properties&gt; &lt;dependencies&gt; &lt;dependency&gt; &lt;groupId&gt;org.postgresql&lt;/groupId&gt; &lt;artifactId&gt;postgresql&lt;/artifactId&gt; &lt;version&gt;9.2-1003-jdbc4&lt;/version&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;mysql&lt;/groupId&gt; &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt; &lt;version&gt;5.1.25&lt;/version&gt; &lt;/dependency&gt; &lt;/dependencies&gt; &lt;profiles&gt; &lt;profile&gt; &lt;!-- When built in OpenShift the 'openshift' profile will be used when invoking mvn. --&gt; &lt;!-- Use this profile for any OpenShift specific customization your app will need. --&gt; &lt;!-- By default that is to put the resulting archive into the 'webapps' folder. --&gt; &lt;!-- http://maven.apache.org/guides/mini/guide-building-for-different-environments.html --&gt; &lt;id&gt;openshift&lt;/id&gt; &lt;build&gt; &lt;finalName&gt;tom&lt;/finalName&gt; &lt;plugins&gt; &lt;plugin&gt; &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt; &lt;version&gt;2.1.1&lt;/version&gt; &lt;configuration&gt; &lt;outputDirectory&gt;webapps&lt;/outputDirectory&gt; &lt;warName&gt;ROOT&lt;/warName&gt; &lt;/configuration&gt; &lt;/plugin&gt; &lt;/plugins&gt; &lt;/build&gt; &lt;/profile&gt; &lt;/profiles&gt; &lt;/project&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload