Link to home
Start Free TrialLog in
Avatar of Tacobell777
Tacobell777

asked on

Newbie Questions: so be gentle..

OK, I am a newbie to Java and have absolutely no idea what I am doing, so I am going to ask some stupid questions.

I understand the syntax and all that, but I am having trouble with the basic stuff like the app server and all that.
Here goes:

I have ColdFusion installed, which runs on JRun4, then I also have Sun j2eesdk-1_4_01 installed.

1: Can I get rid of one app server and just run everything on JRun4?
2. Is one better than the other?
3. I am trying to compile a class, but keep running into errors, I know why I get the errors, I get the errors because the class I am trying to compile cannot find the classes I need to import.
   3.a. Where in gods name do I put my classes so it can find all the import classes?
   3.b. I am guessing somewhere under one of the app servers, but which one and where?

The class looks like the following:

package jrun.support;

import javax.servlet.*;
import javax.servlet.http.*;

public class JRunHttpSessionListener implements HttpSessionListener
{
    public void sessionDestroyed( HttpSessionEvent session )
    {
        HttpSession objSession = session.getSession();
        System.out.println(" (objSession) Destroyed:ID=" + objSession.getId());
    }
}

I have a ton load of other questions, but I'll start with the above.
PS. I am trying to perform an action upon timeout of a session variable.
Avatar of vikraman_b
vikraman_b

Hi
can u post ur errors
check this..
for installating,deployment and configuration....


http://www.macromedia.com/support/coldfusion/j2ee/phase2-jrun4-deploy.html
Avatar of Tacobell777

ASKER

Following are the errors, just a FYI there are 5 questions in my post and a link to install or deploy just won't do..

C:\Sun\AppServer\jdk\bin>javac e:\temp\JRunHttpSessionListener.java -classpath C
:\Sun\AppServer\docs\api
error: cannot read: e:\temp\JRunHttpSessionListener.java
1 error

C:\Sun\AppServer\jdk\bin>javac C:\JRun4\servers\default\default-ear\default-war\
WEB-INF\classes\JRunHttpSessionListener.java
C:\JRun4\servers\default\default-ear\default-war\WEB-INF\classes\JRunHttpSession
Listener.java:3: package javax.servlet does not exist
import javax.servlet.*;
^
C:\JRun4\servers\default\default-ear\default-war\WEB-INF\classes\JRunHttpSession
Listener.java:4: package javax.servlet.http does not exist
import javax.servlet.http.*;
^
C:\JRun4\servers\default\default-ear\default-war\WEB-INF\classes\JRunHttpSession
Listener.java:6: cannot resolve symbol
symbol  : class HttpSessionListener
location: class jrun.support.JRunHttpSessionListener
public class JRunHttpSessionListener implements HttpSessionListener
                                                ^
C:\JRun4\servers\default\default-ear\default-war\WEB-INF\classes\JRunHttpSession
Listener.java:8: cannot resolve symbol
symbol  : class HttpSessionEvent
location: class jrun.support.JRunHttpSessionListener
    public void sessionDestroyed( HttpSessionEvent session )
                                  ^
C:\JRun4\servers\default\default-ear\default-war\WEB-INF\classes\JRunHttpSession
Listener.java:10: cannot resolve symbol
symbol  : class HttpSession
location: class jrun.support.JRunHttpSessionListener
        HttpSession objSession = session.getSession();
        ^
5 errors
ASKER CERTIFIED SOLUTION
Avatar of vikraman_b
vikraman_b

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Taco,
Another comment... do not worry at all... app servers are not the basic stuff... they are a pain in the a.. hard to configure at the beginning, and also hard to understand.
One piece of advice, be patient, read a lot and try everything!!!

Welcome to Java, hope you enjoy!
-tom

Try ant (http://ant.apache.org/) to compile your java files and deploy your webappli in your app server.

Ant and its build.xml file replace the command "make" and his makefile for java ...
Since you are a newbie, app server is just not the thing you want to look at.
Here are some instructions on how to do J2EE in a lightweight way - but still with all the power of real enterprise app.

If you don't know about Spring (www.springframework.org) now is the time to look at it. It covers all things that you are looking for - easy db integration, transaction handling, UI, configuration, documentation, forums, ... It has steep lurning curve, but all this stuff mentioned really helps and once you master it, there's no limit to what you can do :-).

All things below are already integrated with Spring:

- db integration (db independent - only jdbc driver limitations):
  - simple sql mapping: iBatis (www.ibatis.com)
  - more advanced ORM tool: Hibernate (www.hibernate.org)

- user interface:
  - most widely spread: Struts (struts.apache.org/)
  - easy usage: WebWork (www.opensymphony.com/webwork)
  - component oriented: Tapestry (jakarta.apache.org/tapestry)
  - integrated: Spring MVC (www.springframework.org/docs/reference/mvc.html)