cancel
Showing results for 
Search instead for 
Did you mean: 

"cannot resolve symbol" error

Former Member
0 Kudos

Hi!

I am developing a portal application, in one of my JSPDynPage component's jsp page:

<%@ page language="java" %>

<%@ page import = "com.dimension.mail.server.*" %>

<%@ page import = "xmyang.util.log.*" %>

<hbj:content id="myContext" >

<hbj:page title="SMTP2SMS Server State">

<hbj:form id="myFormId" >

<%

//int mailserverstate = Mail.getServerState();//Error, java.lang.NoSuchMethodError

//int a = Mail.SERVER_STATE_NOTREADY;//cannot resolve symbol

NaiveLogger.log2("the logger 2 are loaded");//OK

%>

</hbj:form>

</hbj:page>

</hbj:content>

The class com.dimension.mail.server.Mail and xmyang.util.log.NaiveLogger are all located at <portalApp>/classes/ . NaiveLogger.log2() is correct but Mail is no good. The log file shows Mail class are successful found but it cant resolve its method and attribute and can't compile!

What's the problem?? Can somebody give me a hint? Thank you very much!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi

i think u can't call java classes in portal...

better u create a bean and put those methods and u call the bean in your JSPs using bean tags.

i think this is the way. also store those beans in src.api by which u can access it from any project.

if u really found the way for accessing java class just revert me back.

hope it helps.

regards,

purushothaman.

Former Member
0 Kudos

hi purushothaman, thank you for your reply.

But If the java classes in the directory PORTAL-INF/classes/ can't be accessed, then what this directory is for?

And all the classes in src/api and src/core will be packaged to a jar file. What if I don't want it be packaged to a jar file, what if I need some properties file for my classes's configuation and need to be there (not in a jar file)?

My question may be very stupid, but can you give me some hints, thank you very much!

Former Member
0 Kudos

Hi,

If you try to create a class or package in <b>PORTAL-INF/classes</b>, the Developer Studio will automatically create the class or package in the <b>src.api</b> directory.

Based on your description, it seems to me that the JSPDynPage was able to see the class Mail, but wasn't able to see its methods. Check if the methods in the class are public.

-Teecheu Loh

Former Member
0 Kudos

thanks Teecheu Loh,

The method and attribute which I call is definited declared public.

How to create a class or package in <b>PORTAL-INF/classes</b>? It seems to me only src/api and src/core are allowed?

Answers (4)

Answers (4)

Former Member
0 Kudos

hi xiaoming,

the following is what i got for webdynpro.i think it holds good for portals also..

Public Web resources

Web resources are public for the J2EE Engine – that means that they can be addressed by a URL. In the Web-Dynpro archive, all contents that are not located in the directory PORTAL-INF are defined as Web resources.

Private Resources

In the Web-Dynpro archive, all contents that are not located in the directory PORTAL-INF are defined as Web resources. The Web Dynpro contents (metadata, configuration data, etc.) are stored in the directory PORTAL-INF/webdynpro. The binary code of the application is located in PORTAL-INF\classes. Additional libraries, which can be imported into a Web Dynpro project as JAR files, can be found under PORTAL-INF/lib.

hope it helps.

if u find anything other than this pl.revert me back.

regards,

purushothaman.

Former Member
0 Kudos

I use Netweaver Developer Studio to develop the project, and this project is a portal project.

I import the source codes files to dist/PORTAL-INF=>/classes, which is the java classes I want to call in poral JSP page. Is this OK?

When I create a JSPDynPage and generate a bean class, in the bean class, i can't import the packages in

PORTAL-INF/classes, it can't be found.

When I new a Java class, it can only be located in src/api or src/core, can't be put in PORTAL-INF/classes.

The classes in src/api and src/core will turned to be an jar file after deploy to the server, but it is not i want, cause i need add some conf files and directorys to source codes, and want it not be put in a whole jar file. So i choose to put them to PORTAL-INF/classes.

But I get the problems, who can help me ,please!

Former Member
0 Kudos

hi

try it out by just creating a instance of the java class here in JSP and call those methods by this object...

regards,

purushothaman.

Former Member
0 Kudos

thanks, purushothaman,

I try to:

Mail mailObj = new Mail();

An exception was thrown.

Former Member
0 Kudos

hi xiaoming,

i think your method and symbol is not visible here in JSP.

have u declared them public...check it out.

regards,

purushothaman.

Former Member
0 Kudos

Thank you for your reply!

The class is declared public, the method and attribute of the class are both declared "public static".