Re: Tomcat and Wap

2001-12-30 Thread Simon Mitchell bpc


I changed these two line to get it to work from my nokia.

*<%@ page contentType="text/vnd.wap.wml"%>*

* String ss1=new String(readbyte).substring(0,charcount);*

Need to print only the charaters read into the buffer.

You will get an error if the file is zero length so you could do a test 
before String ss
E.G.
* if (charcount == -1) charcount=0;
 String ss1=new String(readbyte).substring(0,charcount);
*


You could also do other test on length of the file with

File infile=new File("C:/TextFiles/" + filename + ".txt");
long strLen =  infile.length();

Regards,
Simon



Galbayar wrote:

>my jsp is: I can't find any error. but WAP browser have Page Cannot be
>displayed error.
>
><%@ page contentType="text/vnd.wap.wml;charset=ISO-8859-1"%>
><%response.setHeader("Cache-Control","no-cache");%>
><%@ page import="java.io.*"%>
>
>"http://www.wapforum.org/DTD/wml_1.1.xml";>
>
>
>
>
><%
> String pagenum=request.getParameter("page");
> String filename=request.getParameter("f");
> if (pagenum==null) pagenum="1";
> int skipbyte=500;
>  byte[] readbyte=new byte[skipbyte];
>  boolean isEnd=false;
>  try
>  {
>   FileInputStream in=new
>FileInputStream("C:\\TextFiles\\"+filename+".txt");
>   in.skip(skipbyte*(Integer.parseInt(pagenum)-1));
>   int charcount=in.read(readbyte);
>   if (charcount   in.close();
>   String ss1=new String(readbyte);
>out.println(ss1);
>   out.flush();
>  }
>  catch(FileNotFoundException e)
>  {
>   out.println("File Not Found");
>  }
>  catch(IOException e)
>  {
>   out.println("IO error");
>  }
>%>
><%
> String linkstr="";
>
>linkstr=(isEnd)?Integer.toString(Integer.parseInt(pagenum)-1):Integer.toStri
>ng(Integer.parseInt(pagenum)+1);
>%>
> 
> 
> href="ReadFileWml.jsp?page=<%=linkstr%>&f=<%=filename%>"><%=(isEnd)?"Bac
>k":"Next"%>
>
>
>
>
>
>
>
>--
>To unsubscribe:   
>For additional commands: 
>Troubles with the list: 
>
>




--
To unsubscribe:   
For additional commands: 
Troubles with the list: 




Re: Tomcat as NT service.. problem.

2001-07-10 Thread Simon Mitchell bpc

I had the same problem.

In my case it was fixed by setting  wrapper.tomcat_home, java_home 
adding the jar files for tomcat and oracle in wrapper.properties

wrapper.tomcat_home=c:\jakarta\jakarta-tomcat-3.2.2

wrapper.java_home=c:\jdk1.3


wrapper.class_path=$(wrapper.tomcat_home)\classes
wrapper.class_path=$(wrapper.tomcat_home)\lib\japx.jar
wrapper.class_path=$(wrapper.tomcat_home)\lib\parser.jar
wrapper.class_path=$(wrapper.tomcat_home)\lib\webserver.jar
wrapper.class_path=$(wrapper.tomcat_home)\lib\servlet.jar
wrapper.class_path=$(wrapper.tomcat_home)\lib\jasper.jar
wrapper.class_path=$(wrapper.tomcat_home)\lib\classes12.jar
wrapper.class_path=$(wrapper.tomcat_home)\lib\nls_charset12.jar

Good Luck.
Regards,
Simon


Gregory Guthrie wrote:

> I tried to setup Tomcat to start as an NT service (Win2k-Pro), as per:
>   Working with the Jakarta NT Service
>   http://jakarta.apache.org/tomcat/tomcat-3.2-doc/NT-Service-howto.html
>  
> And it seems OK:
>E:\Net\Apache\Tools>jk_nt_service -i Tomcat 
> e:\Net\Apache\Tomcat\conf\wrapper.properties
>Asked (and given) winsock 1.1
>The service named Tomcat was created. Now adding registry entries
>Registry values were added
>If you have already updated wrapper.properties you may start the 
> Tomcat service
>by executing "net start Tomcat" from the command prompt
>
> But I get:
>E:\Net\Apache\Tools>net start Tomcat
>The Tomcat service is starting.
>The Tomcat service could not be started.
>The service did not report an error.
>More help is available by typing NET HELPMSG 3534.
>
> Apache runs fine as a service.  :-)
> Tomcat runs fine by a DOS startup.
> And they run fine together via mod_jk.dll.
>
> I did edit the wrappers.properties file to point to JDK and Tomcat; 
> seems simple enough.
>  
> Any help appreciated; I don't know where to look for hints, there are 
> no log files or errors generated.
>
> 
> Gregory Guthrie
> [EMAIL PROTECTED] (641)472-1125Fax: -1103
> 







Re: tomcat on a home machine???

2001-06-27 Thread Simon Mitchell bpc


You need a java jdk and tomcat.

Have a look at this page for setup info on windows2000 and linux.

http://www.onjava.com/pub/a/onjava/2001/03/29/tomcat.html

Then goto http://localhost:8080/   once tomcat is running.

Simon


[EMAIL PROTECTED] wrote:

>I should add that I wanted to know if it is
>possible to install and use tomcat for test
>purposes. That is to develop and test programs
>at home and not make them available on the internet
>- not at least from my home machine.
>
>T:Irvine
>
>ps which faq did you mean - there seem to be so
>many. I'll A keep searching though.
>
>On Wed, 27 Jun 2001, Charan Kishore Singla wrote:
>
>>yah you can, read faq file related to tomcat, all things would be clear.
>>
>>Thanks
>>- Original Message -
>>From: <[EMAIL PROTECTED]>
>>To: <[EMAIL PROTECTED]>
>>Sent: Wednesday, June 27, 2001 1:38 PM
>>Subject: tomcat on a home machine???
>>
>>
>>>Hello
>>>
>>>I have linux installed at home and have only a
>>>modem connecting me to the internet through a
>>>local service provider.
>>>
>>>My questions are:
>>>
>>>Is it possible for me to install and use tomcat
>>>without a permenant connection.
>>>
>>>If it is possible what files would need to be
>>>configured to allow me to do so.
>>>
>>>What url would I need to call to access tomcat's
>>>homepage.
>>>
>>>Apologies if this question has been asked b4.
>>>
>>>T:Irvine
>>>
>
>






Re: Error in Startup Tomcat at Win2000

2001-06-10 Thread Simon Mitchell bpc

The important thing in the error text is the word bind.

This means that one of your sockets is being used.

On unix and win2000 you can do a netstat -a
This will print out all you sockets incoming and outgoing.

To get to the point you need to shutdown the program using this socket -
I had the same problems with oracle 8.1.7 starting its apache http server.
You can stop Oracle http from the start menu Oracle OraHome81 - Oracle 
HTTP Server -
- Stop Http
(C:\Oracle\Ora81\Apache\Apache\Apache.exe -k shutdown -d 
C:\oracle\ora81\Apache\Apache )

All the Best
Regards
Simon

Qinhong Pan wrote:

> I am running Tomcat 3.2 and Win2000 Professional.
>
> Once startup tomcat, I got the following error message,
> 2001-06-10 04:12:17 - ContextManager: Adding context Ctx( /examples )
> 2001-06-10 04:12:17 - ContextManager: Adding context Ctx( /admin )
> Starting tomcat. Check logs/tomcat.log for error messages
> 2001-06-10 04:12:17 - ContextManager: Adding context Ctx( )
> 2001-06-10 04:12:17 - ContextManager: Adding context Ctx( /test )
> 2001-06-10 04:12:18 - PoolTcpConnector: Starting HttpConnectionHandler 
> on 8080
> FATAL:java.net.BindException: Address in use: JVM_Bind
> java.net.BindException: Address in use: JVM_Bind
> at java.net.PlainSocketImpl.socketBind(Native Method)
> at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:397)
> at java.net.ServerSocket.(ServerSocket.java:170)
> at java.net.ServerSocket.(ServerSocket.java:121)
> at org.apache.tomcat.net.DefaultServerSocketFactory.createSocket(Default
> ServerSocketFactory.java:97)
> at org.apache.tomcat.service.PoolTcpEndpoint.startEndpoint(PoolTcpEndpoi
> nt.java:239)
> at org.apache.tomcat.service.PoolTcpConnector.start(PoolTcpConnector.jav
> a:188)
> at org.apache.tomcat.core.ContextManager.start(ContextManager.java:527)
> at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:202)
> at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:235)
>
> Your help is greatly appreciated.
>
> Peter
>