Java Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesJava Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 1st, 2003, 10:34 PM
nipster nipster is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: Vancouver, B.C.
Posts: 11 nipster User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to nipster
jsp cant find bean class or jar

I am having some problems getting my jsp to find my bean classes.
my direcotry structurethe one froce upon me from the hosting company actually)
html root->Project Dir->Jsp Dir ->jsp files
->WEB-INF->classes->packageName->beanClass

my code:

<jsp:useBean id="bean" class="package.BeanName" scope="session"/>

I get and error can not find paackage.BeanName

If I try without a package I get: can not find org.apache.jsp.BeanName

Am i doing something wrong(which is very possible) or could it be the server config which i dont know at all and they will not tell me.

thanks alot in advance

Reply With Quote
  #2  
Old February 2nd, 2003, 11:33 AM
Nemi Nemi is offline
Clueless llama
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Feb 2001
Location: Lincoln, NE. USA
Posts: 2,353 Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 2 Days 12 h 35 m 19 sec
Reputation Power: 111
Hmm, with the limited info you have given I would say it is most likely a server configuration problem. Can you post your jsp so we can see it?

Reply With Quote
  #3  
Old February 3rd, 2003, 04:02 AM
nipster nipster is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: Vancouver, B.C.
Posts: 11 nipster User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to nipster
may be server config

Hi,

Yes it could be the server config, my host is using esim's webppliance, i think it is quite poplular but there is little info besides put class files in web-inf. Here is a bit of my code:
Code:
<%@ page import="java.sql.*" %>
<%@ page import="JarName.*" %>


<jsp:useBean id="test" class="beanName" scope="session" />

<% 
	Connection conn = null;
    ResultSet rs = null;
    Statement stmt = null;
    String dbname = "dbName";
    final String dbUrl= "jdbc:mysql:///" +"dbName";
    
	try
	{
		//load mysql driver
		Class.forName("org.gjt.mm.mysql.Driver");
		//connect to database
		conn=DriverManager.getConnection(dbUrl);
		stmt=conn.createStatement();
	}//try
	catch(Exception e){
		
	}//exception
%>


and does org.apache.jsp.beanName mean any specific directory?
and is their away to point to an aboslute path?

Reply With Quote
  #4  
Old February 3rd, 2003, 03:29 PM
nipster nipster is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: Vancouver, B.C.
Posts: 11 nipster User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to nipster
bean that works

I got a small bean to work so it must be something wrong with the code, but I still can not import jar files any help on that would be great. Does anyone know anything about this webppliance thing?

Thanks

NiP

Reply With Quote
  #5  
Old February 9th, 2003, 07:02 PM
paragon paragon is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Los Angeles
Posts: 1 paragon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
same problem

Hi

I believe I have the same problem.

When trying to access the jsp-file I get
C:\j2sdkee1.3.1\repository\bigbox\web\currencyconverter\index$jsp.java:5: Package ejb.DataBaseCache not found in import.
import ejb.DataBaseCache.*;

The other imports works fine
CurrencyConverter,CurrencyConverterHome, ejb.DataBaseCache.*, javax.ejb.*, java.math.*, javax.naming.*, javax.rmi.PortableRemoteObject, java.rmi.RemoteException

Most of them would reside in classes.jar I guess and the two first ones ive written myself (actually editing a tutorial that i have modified). Those two classes are found thanks to them being deployed trhough deploytool I guess.

ejb.DataBaseCache however i dont want as a sessionbean. I'd like to us it as a singleton/static class (one instance only). Why arent it showing up to work with the import statement?

Does jsp use another classpath than the one I set through environment variables in windows?
Do I need to place ejb.DataBaseCache in a jar and place it in a special directory (where?)
Does it need to be deployed in some way to be able to be found by a jsp? (how?)

Please help me out with this one.. Have tried lots of things but cant get it to work.

Best regards.

Reply With Quote
  #6  
Old February 16th, 2003, 04:02 PM
halimanh halimanh is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 6 halimanh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
every added new context in web.xml file will only be recognized after restarting Tomcat. Maybe this is the case?
I also found that you may need to put both:
<%@ page import = .....%>

and ...

<jsp:useBean .....

for each bean class you use in your jsp file.

Nipster, there are 2 jdbc connectors for mysql (that I know, maybe more). Ask the admin which one they use, so save your time not trying to load wrong mysql driver.

Last edited by halimanh : February 16th, 2003 at 04:05 PM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesJava Help > jsp cant find bean class or jar


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway