Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

Can't find any logical explanation (JSP online store)


  • Please log in to reply
1 reply to this topic

#1 toto_7

toto_7

    CC Addict

  • Advanced Member
  • PipPipPipPipPip
  • 244 posts

Posted 14 January 2012 - 05:30 AM

Hello,

I'm trying to re-work my last year's project about an online store. My project last year was working perfectly on university's labs but now I'm trying to run it on my machine and I have problems. Download and install Tomcat 6.0. My first JSP page loaded and presented fine but when I'm trying to move on to another page that using a JAVA class I have exceptions.

This is the error I have when I'm clicking on link for next page
An error occurred at line: 18 in the generated java file
Only a type can be imported. purchase.PurchaseManager resolves to a package

An error occurred at line: 19 in the generated java file
Only a type can be imported. purchase.Purchases resolves to a package

An error occurred at line: 29 in the jsp file: /Milestones/goodsList.jsp
PurchaseManager cannot be resolved to a type
26: NodeList nodeLogo = (NodeList) resultLogo;
27: String logoPath = nodeLogo.item(0).getTextContent();
28: 
[COLOR="#FF0000"]29[/COLOR]: PurchaseManager purchaseManager = new PurchaseManager("H:\\MadshopUsers\\purchase_"+session.getAttribute("Username")+".obj");
30: %>
31: 
32: <html>


An error occurred at line: 29 in the jsp file: /Milestones/goodsList.jsp
PurchaseManager cannot be resolved to a type
26: NodeList nodeLogo = (NodeList) resultLogo;
27: String logoPath = nodeLogo.item(0).getTextContent();
28: 
[COLOR="#FF0000"]29[/COLOR]: PurchaseManager purchaseManager = new PurchaseManager("H:\\MadshopUsers\\purchase_"+session.getAttribute("Username")+".obj");
30: %>
31: 
32: <html>

Now, when I'm trying to compile those classes, purchaseManager pointing errors where Purchases referred. First compiling the Purchases.java and I don't have problem, but when I'm compiling the purchaseManager.java I have "error:cannot find symbol" on 12 lines inside purchaseManager where Purchases element is created or Vector<Purchases>. At the end when I'm trying to compile them together "javac purchaseManager.java Purchases.java" I have no errors but these warnings,
Note: purchaseManager.java uses unchecked or not safe operations
Note: Recompile with -Xlint:unchecked for details

Can anyone tell me what's going wrong? I'm 100% sure that last year was working.

Thanks in advance,
toto_7

P.S. Tell me if you want and specific part of my code
  • 0

"Programming is like **. One mistake and you have to support it for the rest of your life."

-Michael Sinz

#2 wim DC

wim DC

    Roar

  • Expert Member
  • PipPipPipPipPipPipPipPip
  • 2681 posts
  • Programming Language:Java, JavaScript, PL/SQL
  • Learning:Python

Posted 16 January 2012 - 02:44 AM

What do the @Page imports look like on the jsp?

Which IDE do you use, if any?

It are probably just classpath issues, eg. the PurchaseManager is not available in the web-inf/classes/purchase/ folder

Edited by wim DC, 16 January 2012 - 03:24 AM.

  • 0




Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download