��������������j2sdkee1.2.1������lib������javax!
��������������������
������������������javax��������lib��������
?????? are you missing package javax? Put j2ee.jar in your classpath:
set CLASSPATH=%CLASSPATH%;%J2EE_HOME%\lib\j2ee.jar
Jesper
Similar Messages
-
Javax.servlet.* Not Found Error - Please help
I am having a great deal deal of trouble trying to compile a program using javax.servlet and javax.servlet.hhtp.*. I have setup the JAVA_HOME and the CLASSPATH variables as per the Installation instructions. I appear to have hit a brick wall and I am absolutely desperate to get this working. I have installed the J2EE SDK as well as the Servletapi2.1. Please Help.
Variables:
CLASSPATH=c:\jdk1.3\lib\tools.jar;c:\j2sdkee1.3.1\lib\j2ee.jar;c:\jdk1.3\jre\bin;c:\jdk1.3\jre\lib;c:\mm.mysql-2.0.14\org;c:\jdk1.3\lib\servlet.jar;
JAVA_HOME=c:\jdk1.3;
J2EE_HOME=c:\j2sdkee1.3.1;
PATH=%PATH%;c:\jdk1.3\bin;c:\j2sdkee1.3.1\bin;
Error message from compiler:
L:\PROGRA~1\allaire\jrun\servers\default\loanstest\web-inf\classes\PasswordServlet.java:27: package javax.servlet does not exist
import javax.servlet.*;
^
L:\PROGRA~1\allaire\jrun\servers\default\loanstest\web-inf\classes\PasswordServlet.java:30: package javax.servlet.http does not exist
import javax.servlet.http.*;
^
L:\PROGRA~1\allaire\jrun\servers\default\loanstest\web-inf\classes\PasswordServlet.java:39: cannot resolve symbol
symbol : class HttpServlet
location: class PasswordServlet
public class PasswordServlet extends HttpServletI can only think of three suggestions.
One, use your mouse to "cut-n-paste" the value of CLASSPATH and verify that those files are exactly where you think they are, and are spelled right.
E.g.
CD C:\JDK1.3\LIB
DIR SERVLET.JAR
Two, if they're spelled right, run "jar tvf" on the files to make sure they aren't corrupted or something.
E.g.:
JAR TVF SERVLET.JAR
Three, since you're working in Windoze, try putting the value inside double quotes. E.g.:
SET CLASSPATH="c:\jdk1.3\lib\tools.jar;c:\j2sdkee1 ... etc ... "
If you haven't tried the above, give it a go, see what happens. -
Can't start J2ee server using j2sdkee1.3.1
When i try to start j2ee server , it shows the following
Error message.
Exception in thread "main" java.lang.NoClassDefFoundError: javax/naming/Context
at com.sun.enterprise.server.J2EEServer.<clinit>(J2EEServer.java:53)
I have set all environment variables as follows
set path=.;c:\jdk1.2.2\bin;c:\j2sdkee1.3.1\bin;
set classpath=.c:\jdk1.2.2\lib;c:\j2sdkee1.3.1\lib\j2ee.jar
set JAVA_HOME=c:\jdk1.2.2
set J2EE_HOME=c:\j2sdkee1.3.
pls kindly give a solution.Try rather using the 1.4 version available here: http://java.sun.com/j2ee/1.4/
and use this dedicated forum: http://forum.java.sun.com/forum.jsp?forum=136
-Alexis -
SOS!! : I can't find javax.rmi.*
After i install j2sdkee1.2.1,
I can't find javax.rmi.* in the dictory D:\j2sdkee1.2.1\lib
Where will i find it and download it into my computerAdd j2ee.jar to your classpath.
Jesper -
Import javax.ejb.*
Hello,
i was able to import javax.ejb.*
i did
set classpath=c:\j2sdkee1.3.1\lib\j2ee.jar
then compiled my file, i also need a class file which is in the c:\pro\project3
called Item.class
i'm getting an error where i'm doing
public Item
it say, can't fine class Item.
how can i use j2ee.jar and also use Item.class
thanks alotset classpath=c:\j2sdkee1.3.1\lib\j2ee.jar;c:\pro\project3
-
I am first time to try to programming JMS. I have installed J2EE SDK 1.3.1 and have set the environment variables needed to run J2EE applications on Microsoft Windows.
When I compile the program, I have get a error "package javax.jms does not exist".
How can I solve it?
Thanks a lot....Here' ssome better detail I found in the Sun JMS tutorial FAQ:
package javax.jms does not exist
Error detail:
java -Djms.properties=%J2EE_HOME%\config\jms_client.properties SimpleQueueSender MyQueue 3
SimpleQueueSender.java:18: package javax.jms does not exist
import javax.jms.*;
^
SimpleQueueSender.java:32: cannot resolve symbol
symbol : class QueueConnectionFactory
location: class SimpleQueueSender
QueueConnectionFactory queueConnectionFactory = null;
Likely cause: Either the CLASSPATH variable was not set correctly, or the J2EE SDK was not correctly installed. Make sure that j2sdkee1.3.1/lib/j2ee.jar is in your classpath, and that the file exists on your system. -
Problem in executing beans in j2sdkee1.2.1
I have an email application which uses a bean called webmailbean.java. I could successfully execute this mail application under java webserver2.0 but it fails under j2sdkee1.2.1 server. I have kept this bean in a package called test and placed this bean in c:\j2sdkee1.2.1\lib\classes\test\abc.class and trying to use this bean in my jsp page.
It is giving an error message like this:Cannot create bean of class webmailbean.While other examples which uses beans are working fine in j2ee server why this application fails?
plz any one help me
Thanks in advance,
ananth krishnaI had an error like this 2 days ago
After several posts here I eventually found out (thru a guess on my part) that the inf flat file that the bean referred to was corrupted.
You might do well to read some of the replies to that post, as they may help you:
http://forum.java.sun.com/thread.jsp?forum=45&thread=162685 -
Problem in j2sdkee1.2.1 installation
Hi,
I installed j2sdkee1.2.2 . I set the class path as c:\j2sdkee1.2.1\lib\j2ee.jar and PATH as "c:\j2sdkee1.2.1\bin;c:\j2sdkee1.2.1\lib".
I also edited userconfig.bat under \bin directory and set J2EE_HOME=c:\j2sdkee1.2.1.
Everytime I try to start the server with "j2ee -verbose" I get the following error "ERROR: set J2EE_HOME before running this script"
Can someone please help?
Thanx in AdvanceIn j2ee.bat :
set JAVA_HOME=blahblah
set J2EE_HOME=blahblahblah as your first two lines
Hi,
I installed j2sdkee1.2.2 . I set the class path as
c:\j2sdkee1.2.1\lib\j2ee.jar and PATH as
"c:\j2sdkee1.2.1\bin;c:\j2sdkee1.2.1\lib".
I also edited userconfig.bat under \bin directory and
set J2EE_HOME=c:\j2sdkee1.2.1.
Everytime I try to start the server with "j2ee
-verbose" I get the following error "ERROR: set
J2EE_HOME before running this script"
Can someone please help?
Thanx in Advance -
J2SDKEE1.2.1 compiling
Well, I�ve created a batch file for compiling the .java files from the tutorial. But in one way or another the compiler can�t find the j2ee.jar package. Though all path�s were set correctly. Here�s my batch file. Who can help me out!!!
echo The JAVA environment is about to be set...
set JAVA_HOME=c:\jdk1.3.1
set J2EE_HOME=c:\j2sdkee1.2.1
rem set DRIVE1=c:
rem set DRIVE2=e:
set JDK=c:\jdk1.3.1
set J2SDKEE=c:\j2sdkee1.2.1
set CLASSES=e:\src\servlet
set DEVLPMT=e:\src\servlet
set PATH = .;%JDK%\bin;c:\windows\command;c:\j2sdkee1.2.1\bin
set CLASSPATH=.;%CLASSES%;%DEVLPMT%;%JDK%\src.jar;%J2SDKEE%\lib\j2ee.jar;%JDK%\lib\tools.jar;c:\j2sdkee1.2.1\bin;c:\j2sdkee1.2.1\lib\jhall.jar;c:\j2sdkee1.2.1\lib\ejb10deployment.jar
set CPATH = .;%J2EE_HOME%\lib\j2ee.jar
%JAVA_HOME%\bin\javac -classpath %CPath% %CLASSES%\ConverterEJB.java %CLASSES%\Converter.java %CLASSES%\ConverterHome.javaIt is because of classpath problem
if any of the classpath is not available in ur setting , the remain won't work ,
for ex u have class path to c:\l.jar;c:\ll.jar
in this case if l.jar is not available the classpath won't take the next one...
so try to check if there any file is missing for u..
u can get the whole paths by typing
set | more cammand in the prompt...
let me know is it working now
[email protected] -
Some one can help me with this issue?
i using netbeans 7.4 to generate and start my javafx application, the application works fine running on desktop but when i try run in chrome/firefox or ie browser i have the erros below.
ps: all jar are signed and all permissions are granted.
Thanks a lot!
Davis
Plug-in 10.45.2.18 do Java
Usando a versão do JRE 1.7.0_45-b18 Java HotSpot(TM) Client VM
Diretório home do usuário = C:\Users\Davis Gordon
c: limpar janela da console
f: concluir objetos da fila de finalização
g: coleta de lixo
h: exibir esta mensagem de ajuda
l: descartar lista de carregadores de classes
m: imprimir uso de memória
o: log do trigger
q: ocultar console
r: recarregar configuração da política
s: descartar propriedades do sistema e de implantação
t: descartar lista de threads
v: descartar pilha de threads
x: limpar cache do carregador de classes
0-5: definir nível de rastreamento como <n>
CacheEntry[file:/C:/Desenv/Projetos/workspace_beta02/Tedros-Box/dist/lib/Tedros-Core-EjbClient.jar]: updateAvailable=false,lastModified=Thu Dec 12 20:23:13 BRST 2013,length=5185
CacheEntry[file:/C:/Desenv/Projetos/workspace_beta02/Tedros-Box/dist/lib/Tedros-App-API.jar]: updateAvailable=false,lastModified=Thu Dec 12 20:23:13 BRST 2013,length=116706
CacheEntry[file:/C:/Desenv/Projetos/workspace_beta02/Tedros-Box/dist/lib/App-Painel-Controle.jar]: updateAvailable=false,lastModified=Thu Dec 12 20:23:13 BRST 2013,length=141981
CacheEntry[file:/C:/Desenv/Projetos/workspace_beta02/Tedros-Box/dist/Tedros-Box.jar]: updateAvailable=false,lastModified=Thu Dec 12 20:23:13 BRST 2013,length=200921
CacheEntry[file:/C:/Desenv/Projetos/workspace_beta02/Tedros-Box/dist/lib/Tedros-Core-Model.jar]: updateAvailable=false,lastModified=Thu Dec 12 20:23:13 BRST 2013,length=47516
CacheEntry[file:/C:/Desenv/Projetos/workspace_beta02/Tedros-Box/dist/lib/Tedros-Core.jar]: updateAvailable=false,lastModified=Thu Dec 12 20:23:13 BRST 2013,length=108000
CacheEntry[file:/C:/Desenv/Projetos/workspace_beta02/Tedros-Box/dist/lib/Tedros-DataAccess-Model-API.jar]: updateAvailable=false,lastModified=Thu Dec 12 20:23:13 BRST 2013,length=13588
CacheEntry[file:/C:/Desenv/Projetos/workspace_beta02/Tedros-Box/dist/lib/Tedros-DataAccess-Server-API.jar]: updateAvailable=false,lastModified=Thu Dec 12 20:23:13 BRST 2013,length=32124
CacheEntry[file:/C:/Desenv/Projetos/workspace_beta02/Tedros-Box/dist/lib/Tedros-Exception.jar]: updateAvailable=false,lastModified=Thu Dec 12 20:23:13 BRST 2013,length=2624
CacheEntry[file:/C:/Desenv/Projetos/workspace_beta02/Tedros-Box/dist/lib/Tedros-Util.jar]: updateAvailable=false,lastModified=Thu Dec 12 20:23:14 BRST 2013,length=15348
CacheEntry[file:/C:/Desenv/Projetos/workspace_beta02/Tedros-Box/dist/lib/Tedros-FXComponents.jar]: updateAvailable=false,lastModified=Thu Dec 12 20:23:14 BRST 2013,length=282972
CacheEntry[file:/C:/Desenv/Projetos/workspace_beta02/Tedros-Box/dist/lib/commons-collections-3.2.1.jar]: updateAvailable=false,lastModified=Thu Dec 12 20:23:14 BRST 2013,length=583672
CacheEntry[file:/C:/Desenv/Projetos/workspace_beta02/Tedros-Box/dist/lib/eclipselink-jpa-modelgen_2.4.1.v20121003-ad44345.jar]: updateAvailable=false,lastModified=Thu Dec 12 20:23:14 BRST 2013,length=12387
CacheEntry[file:/C:/Desenv/Projetos/workspace_beta02/Tedros-Box/dist/lib/commons-lang3-3.1.jar]: updateAvailable=false,lastModified=Thu Dec 12 20:23:14 BRST 2013,length=319222
CacheEntry[file:/C:/Desenv/Projetos/workspace_beta02/Tedros-Box/dist/lib/javax.persistence_2.0.4.v201112161009.jar]: updateAvailable=false,lastModified=Thu Dec 12 20:23:20 BRST 2013,length=128747
CacheEntry[file:/C:/Desenv/Projetos/workspace_beta02/Tedros-Box/dist/lib/jfxrt.jar]: updateAvailable=false,lastModified=Thu Dec 12 20:23:23 BRST 2013,length=15117378
CacheEntry[file:/C:/Desenv/Projetos/workspace_beta02/Tedros-Box/dist/lib/openejb-client-4.5.2.jar]: updateAvailable=false,lastModified=Thu Dec 12 20:23:23 BRST 2013,length=318492
CacheEntry[file:/C:/Desenv/Projetos/workspace_beta02/Tedros-Box/dist/lib/javaee-api-6.0-5.jar]: updateAvailable=false,lastModified=Thu Dec 12 20:23:20 BRST 2013,length=989597
CacheEntry[file:/C:/Desenv/Projetos/workspace_beta02/Tedros-Box/dist/lib/org.eclipse.persistence.jpars.source_2.4.1.v20121003-ad44345.jar]: updateAvailable=false,lastModified=Thu Dec 12 20:23:23 BRST 2013,length=65144
CacheEntry[file:/C:/Desenv/Projetos/workspace_beta02/Tedros-Box/dist/lib/spring-beans-3.0.7.RELEASE.jar]: updateAvailable=false,lastModified=Thu Dec 12 20:23:23 BRST 2013,length=563508
CacheEntry[file:/C:/Desenv/Projetos/workspace_beta02/Tedros-Box/dist/lib/org.eclipse.persistence.jpars_2.4.1.v20121003-ad44345.jar]: updateAvailable=false,lastModified=Thu Dec 12 20:23:23 BRST 2013,length=93694
CacheEntry[file:/C:/Desenv/Projetos/workspace_beta02/Tedros-Box/dist/lib/eclipselink.jar]: updateAvailable=false,lastModified=Thu Dec 12 20:23:19 BRST 2013,length=8449501
JNLP
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0" xmlns:jfx="http://javafx.com" href="Tedros-Box.jnlp">
<information>
<title>Tedros-Box</title>
<vendor>Davis Gordon</vendor>
<description>null</description>
<offline-allowed/>
</information>
<resources>
<jfx:javafx-runtime version="2.2+" href="http://javadl.sun.com/webapps/download/GetFile/javafx-latest/windows-i586/javafx2.jnlp"/>
</resources>
<resources>
<j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se"/>
<jar href="Tedros-Box.jar" size="200921" download="eager" />
<jar href="lib/App-Painel-Controle.jar" size="141981" download="eager" />
<jar href="lib/Tedros-App-API.jar" size="116706" download="eager" />
<jar href="lib/Tedros-Core-EjbClient.jar" size="5185" download="eager" />
<jar href="lib/Tedros-Core-Model.jar" size="47516" download="eager" />
<jar href="lib/Tedros-Core.jar" size="108000" download="eager" />
<jar href="lib/Tedros-DataAccess-Model-API.jar" size="13588" download="eager" />
<jar href="lib/Tedros-DataAccess-Server-API.jar" size="32124" download="eager" />
<jar href="lib/Tedros-Exception.jar" size="2624" download="eager" />
<jar href="lib/Tedros-FXComponents.jar" size="282972" download="eager" />
<jar href="lib/Tedros-Util.jar" size="15348" download="eager" />
<jar href="lib/commons-collections-3.2.1.jar" size="583672" download="eager" />
<jar href="lib/commons-lang3-3.1.jar" size="319222" download="eager" />
<jar href="lib/eclipselink-jpa-modelgen_2.4.1.v20121003-ad44345.jar" size="12387" download="eager" />
<jar href="lib/eclipselink.jar" size="8449501" download="eager" />
<jar href="lib/javaee-api-6.0-5.jar" size="989597" download="eager" />
<jar href="lib/javax.persistence_2.0.4.v201112161009.jar" size="128747" download="eager" />
<jar href="lib/jfxrt.jar" size="15117378" download="eager" />
<jar href="lib/openejb-client-4.5.2.jar" size="318492" download="eager" />
<jar href="lib/org.eclipse.persistence.jpars.source_2.4.1.v20121003-ad44345.jar" size="65144" download="eager" />
<jar href="lib/org.eclipse.persistence.jpars_2.4.1.v20121003-ad44345.jar" size="93694" download="eager" />
<jar href="lib/spring-beans-3.0.7.RELEASE.jar" size="563508" download="eager" />
</resources>
<security>
<all-permissions/>
</security>
<applet-desc width="1280" height="760" main-class="com.javafx.main.NoJavaFXFallback" name="Tedros-Box" >
<param name="requiredFXVersion" value="2.2+"/>
</applet-desc>
<jfx:javafx-desc width="1280" height="760" main-class="com.tedros.Tedros" name="Tedros-Box" />
<update check="always" policy="always"/>
</jnlp>I could be wrong, but I don't think these aren't errors. These are just telling you where your jar files are coming from. In your case, they are coming from cached entries. You probably want to clear your cache. I do this by running javaws -uninstall and then javaws -clearcache
-
Problem in work list deployment
hi all,
i'm trying to deploy sample worklist given in {bpel_home}/samples/hw/worklistapp.
i need following information:
(i) what is the difference between worklistapp and worklistxpress?
(ii) ERROR:
BUILD is getting failed.error message is- "*Target `default' does not exist in this project*."
My build.xml file:
<?xml version="1.0"?>
<project default="default" basedir=".">
<property file="orabpel.properties" />
<property name="worklist.src.dir" value="${worklist.samples.dir}/src" />
<property name="worklist.classes.dir" value="${worklist.samples.dir}/classes" />
<property name="worklist.html.dir" value="${worklist.samples.dir}/public_html" />
<property name="worklist.config.dir" value="${worklist.samples.dir}/config" />
<path id="classpath">
<pathelement location="${orabpel.home}/system/services/lib/bpm-services.jar" />
<pathelement location="${orabpel.home}/lib/bpm-infra.jar" />
<pathelement location="${custom.classpath}" />
</path>
<property name="worklist.classpath" refid="classpath" />
<echo message="/////////////////////////////////////////////////////////////////" />
<echo message="// Build starting for worklistapp ..." />
<echo message="//" />
<echo message="// Classpath = ${worklist.classpath}"/>
<echo message="/////////////////////////////////////////////////////////////////" />
<!-- Start Deploy target for OC4J -->
<target name="deploy.oc4j" depends="validate.properties,worklist.ear">
<!-- Deploy hw_services.ear -->
<java jar="${j2ee.home}/admin.jar" dir="${j2ee.home}" fork="true">
<arg line="${oc4j.ormi.url} ${oc4j.admin.username} ${oc4j.admin.password} -deploy -file ${worklist.classes.dir}/customworklist.ear -deploymentName customapp -parent orabpel" />
</java>
<java jar="${j2ee.home}/admin.jar" dir="${j2ee.home}" fork="true">
<arg line="${oc4j.ormi.url} ${oc4j.admin.username} ${oc4j.admin.password} -bindWebApp customapp customworklist http-web-site /integration/customapp" />
</java>
</target>
<!-- End Deploy target for OC4J -->
<!-- Start Deploy target for IAS Mid-->
<target name="deploy.iasmid" depends="validate.properties,worklist.ear">
<condition property="dcmctl.command" value="dcmctl.sh">
<and>
<os family="unix"/>
</and>
</condition>
<condition property="dcmctl.command" value="dcmctl.bat">
<and>
<os family="windows"/>
</and>
</condition>
<exec executable="${ias.home}/dcm/bin/${dcmctl.command}" spawn="false">
<arg line="redeployApplication -v -f ${worklist.classes.dir}/customworklist.ear -a customapp -co ${ias.oc4j.instance}"/>
</exec>
</target>
<!-- End Deploy target for IAS Mid-->
<target name="worklist.compile">
<mkdir dir="${worklist.classes.dir}" />
<javac srcdir="${worklist.src.dir}" includes="**/*.java"
destdir="${worklist.classes.dir}" debug="true">
<classpath>
<pathelement path="${worklist.classpath}"/>
</classpath>
</javac>
</target>
<target name="worklist.war" depends="worklist.compile">
<copy file="${worklist.config.dir}/worklist-taglib.tld" tofile="${worklist.html.dir}/WEB-INF/worklist-taglib.tld"/>
<war compress="true" warfile="${worklist.classes.dir}/customworklist.war" webxml="${worklist.config.dir}/web.xml">
<fileset dir="${worklist.html.dir}">
<exclude name="**/web.xml"/>
</fileset>
<classes dir="${worklist.classes.dir}">
<exclude name="**/*.war"/>
</classes>
</war>
</target>
<target name="worklist.ear" depends="worklist.war">
<ear compress="true" earfile="${worklist.classes.dir}/customworklist.ear" appxml="${worklist.config.dir}/application.xml">
<fileset dir="${worklist.classes.dir}">
<include name="**/*.war"/>
<exclude name="**/*.ear"/>
</fileset>
</ear>
</target>
<target name="validate.properties">
<fail message="Orabpel home ${orabpel.home} is not valid" >
<condition>
<not>
<available file="${orabpel.home}/system" type="dir" />
</not>
</condition>
</fail>
<fail message="J2EE home ${j2ee.home} is not valid" >
<condition>
<not>
<available file="${j2ee.home}" type="dir" />
</not>
</condition>
</fail>
</target>
</project>
SHOULD ANYTHING BE CHANGED IN LINE 2?
<project default="default" basedir=".">
if i give any value in default=" value" the error will contain that value name in the error message
saying: target 'value' does not exist in this project
Properties file - 'orabpel.properties':
-->
orabpel.home=D:/product/10.1.3.1/OracleAS_1/bpel
j2ee.home=D:/product/10.1.3.1/OracleAS_1/bpel/system/appserver/oc4j/j2ee/home
#change custome path to include correct location of servlet.jar
#To add more jar use ";"
custom.classpath=${j2ee.home}/lib/servlet.jar
#location of worklist sample
worklist.samples.dir=${orabpel.home}/samples/hw/worklistapp
#Standalone OC4J related properties
oc4j.ormi.url=ormi://localhost:23791/
oc4j.admin.username=oc4jadmin
oc4j.admin.password=welcome1
#IAS midtier related properties
ias.home=c:/work/ias10-1-2
ias.oc4j.instance=OC4J_BPEL
(iii) what is the value for ias.home?
The oracle.home and java.home path is different from the default. so what should be the value of it?At the time of compilation gives error message "import javax.servlet.* is not a recognize package.You have to include servlet.jar or j2ee.jar in the classpath when compiling.
My JDK is :-j2sdk1.4.2_04
My Java Enviorment is:- Version 1.5.0 (build 1.5.0_04-b05)Why are the versions of your JDK and Java runtime environment different? Why are you not using Java 5 to compile and run everything?
Class Path=C:\j2sdk1.4.2_04\lib;C:\j2sdkee1.2.1\lib\j2ee.jar;C:\JSDK2.0\libIf this is an environment variable, it should be "classpath", not "Class Path" with a space in between. -
Use jdbc to connect servlet to oracle 8.1.6 database on win2k
The code is below:
package moreservlets;
import java.sql.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
/** Simple servlet used to test JDBC connection. */
public class TitleQueries extends HttpServlet {
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
String title = "Connecting to Database";
DriverManager.registerDriver (new
oracle.jdbc.driver.OracleDriver());
Connection conn = DriverManager.getConnection
("jdbc:oracle:thin:@pc840:1521:orcl", "scott", "tiger");
Statement stmt = conn.createStatement();
ResultSet rset = stmt.executeQuery
("select ename from emp");
while (rset.next()) {
String name = rset.getString("ename");
out.println(ServletUtilities.headWithTitle(title) +
"<body bgcolor=\"#FDF5E6\">\n" +
"<h1 align=\"center\">" + name + "</h1>\n" +
"</body></html>");
CLASSPATH=.;C:\J2ee;C:\j2sdkee1.3.1\lib\cloudscape;C:\Program Files\Apache Tomcat 4.0\common\lib\servlet.jar;C:\Oracle\Ora81\orb\classes\yoj.jar;C:\Oracle\Ora81\orb\classes\share.zip
My code cannot find the JDBC driver. Any suggestions?
Thanks.
I get the following errors:
C:\J2ee\moreservlets>javac -d "C:\Program Files\Apache Tomcat 4.0\webapps\ROOT\
EB-INF\classes" TitleQueries.java
TitleQueries.java:19: package oracle.jdbc.driver does not exist
oracle.jdbc.driver.OracleDriver());
^
TitleQueries.java:31: cannot resolve symbol
symbol : variable name
location: class moreservlets.TitleQueries
"<h1 align=\"center\">" + name + "</h1>\n" +
^
2 errorsI changed my classpath variable and my servlet
compiles okay with the:
"import oracle.jdbc.driver.*" statement.
However, I still get the following error.
Why can't it find the jdbc driver, since it finds the
import statement?
Apache Tomcat/4.0.3
Error loading driver: java.lang.ClassNotFoundException: oracle.jdbc.driver.Oracl
eDriver
WebappClassLoader: Resource '/WEB-INF/classes/moreservlets/ServletUtilities.cl
ass' was modified; Date is now: Tue Jul 02 09:57:26 CDT 2002 Was: Tue Jul 02 09:
37:20 CDT 2002
Error loading driver: java.lang.ClassNotFoundException: oracle.jdbc.driver.Oracl
eDriver
CLASSPATH=.;C:\J2ee;C:\j2sdkee1.3.1\lib\cloudscape\RmiJdbc;C:\Program Files\Apache Tomcat 4.0\common\lib\servlet.jar;C:\Oracle\Ora81\jdbc\lib\classes12.zip;C:\Oracle\Ora81\orb\classes\yoj.jar;C:\Program Files\Oracle\JDeveloper 3.2.3\jdbc\lib\oracle8.1.7\classes12.zip;C:\Oracle\Ora81\orb\classes\share.zip
//code begins here
package moreservlets;
import java.sql.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import oracle.jdbc.driver.*;
public class TitleQueries extends HttpServlet {
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn = DriverManager.getConnection
("jdbc:oracle:thin:@pc840:1521:orcl", "scott", "tiger");
Statement stmt = conn.createStatement();
ResultSet rset = stmt.executeQuery
("select * from emp");
out.println(ServletUtilities.headWithTitle(title) +
"<body bgcolor=\"#FDF5E6\">");
while (rset.next()) {
out.println("<h1 align=\"center\">"
+ rset.getString("ename") + "</h1>\n");
out.println("</body></html>");
catch(ClassNotFoundException cnfe) {
System.err.println("Error loading driver: " + cnfe);
catch(SQLException sqle) {
System.err.println("Error connecting: " + sqle);
} -
Problem in Servlet Compilation & Deployment
Hi Friends,
I have problem regarding Servlet Compilation & Deployment.
At the time of compilation gives error message "import javax.servlet.* is not a recognize package.
My J2ee Server gives FATAL Error it says it should be work on JDK1.2 or later.
My JDK is :-j2sdk1.4.2_04
MY J2EE Server is:-j2sdkee1.2.1
My Servlet Runner is:-JSDK2.0
My Java Enviorment is:- Version 1.5.0 (build 1.5.0_04-b05)
Path setting is:-
Class Path=C:\j2sdk1.4.2_04\lib;C:\j2sdkee1.2.1\lib\j2ee.jar;C:\JSDK2.0\lib
CommonProgramFiles=C:\Program Files\Common Files
COMPUTERNAME=DCL-04
ComSpec=C:\WINNT\system32\cmd.exe
Please help me and give the desired result as soon as you all can
Your's Harish
ThanksAt the time of compilation gives error message "import javax.servlet.* is not a recognize package.You have to include servlet.jar or j2ee.jar in the classpath when compiling.
My JDK is :-j2sdk1.4.2_04
My Java Enviorment is:- Version 1.5.0 (build 1.5.0_04-b05)Why are the versions of your JDK and Java runtime environment different? Why are you not using Java 5 to compile and run everything?
Class Path=C:\j2sdk1.4.2_04\lib;C:\j2sdkee1.2.1\lib\j2ee.jar;C:\JSDK2.0\libIf this is an environment variable, it should be "classpath", not "Class Path" with a space in between. -
I am trying to compile a java servlet in a Win2000 prof
My home drive is d:\, because I have another drive c:\, that has Win95.
I recently downloaded JDK1.3.1_02 and J2EE1.3.1. I followed the instructions carefully. My env are
J2EE_HOME=d:\j2sdkee1.3.1
JAVA_HOME=d:\jdk1.3.1_02
PATH=D:\WINNT\system32;D:\WINNT;D:\WINNT\System32\Wbem;d:\jdk1.3.1_02\bin;d:\j2sdkee1.3.1\bin;d:\j2sdkee1.3.1\lib;
(I am aware that lib is not required here in the PATH)
I am able to compile a simple java program. However I am not able to compile the following servlet program. I am getting the error
package javax.servlet does not exist
import javax.servlet.*;
and few more errors(which is basically related to the non-availability of the package)
Please help me and thanks for your time.
The complete source code is
import javax.servlet.*;
import javax.servlet.http.*;
public class Courses extends HttpServlet {
public void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, java.io.IOException {
resp.setContentType("text/html");
java.io.PrintWriter out = resp.getWriter();
out.println("<html><head>");
out.println("<title> Trident </Title></head>");
String values[];
values = req.getParameterValues("Name");
String name = " ";
if (values != null) {
name = values[0];
else {
name = "Friend";
out.println("<b> Dear " + name+",here are the course details </b>");
out.println("</html>");
out.flush();I am trying to compile a java servlet in a Win2000 prof using jdk 1.4.0 and I got the same message - javax.servlet does not exist.
I have apache tomat 4.0 installed on my machine and my classpath is
.;d:\jtest;c:\Program_Files\Apache_Tomcat_4.0\common\lib\servlet.jar;c:\s2jdk1.4.0_01\bin;
I compile the servlet program in d:\jtest\HelloServlet.java:
javac -classpath c:\program_files\apache_tomcat4.0\common\lib\servlet.jar HelloServlet.java
I am not sure why I got the javax.servlet does not exist message.
Can you help?
Thanks. -
Trouble compiling Servlets... simple problem?
PATH: %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\PROGRA~1\ULTRAE~1;C:\j2sdk1.4.0\bin;C:\j2sdkee1.3.1\bin
CLASSPATH: C:\j2sdkee1.3.1\lib\j2ee.jar;C:\j2sdkee1.3.1\lib\j2eetool.jar
Yet for some reason I can't compile anything using the servlet packages. I had been able to compile in the past, but I added a new value to the PATH and CLASSPATH variables to try to get Tomcat4.0.1 to work, and then this morning I ceased to be able to compile. So I went back to my old values and can't compile! (DataServlet.java:3: package javax.servlet does not exist
import javax.servlet.*; )
Please help. Thank you.Ok, I just wrote this post, closed the command prompt I was trying to compile in, reopened another, and tried to compile again and it worked. Can someone tell me what this is about?
Maybe you are looking for
-
RMAN duplicate target database from active database - performance problem
Hello. I'm running into a major performance problem when trying to duplicate a database from a target located inside our firewall to an auxiliary located outside our firewall. Both target and auxiliary are located in the same equipment room just on d
-
Hello, Here is the context : - The DB (10.2) is in production. I can not disable/drop/alter constraints - I have to reinject thousands of rows from another DB through database link but some of thoses lines may be rejected by the primary key / unique
-
Mouse or trackpad doesn't work
My wife's 13" Mac Book Pro has developed an issue I've never seen before. She did a software update two days ago and she says the computer has been freezing and not performing as well as before the update. Today, she's got a non functioning mouse and
-
I want to be able to convert PDFs into another format and I know this can be achieved with a small upgrade. However I am also looking for the ability to compress the size of PDFs, if this is at all possible.
-
How to filter standard ALV report with custom UI element?
Hello Expert, I got a requirement to filter standard ALV report based on the custom UI element (which is created in the screen before displaying the ALV report). Upon entering the values in the Custom field, the ALV report is displayed accordingly. A