• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
jgm jinggm
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • 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]
 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • 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)
 
Malhar Barai
Author
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
no package!!
C:\bea\weblogic81\server\bin\applications\aaaa
is my webapplication directory !!
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
yes! thank you very much.
it need pakage!!!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!