Servlets vs JDK
Hi,
I have a servelt java file and when i try to compile its giving the following error:
C:\Shopping1\WEB-INF\classes\BookShoppingServlet.java:7: package javax.servlet does not exist
import javax.servlet.*;
I dont what JDK version i need to compile Servlets. I have JDK1.3 on the system. Plz let me know what version is required to compile Servlets.
Vamsi
The Servlet API is part of J2EE. Either you need this addtionally to the J2SE, or loook for it with the servlet engine you are going to use.
Similar Messages
-
Hi oracle team,
I have a servlet in jdev903 run is OK but to deploy 9iAS
903 ocour 500 Internal Server Error
java.lang.UnsupportedClassVersionError: request/Servlet2 (Unsupported major.minor version 48.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:488)
is 9ias bug?
package request;
import javax.servlet.ServletException;
import javax.servlet.http.*;
import java.io.PrintWriter;
import java.io.IOException;
public class Servlet1 extends HttpServlet
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<head><title>Servlet1</title></head>");
out.println("<body>");
out.println("<p>The servlet has received a GET. This is the reply.</p>");
out.println("</body></html>");
out.close();You should recompile your servlet against JDK 1.3, not JDK 1.4 (or upgrade your iAS to 9.0.4)
[JDK 1.4 uses class file version 48.0]
Rob
Team JDev -
Running xsql pages in oracle 8.1.5
Hi,
I would like to use xsql with the oracle product I 've got:
- Oracle 8i (8.1.5)
or - OAS 4.0.7.1
Apparently, I need to process some changes before to run xsql pages with the http server of Oracle 8.1.5 for example.
I read that xsql servlet need jdk 1.1.8 or above and a servlet engine to work fine in Oracle 8i.
So, it seems I need to update my oracle 8.1.5 with jdk 1.1.8 and a servlet engine.
What are the steps to follow to configure correctly Oracle 8.1.5 to make it able to run xsql pages?
Thanks for your help<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Steve Muench ([email protected]):
Step 1: Get a servlet engine
The XSQL Release notes list all the
servlet engines that are supported.
Step 2: Follow the installation instructions in the release note.
Several of the most popular servlet engines are listed there.
You won't be running the XSQL Page processor inside the Database in 8.1.5, so the JDK version of 1.1.8 refers to the JDK ver of
your servlet engine.<HR></BLOCKQUOTE>
Thanks for your reply.
So, there is no way to run xsql pages with Oracle 8.1.5.
I must necessarly acquire a servlet engine.Isn't it?
OAS 4.0.7.1 doesn't include servlet engine?
Thanks
null -
Oracle drivers not found by servlets after upgrade of JDK
I am using jakarta-tomcat 4.0.1 with WIN2K.
After a recent upgrade to jdk 1.4.0_02 from jdk1.3.1, servlets that try to use oracle crash with this error:
java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleDriver
at ProductLookup.loadJDBCDriver(ProductLookup.java:23)
the code at line 23 is:
DriverManager.registerDriver ( new oracle.jdbc.driver.OracleDriver());
This all worked prior to the upgrade of jdk.
The code at line 23 does work using the command line.
I did check the ENVIRONMENT VARIABLES - in my limitted knowledge they look OK. But I am sure there MUST be something missing &/or incorrect.
During execution, the servlet is just not finding "something".
I am relatively new to JAVA and especially new to servlets.
What should I look for to solve this problem?
TIA
WalkGoodThe oracle drivers are in a file called classes12.zip.
Make sure that you unzip these files to where the
servlets can find them.
%TOMCAT_HOME%\common\classes
or
%TOMCAT_HOME%\classes
or
%TOMCAT_HOME\webapps\{app name}\WEB-INF\classesIs %TOMCAT_HOME% an environment variable? I have one called CATALINA_HOME. It is set the jakarta folder "C:\jakarta-tomcat-4.0.1"
Something I noticed: If I execute tomcat "startup.bat" in a command prompt window, I see echo'd messages. One says "Using CLASSPATH: C:\jakarta-tomcat-4.0.1\bin\bootstarp.jar;C:\jakarta-tomcat-4.0.1\lib\tools.jar" but this NOT match the Environment Variable "classpath" which does specify the path to the classes12.zip folder. Should the "catalina.bat" file assemble the classpath to include the same Environment Variable "classpath" in addition to bootstrap.jar and tools.jar?
Where can I find specific documentation on how to setup the environment for jakarta-tomcat to find the ORACLE drivers during execution of a servlet?
TIA
WalkGood -
Is it necessary JDK to execute a servlet??
Hi!
I'm trying to carry out 5 servlets (they use XML).
By the moment and while developing, I'm using JDK 1.3 + Tomcat + Xerces, on Windows NT 4.0
But I want to install it on other Windows PCs, and I wonder if it is necessary to install JDK, or it's enough with JRE.
I would like also to know if there is another kind of Free Java Web Server, appart from Tomcat, or a system wasting less resources.
Thank you very much, and best regards.The JDK is used mostly for JSP's as these need to be compiled on demand.
Servlets are precompiled and don't require a jdk but still need the jre.
As for other free webservers, I noticed a webserver called WASP. I haven't tried it as yet but if you want to give it a go try:
http://www.systinet.com/products/wasp_lite/
Cheers,
Anthony -
How do I develop a servlet for different versions of the JDK?
This is my first post here so I hope this is the appropriate forum...
I am developing a servlet on my local machine set up with :-
Windows XP Pro SP2
J2SE 1.50
Tomcat 5.5.4
However, one of the hosts where I need to use the servlet has :-
J2EE 1.4 SDK
Tomcat 4.1.29
I have installed JDK 1.4.2_06 but need to access the servlet api jar (servlet-api.jar) to compile against otherwise I get errors such as:
FirstServlet.java:4: package javax.servlet does not exist
import javax.servlet.*;
The servlet api jar I use when compiling with J2SE 1.50 is in "C:\Tomcat\Tomcat 5.5\common\lib\servlet-api.jar".
My question is where can I obtain a servlet api jar to compile against for use under J2EE 1.4 SDK / Tomcat 4.1.29 - i.e. do I need to install the relevant version of Tomcat or is the jar available seperately?
Any help much appreciated."My question is where can I obtain a servlet api jar to compile against for use under J2EE 1.4 SDK / Tomcat 4.1.29 - i.e. do I need to install the relevant version of Tomcat or is the jar available seperately?"
you can download it seperately from java servlets website
http://java.sun.com/products/servlet/download.html
you should download the tomcat version you are hosting your code
with to ensure full compatability
i think it is called servlet.jar not servlet-api.jar in older tomcats -
Servlet.jar not in jdk 1.3.1?
I've always added servlet.jar into the classpath when compiling servlets and it worked fine until i upgraded to jdk1.3 which dosent come with a servlet.jar and cant find javax.servlet classes normally- so what do i have to do then besides finding my old servlet.jar file? what are the javax.servlet classes hidden in for jdk13?
You can download the J2EE add-on to the JDK1.3.
That will have the javax.servlet
--lichu -
Servlet compatible to JDK 1.5
Hi all,
I am working on a web application, which is supposed to be migrated from Java Version 1.3 to 5.0.
I compiled all the Java classes with 5.0 compiler, but it fails to compile a class which uses Enumeration as it is not included in JDK 5.0.
I have the following piece of code. What modifications I need to make to make it worked in Java 5.0
// request is of type HTTPRequest
Enumeration en = request.getParameterNames();
while (en.hasMoreElements()) {
String key = (String) en.nextElement();
Please share your opinions.
Thanks & regards,
KetanEnumeration class is there in java 5. Make sure that you have imported the java.util package.
What is the compiler error message that you are getting -
JRE/JDK Problem with Applet/Servlet scenario
Hi there!
I'am forced by my company to upgrade an old Java application. The situation is, that an signed applet calls several servlets (running on Tomcat 4.x or 5.x) over http(s).
In former times both, servlet container and applet, were using jre 1.4.1.x
(The servlet container was ServletExec, so a jre was sufficient).
Everything was working fine, if the client was using the 1.4.1 jre.
But on later versions (1.4.2.x) the whole Applet-jar was downloaded from the server per user interaction, whats definitly not acceptable as customers still using isdn or nowadays umts.
Any sugesstions?
Thanks
BuzzDouble Posted:
http://forum.java.sun.com/thread.jsp?thread=553517&forum=33&message=2709389
And the answer is the same. You will have to open multiple connections. One for each time want to send data to the Servlet, because that is how HTTP works.
Try a simple case, where you want to send a single object through to the Servlet, then read the response.
When that works, repeat it for every subsequent time you want to send or recieve data.
If you want to have continuous communication between the server and the client, you do not want to use HTTP. -
XSQL Servlet Version 1.0.0.0 with ServletExec 3.0 on Windows2000 IIS 5
I am attempting to establish an XML connection to Oracle 8i in a Windows2000 IIS 5 environment. The .xsql/index.htm loads perfectly, but when i try to run helloworld, I recieve the following error.
"The XML page cannot be displayed
Reference to undeclared namespace prefix: :'xsql'. Line 2 position 13
<xsql:query>"
The other examples load up the HTML but do not load any of the active XSQL information.
Configuration:
I have installed Suns JDK 1.2.2 and JRE 2, ServletExec 3.0 on a windows2000 box running IIS 5. ServletExec seems to be functioning perfectly. I installed the Oracle Servlet 1.0.0.0 by configuring ServletExec's ClassPath, Alias, and Servlet Configuration, mapped the .xsql extension to the servlet, and setup the XSQL virtual directory according to the documentation. I am trying to connect to to an external Oracle 8i database, and have adjusted the parameters in the XSQLConfig.xml accordingly.
nullThe helloworld example doesn't work in XSQL 102. Tested using xsql command with http url. See below. If I put xsql: in front of connection in helloworld.xsql, the error moves from column 13 to 36, so now the trouble lies with xmlns:xsql="urn:oracle-xsql". What has changed? How do we solve this?
C:\xsql\bin>dir c:\xsql\demo\helloworld\helloworld.xsql
Volume in drive C has no label.
Volume Serial Number is 24CD-3B6C
Directory of c:\xsql\demo\helloworld
08/03/2000 03:20p 306 helloworld.xsql
1 File(s) 306 bytes
0 Dir(s) 4,499,296,256 bytes free
C:\xsql\bin>xsql file:///c:/xsql/demo/helloworld/helloworld.xsql
<?xml version = '1.0'?>
<!--
| $Author: smuench $
| $Date: 2000/03/08 23:20:17 $
| $Source: C:\\cvsroot/xsql/src/demo/helloworld/helloworld.xsql,v $
| $Revision: 1.1 $
+-->
<ROWSET>
<ROW num="1">
<GREETING>Hello World</GREETING>
</ROW>
</ROWSET>
C:\xsql\bin>xsql http://aetius/xsql/demo/helloworld/helloworld.xsql
Oracle XSQL Command Line Page Processor 1.0.2.0 (Production)
XSQL-005: XSQL page is not well-formed.
XML parse error at line 2, char 13
Namespace prefix 'xsql' used but not declared.
C:\xsql\bin> -
HTTPS from JDK1.2.1 to JDK 1.4.1
We are trying to connect application running on JDK1.2.1 to application in JDK 1.4.1. Both applications are in Oracle 9ias application server but with different JDK and different physical machines.
We are getting following error while trying to access to application on JDK 1.4.1
java.lang.ArrayStoreException
at java.lang.System.arraycopy(System.java)
at java.util.Vector.copyInto(Vector.java)
at com.sun.net.ssl.internal.www.protocol.https.ChunkedInputStream.c(DashoA6275)
at
com.sun.net.ssl.internal.www.protocol.https.ChunkedInputStream.<init>(DashoA6275
at com.sun.net.ssl.internal.www.protocol.https.HttpClient.b(DashoA6275)
at com.sun.net.ssl.internal.www.protocol.https.HttpClient.a(DashoA6275)
at
com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnection.getInputStream(Da
shoA6275)
at Perc939CallServlet.callServlet(Perc939CallServlet.java:103)
We are using Entrust certificate and we already put cacerts file from jdk1.4 to jdk1.2.1 in jdk/jre/lib/security.
This application was working till we upgraded version from 1.3.1 to 1.4.1.
Is this is problem of 1.4.1 and how do we resolve this?
Small code that will help is as follows
//Dynamic registration of SunJSSE provider
System.setProperty("java.protocol.handler.pkgs","com.sun.net.ssl.internal.www.protocol");
Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
System.setProperty("ssl.SocketFactory.provider", "com.sun.net.ssl.internal.ssl.Provider");
//Create a URL object from the sURL String representation.
uRemoteURL = new URL(sURL);
//Get a connection to the remote object referred to by the URL
ucConn = uRemoteURL.openConnection();
//Set the DoOutput flag to true to use the URL connection for output
ucConn.setDoOutput(true);
ucConn.setRequestProperty("Pragma", "no-cache");
oosToWrite = new ObjectOutputStream(ucConn.getOutputStream());
//Write sInputString to the OutputStream which will be read from the remote servlet
oosToWrite.writeObject(sInputString);
oosToWrite.flush();
oosToWrite.close();
ucConn.connect();
System.out.println("Connection " + ucConn.toString());
if(ucConn==null)
System.out.println("Connection is Null");
System.out.println("getInputStream " + ucConn.getInputStream());
if(ucConn.getInputStream()==null)
System.out.println("ucConn.getInputStream() is Null");
// Read the string object from the InputStream and return
oisToRead = new ObjectInputStream(ucConn.getInputStream());
Object oReadObject = oisToRead.readObject();
sOutputString = oReadObject.toString();
oisToRead.close();
return (sOutputString);Basically ArrayStoreException comes :
Indicate that an attempt has been made to store the wrong type of object into an array of objects.
But in jdk1.4.1 it is said that
No usage of java.lang.ArrayStoreException
it may be problem of jdk1.4.1 and try to upgrade to 1.4.2
Regards,
Anand -
Problem:Accessing the file system with servlets ???
Hi...
I have a strange problem with my servlets that run on Win2000 with Apache and 2 Tomcat instances.
I cannot open files through servlets whereas exactly the same code lines work in local standalone java programm.
It seems to be somehting like a rights problem...but I dont know what to do.
thanks for any help
here are my configuration files for Apache and Tomcat:
Apache: *******************************************************
### Section 1: Global Environment
ServerRoot "D:/Webserver_and_Applications/Apache2"
PidFile logs/httpd.pid
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
<IfModule mpm_winnt.c>
ThreadsPerChild 250
MaxRequestsPerChild 0
</IfModule>
Listen 80
LoadModule jk_module modules/mod_jk.dll
JkWorkersFile conf/workers.properties
JkLogFile logs/mod_jk.log
JkLogLevel info
LoadModule access_module modules/mod_access.so
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_module modules/mod_auth.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
LoadModule imap_module modules/mod_imap.so
LoadModule include_module modules/mod_include.so
LoadModule isapi_module modules/mod_isapi.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule userdir_module modules/mod_userdir.so
### Section 2: 'Main' server configuration
ServerAdmin [email protected]
ServerName www.testnet.com:80
UseCanonicalName Off
DocumentRoot "D:/Webserver_and_Applications/root"
JkMount /*.jsp loadbalancer
JkMount /servlet/* loadbalancer
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory "D:/Webserver_and_Applications/root">
Order allow,deny
Allow from all
</Directory>
UserDir "My Documents/My Website"
DirectoryIndex index.html index.html.var
AccessFileName .htaccess
<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>
TypesConfig conf/mime.types
DefaultType text/plain
<IfModule mod_mime_magic.c>
MIMEMagicFile conf/magic
</IfModule>
HostnameLookups Off
ErrorLog logs/error.log
LogLevel warn
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
CustomLog logs/access.log common
ServerTokens Full
ServerSignature On
Alias /icons/ "D:/Webserver_and_Applications/Apache2/icons/"
<Directory "D:/Webserver_and_Applications/Apache2/icons">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Alias /manual "D:/Webserver_and_Applications/Apache2/manual"
<Directory "D:/Webserver_and_Applications/Apache2/manual">
Options Indexes FollowSymLinks MultiViews IncludesNoExec
AddOutputFilter Includes html
AllowOverride None
Order allow,deny
Allow from all
</Directory>
ScriptAlias /cgi-bin/ "d:/webserver_and_applications/root/cgi-bin/"
<Directory "D:/Webserver_and_Applications/root/cgi-bin/">
AllowOverride None
Options Indexes FollowSymLinks MultiViews
Order allow,deny
Allow from all
</Directory>
IndexOptions FancyIndexing VersionSort
AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip
AddIconByType (TXT,/icons/text.gif) text/*
AddIconByType (IMG,/icons/image2.gif) image/*
AddIconByType (SND,/icons/sound2.gif) audio/*
AddIconByType (VID,/icons/movie.gif) video/*
AddIcon /icons/binary.gif .bin .exe
AddIcon /icons/binhex.gif .hqx
AddIcon /icons/tar.gif .tar
AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
AddIcon /icons/a.gif .ps .ai .eps
AddIcon /icons/layout.gif .html .shtml .htm .pdf
AddIcon /icons/text.gif .txt
AddIcon /icons/c.gif .c
AddIcon /icons/p.gif .pl .py
AddIcon /icons/f.gif .for
AddIcon /icons/dvi.gif .dvi
AddIcon /icons/uuencoded.gif .uu
AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
AddIcon /icons/tex.gif .tex
AddIcon /icons/bomb.gif core
AddIcon /icons/back.gif ..
AddIcon /icons/hand.right.gif README
AddIcon /icons/folder.gif ^^DIRECTORY^^
AddIcon /icons/blank.gif ^^BLANKICON^^
DefaultIcon /icons/unknown.gif
IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t
AddEncoding x-compress Z
AddEncoding x-gzip gz tgz
AddLanguage da .dk
AddLanguage nl .nl
AddLanguage en .en
AddLanguage et .et
AddLanguage fr .fr
AddLanguage de .de
AddLanguage he .he
AddLanguage el .el
AddLanguage it .it
AddLanguage ja .ja
AddLanguage pl .po
AddLanguage ko .ko
AddLanguage pt .pt
AddLanguage nn .nn
AddLanguage no .no
AddLanguage pt-br .pt-br
AddLanguage ltz .ltz
AddLanguage ca .ca
AddLanguage es .es
AddLanguage sv .se
AddLanguage cz .cz
AddLanguage ru .ru
AddLanguage tw .tw
AddLanguage zh-tw .tw
AddLanguage hr .hr
LanguagePriority en da nl et fr de el it ja ko no pl pt pt-br ltz ca es sv tw
ForceLanguagePriority Prefer Fallback
AddDefaultCharset ISO-8859-1
AddCharset ISO-8859-1 .iso8859-1 .latin1
AddCharset ISO-8859-2 .iso8859-2 .latin2 .cen
AddCharset ISO-8859-3 .iso8859-3 .latin3
AddCharset ISO-8859-4 .iso8859-4 .latin4
AddCharset ISO-8859-5 .iso8859-5 .latin5 .cyr .iso-ru
AddCharset ISO-8859-6 .iso8859-6 .latin6 .arb
AddCharset ISO-8859-7 .iso8859-7 .latin7 .grk
AddCharset ISO-8859-8 .iso8859-8 .latin8 .heb
AddCharset ISO-8859-9 .iso8859-9 .latin9 .trk
AddCharset ISO-2022-JP .iso2022-jp .jis
AddCharset ISO-2022-KR .iso2022-kr .kis
AddCharset ISO-2022-CN .iso2022-cn .cis
AddCharset Big5 .Big5 .big5
AddCharset WINDOWS-1251 .cp-1251 .win-1251
AddCharset CP866 .cp866
AddCharset KOI8-r .koi8-r .koi8-ru
AddCharset KOI8-ru .koi8-uk .ua
AddCharset ISO-10646-UCS-2 .ucs2
AddCharset ISO-10646-UCS-4 .ucs4
AddCharset UTF-8 .utf8
AddCharset GB2312 .gb2312 .gb
AddCharset utf-7 .utf7
AddCharset utf-8 .utf8
AddCharset big5 .big5 .b5
AddCharset EUC-TW .euc-tw
AddCharset EUC-JP .euc-jp
AddCharset EUC-KR .euc-kr
AddCharset shift_jis .sjis
AddType application/x-tar .tgz
AddType image/x-icon .ico
AddHandler type-map var
BrowserMatch "Mozilla/2" nokeepalive
BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
BrowserMatch "RealPlayer 4\.0" force-response-1.0
BrowserMatch "Java/1\.0" force-response-1.0
BrowserMatch "JDK/1\.0" force-response-1.0
BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
BrowserMatch "^WebDrive" redirect-carefully
BrowserMatch "^WebDAVFS/1.[012]" redirect-carefully
<IfModule mod_ssl.c>
Include conf/ssl.conf
</IfModule>
ScriptAlias /php/ "d:/webserver_and_applications/php/"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php.exe"
Tomcat:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
<Server port="11005" shutdown="SHUTDOWN" debug="0">
<!-- Define the Tomcat Stand-Alone Service -->
<Service name="Tomcat-Standalone">
<!-- Define an AJP 1.3 Connector on port 11009 -->
<Connector className="org.apache.ajp.tomcat4.Ajp13Connector"
port="11009" minProcessors="5" maxProcessors="75"
acceptCount="10" debug="0"/>
<!-- Define the top level container in our container hierarchy -->
<Engine jvmRoute="tomcat1" name="Standalone" defaultHost="localhost" debug="0">
<!-- Global logger unless overridden at lower levels -->
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="catalina_log." suffix=".txt"
timestamp="true"/>
<!-- Because this Realm is here, an instance will be shared globally -->
<Realm className="org.apache.catalina.realm.MemoryRealm" />
<!-- Define the default virtual host -->
<Host name="localhost" debug="0" appBase="webapps" unpackWARs="true">
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs" prefix="localhost_access_log." suffix=".txt"
pattern="common"/>
<Logger className="org.apache.catalina.logger.FileLogger"
directory="logs" prefix="localhost_log." suffix=".txt"
timestamp="true"/>
<!-- Tomcat Root Context -->
<Context path="" docBase="d:/webserver_and_applications/root" debug="0"/>
<!-- Tomcat Manager Context -->
<Context path="/manager" docBase="manager"
debug="0" privileged="true"/>
<Context path="/examples" docBase="examples" debug="0"
reloadable="true" crossContext="true">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="localhost_examples_log." suffix=".txt"
timestamp="true"/>
<Ejb name="ejb/EmplRecord" type="Entity"
home="com.wombat.empl.EmployeeRecordHome"
remote="com.wombat.empl.EmployeeRecord"/>
<Environment name="maxExemptions" type="java.lang.Integer"
value="15"/>
<Parameter name="context.param.name" value="context.param.value"
override="false"/>
<Resource name="jdbc/EmployeeAppDb" auth="SERVLET"
type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/EmployeeAppDb">
<parameter><name>user</name><value>sa</value></parameter>
<parameter><name>password</name><value></value></parameter>
<parameter><name>driverClassName</name>
<value>org.hsql.jdbcDriver</value></parameter>
<parameter><name>driverName</name>
<value>jdbc:HypersonicSQL:database</value></parameter>
</ResourceParams>
<Resource name="mail/Session" auth="Container"
type="javax.mail.Session"/>
<ResourceParams name="mail/Session">
<parameter>
<name>mail.smtp.host</name>
<value>localhost</value>
</parameter>
</ResourceParams>
</Context>
</Host>
</Engine>
</Service>
<!-- Define an Apache-Connector Service -->
<Service name="Tomcat-Apache">
<Engine className="org.apache.catalina.connector.warp.WarpEngine"
name="Apache" debug="0">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="apache_log." suffix=".txt"
timestamp="true"/>
</Engine>
</Service>
</Server>
*** and here is my workers.properties : *******************************
# workers.properties
# In Unix, we use forward slashes:
ps=/
# list the workers by name
worker.list=tomcat1, tomcat2, loadbalancer
# First tomcat server
worker.tomcat1.port=11009
worker.tomcat1.host=localhost
worker.tomcat1.type=ajp13
# Specify the size of the open connection cache.
#worker.tomcat1.cachesize
# Specifies the load balance factor when used with
# a load balancing worker.
# Note:
# ----> lbfactor must be > 0
# ----> Low lbfactor means less work done by the worker.
worker.tomcat1.lbfactor=100
# Second tomcat server
worker.tomcat2.port=12009
worker.tomcat2.host=localhost
worker.tomcat2.type=ajp13
# Specify the size of the open connection cache.
#worker.tomcat2.cachesize
# Specifies the load balance factor when used with
# a load balancing worker.
# Note:
# ----> lbfactor must be > 0
# ----> Low lbfactor means less work done by the worker.
worker.tomcat2.lbfactor=100
# Load Balancer worker
# The loadbalancer (type lb) worker performs weighted round-robin
# load balancing with sticky sessions.
# Note:
# ----> If a worker dies, the load balancer will check its state
# once in a while. Until then all work is redirected to peer
# worker.
worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=tomcat1, tomcat2
# END workers.properties
thanks againHi joshman,
no I didn't get error messages as the relevant lines for reading/writing where between try statements, but you were where right it was/is just a simple path problem.
I expected the refering directory without using a path to be the directory where the servlet is in, but it is not !!??
Do you know if I set this in the setclasspath.bat of tomcat ?
*** set JAVA_ENDORSED_DIRS=%BASEDIR%\bin;%BASEDIR%\common\lib ***
thanks again
Huma -
Help needed on Servlets and JSTL
Hi
I am using tomcat 5.5 and JDK 1.5. What are the softwares I have to download for compiling servlets and creating JSTL ?. Help needed.
Thanks
IndyaRajaI tried compling servlet, but it is raising error
that coul not find package javax.servletWhat I did not mention... you need to add those JARs in the Classpath explicitly. You will find them in %TOMCAT_HOME%\common\lib. You atleast need to add servlet-api.jar to your Classpath. :) -
hi,
I install Occas on OS win7 64bit, jdk 1.6.0.45.
I got the following error message while I start Occas server:
because error occurs when parsing sip related annotations of "testservicecomplexobject-application"
WLST-WLS-1396579151484: com.bea.wcp.sip.engine.server.setup.SipAnnotationParsingException
at com.bea.wcp.sip.engine.server.setup.SipAnnotationData.<init><SipAnnotationData.java:155>
Also, when I deploy a sip servlet package(sar) to the Occas server, after deploy finish, at the deployment manager page,
health term is none.
and also I found many error info in AdminServer/logs/domain.log as below blue font:
####<Apr 4, 2014 11:09:21 AM CST> <Error> <WLSS.Setup> <E76C3BE51B4188> <AdminServer> <[ACTIVE] ExecuteThread: '5' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1396580961513> <BEA-331210> <Skip SIP related logic, because error occurs when parsing sip related annotations of "b2bua-sip-servlet-1.0.0-SNAPSHOT"
com.bea.wcp.sip.engine.server.setup.SipAnnotationParsingException:
at com.bea.wcp.sip.engine.server.setup.SipAnnotationData.<init>(SipAnnotationData.java:155)
at com.bea.wcp.sip.util.DeploymentUtil.getOrCreateAnnotationData(DeploymentUtil.java:74)
at com.bea.wcp.sip.util.DeploymentUtil.getAnnotationData(DeploymentUtil.java:89)
at com.bea.wcp.sip.engine.server.SipServerTailModule$1.visit(SipServerTailModule.java:129)
at com.bea.wcp.sip.engine.server.SipServerTailModule.visitAllContexts(SipServerTailModule.java:112)
at com.bea.wcp.sip.engine.server.SipServerTailModule.initialize(SipServerTailModule.java:137)
at com.bea.wcp.sip.engine.server.SipServerTailModule.prepare(SipServerTailModule.java:69)
at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:507)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:149)
at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:45)
at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:1221)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:367)
at weblogic.application.internal.SingleModuleDeployment.prepare(SingleModuleDeployment.java:43)
at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:154)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:207)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:98)
at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217)
at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:747)
at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1216)
at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:250)
at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:171)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:13)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:46)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Caused By: java.lang.LinkageError: loader constraint violation: when resolving overridden method "antlr.debug.LLkDebuggingParser.removeMessageListener(Lantlr/debug/MessageListener;)V" the class loader (instance of weblogic/utils/classloaders/ChangeAwareClassLoader) of the current class, antlr/debug/LLkDebuggingParser, and its superclass loader (instance of sun/misc/Launcher$AppClassLoader), have different Class objects for the type antlr/debug/MessageListener used in the signature
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2436)
at java.lang.Class.privateGetPublicMethods(Class.java:2556)
at java.lang.Class.getMethods(Class.java:1412)
at com.bea.wcp.sip.engine.server.setup.SipAnnotationData.classAnnotationParsing(SipAnnotationData.java:344)
at com.bea.wcp.sip.engine.server.setup.SipAnnotationData.jarAnnotationParsing(SipAnnotationData.java:288)
at com.bea.wcp.sip.engine.server.setup.SipAnnotationData.annotationParsing(SipAnnotationData.java:223)
at com.bea.wcp.sip.engine.server.setup.SipAnnotationData.<init>(SipAnnotationData.java:144)
at com.bea.wcp.sip.util.DeploymentUtil.getOrCreateAnnotationData(DeploymentUtil.java:74)
at com.bea.wcp.sip.util.DeploymentUtil.getAnnotationData(DeploymentUtil.java:89)
at com.bea.wcp.sip.engine.server.SipServerTailModule$1.visit(SipServerTailModule.java:129)
at com.bea.wcp.sip.engine.server.SipServerTailModule.visitAllContexts(SipServerTailModule.java:112)
at com.bea.wcp.sip.engine.server.SipServerTailModule.initialize(SipServerTailModule.java:137)
at com.bea.wcp.sip.engine.server.SipServerTailModule.prepare(SipServerTailModule.java:69)
at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:507)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:149)
at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:45)
at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:1221)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:367)
at weblogic.application.internal.SingleModuleDeployment.prepare(SingleModuleDeployment.java:43)
at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:154)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:207)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:98)
at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217)
at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:747)
at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1216)
at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:250)
at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:171)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:13)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:46)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
>
####<Apr 4, 2014 11:09:21 AM CST> <Error> <WLSS.Engine> <E76C3BE51B4188> <AdminServer> <[ACTIVE] ExecuteThread: '5' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1396580961523> <BEA-330004> <Failed to deploy SIP application "b2bua-sip-servlet-1.0.0-SNAPSHOT"
java.lang.NullPointerException
at com.bea.wcp.sip.engine.server.setup.SipDeploymentDescriptor.<init>(SipDeploymentDescriptor.java:285)
at com.bea.wcp.sip.engine.server.setup.SipDeploymentDescriptor.parse(SipDeploymentDescriptor.java:148)
at com.bea.wcp.sip.engine.server.CanaryContext.initContext(CanaryContext.java:396)
at com.bea.wcp.sip.engine.server.CanaryContext.<init>(CanaryContext.java:334)
at com.bea.wcp.sip.engine.server.CanaryServer.installContext(CanaryServer.java:1001)
at com.bea.wcp.sip.engine.server.SipService.setupSipServletContext(SipService.java:126)
at com.bea.wcp.sip.engine.server.SipServerTailModule$1.visit(SipServerTailModule.java:130)
at com.bea.wcp.sip.engine.server.SipServerTailModule.visitAllContexts(SipServerTailModule.java:112)
at com.bea.wcp.sip.engine.server.SipServerTailModule.initialize(SipServerTailModule.java:137)
at com.bea.wcp.sip.engine.server.SipServerTailModule.prepare(SipServerTailModule.java:69)
at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:507)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:149)
at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:45)
at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:1221)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:367)
at weblogic.application.internal.SingleModuleDeployment.prepare(SingleModuleDeployment.java:43)
at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:154)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:207)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:98)
at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217)
at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:747)
at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1216)
at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:250)
at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:171)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:13)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:46)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Can anyone give some suggession?
Thanks in advance!
BR//MarginHi,
I changed my jvm from sun jdk to latest jrockit and the issue was solved :) -
Application vs. Servlet
I have an application that parses an XML file whose URL is received as a parameter.
I have created a servlet that calls this application. I changed the main methods to callable "public void MethodName()". The servlet needs to call one class and then another. It will call the first class, but throws this error when attempting to call the second:
[Servlet Error]-[com/ibm/etools/xmlschema/beans/BaseType]: java.lang.NoClassDefFoundError: com/ibm/etools/xmlschema/beans/BaseType
Why would this class work in an application and not in a servlet??
Application code:
BeFreeRequestSAXParser.java
- this runs and then calls XMLDataParser.java
- XMLDataParser dp = new XMLDataParser();
dp.loadExistingInstance( uri.toString()); (Works great)
Serlvet code:
CustomersAlsoPurchased.java
- this calls BeFreeRequestSAXParser (works fine)
- BeFreeRequestSAXParser tries to call XMLDataParser but does not
work.
Any suggestions?[Servlet
Error]-[com/ibm/etools/xmlschema/beans/BaseType]:
java.lang.NoClassDefFoundError:
com/ibm/etools/xmlschema/beans/BaseTypeIn general servlet containers use a modified class loader hierachy, you should consult the documentation of your servlet container. This matters, because you have to make sure any extra classes are made available when they are not part of the jdk or the container itself.
With tomcat you either have to place them in the folder shared by all contexts or in the WEB-INF/lib, or figure out another way.
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html
Maybe you are looking for
-
How to validate data in editable ALV report after making changes
Hi Folks, My requirement is to display data in ALV format with quantity field is editable. Once we get the data in display mode only quantity field is enabled right. I am going to make changes to that quantity field and updating that modifed value to
-
My old iphone died on me so I had to purchase a new one. A guy at the Apple store helped me with a restore via iCloud. I have two itunes accounts, one for US and another for oversea itunes. I only see songs I purchased in US itunes on my new iphon
-
Connecting Printer to a new Wireless network (changed network provider)
I have recently changed broadband provider and I am struggling to connect my printer (HP Deskjet 3050A All in One Printer) to my new wireless network. I have clicked on HP within programs and tried to set up the printer but my laptop is not recgonisi
-
Can anyone help with this one?
-
I have a Macbook Pro late 2012, model 9,2 i7 - I upgraded to Mavericks and now my Sleep command off the apple start menu doesnt work anymore. I have my macbook pro hooked up to an external monitor. This worked fabulously in Mountain Lion. Has anyone