wu :: forums
« wu :: forums - Problem in java »

Welcome, Guest. Please Login or Register.
May 2nd, 2024, 4:12am

RIDDLES SITE WRITE MATH! Home Home Help Help Search Search Members Members Login Login Register Register
   wu :: forums
   general
   wanted
(Moderators: ThudnBlunder, william wu, towr, Eigenray, Grimbal, Icarus, SMQ)
   Problem in java
« Previous topic | Next topic »
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   Author  Topic: Problem in java  (Read 1018 times)
gotit
Uberpuzzler
*****





   
Email

Gender: male
Posts: 804
Problem in java  
« on: Feb 14th, 2008, 6:58am »
Quote Quote Modify Modify

I  am visiting this forum after a long time as I was busy with my project. And ironically it is this project that brings me back to the forum.
Before I state my problem, let me inform you that I am working with jdk 1.5 and tomcat 5.5.
Now for the problem:
I create a package called "mypack" and a class called testClass.java. I compile the java file and put the testClass.class file in the mypack directory. I then put the entire mypack directory under webapps/testcodes/WEB-INF/classes directory.
Now I create a JSP file which contains the following line
<%@ page language="java" import ="mypack.testClass" %>
and I create an object of testClass. But when I compile the jsp file, I get an error which says that
testClass cannot be resolved. Can anyone please give a solution to this. It's urgent.
IP Logged

All signatures are false.
Grimbal
wu::riddles Moderator
Uberpuzzler
*****






   


Gender: male
Posts: 7527
Re: Problem in java  
« Reply #1 on: Feb 14th, 2008, 7:09am »
Quote Quote Modify Modify

It sounds right.
 
Have you declared the package in the source of testClass?
 
Usually class names start with an uppercase.  Do you mix up the cases?
 
Can you otherwise execute JSP pages?
« Last Edit: Feb 14th, 2008, 7:10am by Grimbal » IP Logged
SMQ
wu::riddles Moderator
Uberpuzzler
*****






   


Gender: male
Posts: 2084
Re: Problem in java  
« Reply #2 on: Feb 14th, 2008, 7:17am »
Quote Quote Modify Modify

It looks to me like you're doing everything right; is it possible that tomcat is running under an older version of Java than what you're compiling with?
 
--SMQ
IP Logged

--SMQ

Grimbal
wu::riddles Moderator
Uberpuzzler
*****






   


Gender: male
Posts: 7527
Re: Problem in java  
« Reply #3 on: Feb 14th, 2008, 7:20am »
Quote Quote Modify Modify

Have you restarted tomcat after copying the .class file to the classes directory?
IP Logged
gotit
Uberpuzzler
*****





   
Email

Gender: male
Posts: 804
Re: Problem in java  
« Reply #4 on: Feb 14th, 2008, 9:15pm »
Quote Quote Modify Modify

Yes to all except Grimbal's last question. After reading Grimbal's last question, I restarted Tomcat and it worked!!
 
Thanks a lot Grimbal and SMQ.
« Last Edit: Feb 14th, 2008, 9:16pm by gotit » IP Logged

All signatures are false.
Grimbal
wu::riddles Moderator
Uberpuzzler
*****






   


Gender: male
Posts: 7527
Re: Problem in java  
« Reply #5 on: Feb 15th, 2008, 1:53am »
Quote Quote Modify Modify

If you need to do it a lot:
http://tomcat.apache.org/tomcat-5.5-doc/manager-howto.html#Reload%20An%2 0Existing%20Application
 
But if it is more than a one-week project, you should consider a proper IDE like eclipse.
IP Logged
gotit
Uberpuzzler
*****





   
Email

Gender: male
Posts: 804
Re: Problem in java  
« Reply #6 on: Feb 15th, 2008, 2:49am »
Quote Quote Modify Modify

No. This is not a one-week project. But since it is currently in the development phase, I have added the following in conf/context.xml file:
 
<Context reloadable="true">
 
But I understand that once the project goes live, this might degrade the performance and I have to remove the reloadable attribue.
I suppose this is what you meant.
IP Logged

All signatures are false.
Grimbal
wu::riddles Moderator
Uberpuzzler
*****






   


Gender: male
Posts: 7527
Re: Problem in java  
« Reply #7 on: Feb 15th, 2008, 5:25am »
Quote Quote Modify Modify

That's not what I meant.  In fact, your idea is better.
IP Logged
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print

« Previous topic | Next topic »

Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board