UGN Security Forums
My ProfileMember DirectoryLogin
Search our ForumsView our FAQView our Site Rules
View our CalendarView our Active TopicsGo to our Main Page

UGN Security Store
 

Network Sites UGN Security, The GoNix Initiative, Elite Web Gamers, Back of the Web, EveryDay Helper, VNC Web Design & Development
July
Su M Tu W Th F Sa
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
Sponsored Links
Latest Postings
Latest Reviews
Topic Options
Rate This Topic
#18846 - 05/23/04 07:21 PM jsp - j2ee problem
bosky101 Offline
Junior Member

Registered: 10/01/03
Posts: 59
Loc: india
i have a strange probelm.... jsp files that i delete from the public_html folder,are stll visible or can be run when the server runs.
eg: i deleted bean.jsp ,but when i go to localhost:8000/bean.jsp , it still runs !!!
i am coming across this problem a nmber of times.

I would also like to know where the beans,classes should be stored for j2ee ( j2ee/lib/classes/ ? )
_________________________
"it is the question ...that drives the answer..."
Keep Clicking,
Bosky

Top
Sponsored Links
      
#18847 - 05/24/04 02:32 AM Re: jsp - j2ee problem
pergesu Offline
UGN Elite Poster

Registered: 03/14/02
Posts: 1136
Loc: Pimpin the Colorizzle
You might know that a JSP gets compiled into a servlet, it's just a convenient way to write a servlet with some HTML markup. The first time you call the page, it gets compiled into a servlet class, and like any class, is loaded by the class loader. The J2EE server stores the class in memory until you undeploy the web application. Next time you restart the J2EE server, your file won't show up.

Bean classes should be stored on a per application basis. Write your bean classes, then put them in a jar file, and stick that in the $app/WEB-INF/lib directory. The only time you want jar files in j2ee/lib is when they store something that should be used for the entire server, such as a JDBC connector or JMS implementation. If certain classes are to be used only by an application, they should be confined to that particular application's lib directory.

Top
#18848 - 05/28/04 06:24 AM Re: jsp - j2ee problem
bosky101 Offline
Junior Member

Registered: 10/01/03
Posts: 59
Loc: india
_________________________
"it is the question ...that drives the answer..."
Keep Clicking,
Bosky

Top
#18849 - 05/28/04 06:26 AM Re: jsp - j2ee problem
bosky101 Offline
Junior Member

Registered: 10/01/03
Posts: 59
Loc: india
question ...

i have j2ee, do i need tomcat ?i hear that j2ee has a inbuilt tomcat,i havnt been able to access it so far.S o i downloaded tomcat 5.0.24 and extracted the zip file.hers what else i did

-set path for java_home
-set catalina_home

do i need to set a classpath variable to a servlet-api.jar or jsp-api.jar from \common\lib

-localhost:8080\ gives nothing

-bin\tomcat5 gives nothing when run
-bin\tomcat5w says not a batch or service
-bin\startup show this

Using CATALINA_BASE: d:\tomcat\jakarta-tomcat-5.0.24
Using CATALINA_HOME: d:\tomcat\jakarta-tomcat-5.0.24
Using CATALINA_TMPDIR: d:\tomcat\jakarta-tomcat-5.0.24\temp
Using JAVA_HOME: d:\java

-and running bin\startup.bat opens a new window with text that scrolls fast and then just closes !

what did i do ....... what Do i do ?!


PS:by the way the add quick reply or full reply button did not work,it took me to http://www.undergroundnews.com/boards .I had to click on the link on the bottom of the page,saying post reply !
_________________________
"it is the question ...that drives the answer..."
Keep Clicking,
Bosky

Top
#18850 - 05/28/04 07:04 AM Re: jsp - j2ee problem
Gremelin Offline

Community Owner
*****

Registered: 02/28/02
Posts: 7192
Loc: Portland, OR; USA
/boards/ is unsupported. Only responses sent through the main board are supported. /boards/ is stricly a search engine mirror.
_________________________
Donate to UGN Security here.
UGN Security, Back of the Web, Elite Web Gamers & VNC Web Design Owner

Top
#18851 - 05/28/04 09:50 AM Re: jsp - j2ee problem
pergesu Offline
UGN Elite Poster

Registered: 03/14/02
Posts: 1136
Loc: Pimpin the Colorizzle
Tomcat is just a servlet and JSP container. It's also the reference implementation of the Sun Servlet and JSP standards. If you want do use any other parts of J2EE, such as EJB or JDNI, you need a more comprehensive container. [url=http://www.jboss.org]JBoss[/jboss] is the one I'd recommend. It's open source, and a great product. But it seems you just want to do servlet/jsp stuff, so Tomcat will be fine.

As far as running Tomcat, you just extract it into whatever directory you want, set up the environment variables, and start it up. That's all covered in the documentation.

Here's the How-to: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/RUNNING.txt

Here's a pretty good tutorial, that covers the installation, and some basic servlet coding:
http://www.coreservlets.com/Apache-Tomcat-Tutorial/

Top
#18852 - 05/28/04 11:28 PM Re: jsp - j2ee problem
bosky101 Offline
Junior Member

Registered: 10/01/03
Posts: 59
Loc: india
does having zone alarm or norton anti-vir hinder the functioning of the tomcat server ? localhost:8080/till shows "page cannot be displayed " message !
_________________________
"it is the question ...that drives the answer..."
Keep Clicking,
Bosky

Top
#18853 - 05/29/04 02:56 PM Re: jsp - j2ee problem
pergesu Offline
UGN Elite Poster

Registered: 03/14/02
Posts: 1136
Loc: Pimpin the Colorizzle
I haven't used any of those. But if you've got a firewall running (which I think ZA is), then you have to allow access to port 8080.

Top
#18854 - 06/08/04 05:09 AM Re: jsp - j2ee problem
bosky101 Offline
Junior Member

Registered: 10/01/03
Posts: 59
Loc: india
one more Q,

wher do i put the classes or beans for j2ee ? any idea ?

thnx
_________________________
"it is the question ...that drives the answer..."
Keep Clicking,
Bosky

Top
#18855 - 06/08/04 05:32 PM Re: jsp - j2ee problem
pergesu Offline
UGN Elite Poster

Registered: 03/14/02
Posts: 1136
Loc: Pimpin the Colorizzle
classes go in /WEB-INF/lib, and that's relative to the web application. You can have two forms of a web app - a war file or an exploded archive. A war file is just a jar with a .war extension. You have a WEB-INF directory in it, into which the web.xml file goes, and a WEB-INF/lib, where you put any compiled classes or jar files. Compiled servlet classes go into WEB-INF/classes

Top
#18856 - 06/09/04 03:37 PM Re: jsp - j2ee problem
bosky101 Offline
Junior Member

Registered: 10/01/03
Posts: 59
Loc: india
when double click on startup.bat in windows explorer,it just closes quickly after opening.
i went to the services and manually started tomcat.
But,when i go to http://localhost:80/ ,it says page cannot be found !

- should tomcat and j2ee have the same port numbers,j2ee uses 8000 and i made tomcat use 80 .
- Do i need j2ee to be runnning along with tomcat, i tried it ,it still doesnt show anything
- uncommented the line in server.xml
-added a before the context path line,as in the manuals.


the index.jsp works when i open it with ie 5.0 ,but not at localhost:80

When i type install~dir/bin/catalina run
,the folwing message comes

[ERROR] Digester - -Begin event threw exception on: Invalid index!>sun.misc.InvalidJarIndexException: Invalid index!
at sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:594)
at sun.misc.URLClassPath.getResource(URLClassPath.java:134)
at java.net.URLClassLoader$1.run(URLClassLoader.java:192)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at org.apache.catalina.loader.StandardClassLoader.findClass(StandardC
sLoader.java:621)
at org.apache.catalina.loader.StandardClassLoader.loadClass(StandardC
sLoader.java:958)
at org.apache.catalina.loader.StandardClassLoader.loadClass(StandardC
sLoader.java:857)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Class.java:237)
at org.apache.commons.digester.ObjectCreateRule.begin(ObjectCreateRul
ava:253)
at org.apache.commons.digester.Rule.begin(Rule.java:200)
at org.apache.commons.digester.Digester.startElement(Digester.java:12

at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown S
ce)
at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(U
own Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartEle
t(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentCont
Dispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument
known Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.commons.digester.Digester.parse(Digester.java:1548)
at org.apache.catalina.startup.Catalina.start(Catalina.java:449)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
at java.lang.reflect.Method.invoke(Native Method)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)

Catalina.start: sun.misc.InvalidJarIndexException: Invalid index!
sun.misc.InvalidJarIndexException: Invalid index!
at org.apache.commons.digester.Digester.createSAXException(Digester.j
:2540)
at org.apache.commons.digester.Digester.createSAXException(Digester.j
:2566)
at org.apache.commons.digester.Digester.startElement(Digester.java:12

at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown S
ce)
at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(U
own Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartEle
t(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentCont
Dispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument
known Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.commons.digester.Digester.parse(Digester.java:1548)
at org.apache.catalina.startup.Catalina.start(Catalina.java:449)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
at java.lang.reflect.Method.invoke(Native Method)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)


Ive beenstruggling with this for ...... SOO LLONG.
_________________________
"it is the question ...that drives the answer..."
Keep Clicking,
Bosky

Top
#18857 - 06/11/04 08:33 PM Re: jsp - j2ee problem
bosky101 Offline
Junior Member

Registered: 10/01/03
Posts: 59
Loc: india
you wont believe it !!!!
after being slaughtered thru various manuals, cionfiguration faqs, downloading four verions of tomcat ,etc unsuccesfully ... i fianally stumbled across line #75 of server.xl under tomcat~-dir/conf/ which said that ...


Code:
 * If your JDK version 1.3 or prior, download and install JSSE 1.0.2 or
           later, and put the JAR files into "$JAVA_HOME/jre/lib/ext". 
and all the while i had jdk 1.3 !!!!
i immediately installed jdk 1.5 and voila ...it worked without any glitches ! hardly took 5 minutes for something ive been trying for one WHOLE month!

thnx pergusu ... and every1 else for letting me figure out this 1 myself ... the hard way .
_________________________
"it is the question ...that drives the answer..."
Keep Clicking,
Bosky

Top

Moderator:  §intå×, Gremelin 
Featured Member
Registered: 08/21/13
Posts: 1
Forum Stats
2145 Members
46 Forums
33536 Topics
68703 Posts

Max Online: 1567 @ 04/25/10 10:20 AM
Top Posters
UGN Security 26699
Gremelin 7192
§intå× 3255
SilentRage 1273
Ice 1146
pergesu 1136
Infinite 1041
jonconley 955
Girlie 908
unreal 860
Newest Members
Jimmie Menon, fghijk435948, Devo60, ali, lavos
2147 Registered Users
Who's Online
0 registered (), 542 Guests and 319 Spiders online.
Key: Admin, Global Mod, Mod
Latest News


Donate
  Get Firefox!
Get FireFox!