Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

compiler javabean error:cannot resolve symbol; what happend???

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am working at bea weblogic8.1 and jdk141_03.
i work in weblogic's sigle-server development environment.
directory as follow:
C:\bea\weblogic81\server\bin\applications\aaaa\WEB-INF\classes\BAS.class
C:\bea\weblogic81\server\bin\applications\aaaa\index.jsp
jsp as follow:
<%@ page language="java" contentType="text/html;charset=gb2312"%>
<jsp:useBean id="ass" scope="session" class="BAS" />
<html>
this is test
</html>
BAS.java as follow:
import java.io.*;
public class BAS {
private int Count;
public BAS(){
Count = 0;
}
public int getCount(){
Count++;
return Count;
}
}
Full compiler error(s):
C:\bea\weblogic81\server\bin\.\myserver\.wlnotdelete\extract\myserver__appsdir_aaaa_dir_aaaa\jsp_servlet\__index.java:122: cannot resolve symbol
symbol : class BAS
location: class jsp_servlet.__index
BAS ass = null; //[ /index.jsp; Line: 2]
^
C:\bea\weblogic81\server\bin\.\myserver\.wlnotdelete\extract\myserver__appsdir_aaaa_dir_aaaa\jsp_servlet\__index.java:123: cannot resolve symbol
symbol : class BAS
location: class jsp_servlet.__index
ass = (BAS)session.getAttribute("ass"); //[ /index.jsp; Line: 2]
^
C:\bea\weblogic81\server\bin\.\myserver\.wlnotdelete\extract\myserver__appsdir_aaaa_dir_aaaa\jsp_servlet\__index.java:126: cannot resolve symbol
symbol : class BAS
location: class jsp_servlet.__index
ass = (BAS)session.getAttribute("ass"); //[ /index.jsp; Line: 2]
^
C:\bea\weblogic81\server\bin\.\myserver\.wlnotdelete\extract\myserver__appsdir_aaaa_dir_aaaa\jsp_servlet\__index.java:128: cannot resolve symbol
symbol : class BAS
location: class jsp_servlet.__index
ass = new BAS(); //[ /index.jsp; Line: 2]
 
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
nice id for your bean
is your class in a package? remember that useBean's class must be the fully qualified class file (including package)
 
Author
Posts: 399
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi..
there is no "package" statement in you BAS.java, nor is the file imported in your JSP file.
your BAS.java should have :

& your JSP file needs to import like :

hth
MB
[ November 20, 2003: Message edited by: Malhar Barai ]
 
jgm jinggm
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
no package!!
C:\bea\weblogic81\server\bin\applications\aaaa
is my webapplication directory !!
 
Sheriff
Posts: 67634
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is known that many servlet containers have a problem with packageless classes. It's most likely that your problem will disappear like snow in April once you put your classes into a package (which is just good practice in any case).
bear
 
Bear Bibeault
Sheriff
Posts: 67634
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And now a word from your sponsor..
Welcome to the Ranch jgm jinggm!
You'll find this forum a great place to seek help on JSP pages, and there aren't many rules you'll have to worry about, but one is that proper names are required. Please take a look at the JavaRanch Naming Policy and change your display name to match it.
Thanks!
bear
JSP Fourm Bartender
 
jgm jinggm
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes! thank you very much.
it need pakage!!!
 
Acetylsalicylic acid is aspirin. This could be handy too:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic