aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes fragment was not found error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "fragment was not found error" Watch "fragment was not found error" New topic
Author

fragment was not found error

Preethi Dev
Ranch Hand

Joined: Sep 07, 2008
Posts: 265
Hi Ranchers!

can anyone explain me how to get rid os this following error?

Fragment "/CalendarServlet" was not found at expected path /LowFareAir/WebContent/ CalendarServlet

does this mean that i have to keep the CalendarServlet.class file in webContent folder?

if so how can i do this in eclipse?

please help me to run this project. this is the only problem i am getting other things are fine.

Thanks in advance
Preetha
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1477
    
    6

The class file should be under WEB-INF\classes folder. Can we have a look on your web deployment descriptor file(web.xml)?


Swastik
Preethi Dev
Ranch Hand

Joined: Sep 07, 2008
Posts: 265


this is in web.xml
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1477
    
    6

Your servlet classes should be within the package named com.ibm.sample, and this package should be within WEB-INF\classes, and your form action should be somewhat like action="LoginServlet".
Preethi Dev
Ranch Hand

Joined: Sep 07, 2008
Posts: 265
I am not getting properly, how can i keep my class files under WebContent where my program was looking for CalenderServlet.java?

could you explain it ?

Thanks
Preetha
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1477
    
    6

Your web request is not looking for the .java file, rather its looking for the .class file. The folder for source(.java) might differ in different IDE. However the .class files for any web application always goes under WEB-INF\classes. What does your form action say?

In a web application the directory structure goes some what like this

context root folder -> typically contains the static contents like html,gif,jpg etc.
context root folder\WEB-INF- typically contains the descriptor file like web.xml
context root folder\WEB-INF\classes - contains the .class files like servlet, beans.
context root folder\WEB-INF\lib - contains third party runtime libraries for e.g. 3rd party jar files.
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1477
    
    6

Once the server starts, if you enter the following in address bar

http://localhost:8080/LowFareAir/CalendarServlet

The port number might differ in your case.

what do you get? Same error or something else.
Preethi Dev
Ranch Hand

Joined: Sep 07, 2008
Posts: 265
I did run the CalendarServlet.Java which gives the URL as "http://localhost:8080/LowFareAir/CalendarServlet" .

That i program is working. my class files are not getting identified by welcome.Jsp which uses itz class file.

In my programming structure i could not see any class files.
I have done something like

bulid path--->I set the default output folder as----->LowFareAir/WebContent/WEB-INF/classes

please help me to solve this.

Thanks In advance
Preetha
SCJP 1.5
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1477
    
    6

You won't see the class files in program structure. All web components are compressed in web achieve (.war) file. I am not very sure where eclipse keeps that in netbeans it appears under dist folder under your application folder, and by the way what is the code to invoke the servlet in your welcome.jsp file? As per your servlet mapping in web.xml there should not be any sub folder like webcontent, and the default output folder that you mentioned probably stores the war file.
Preethi Dev
Ranch Hand

Joined: Sep 07, 2008
Posts: 265
Hi ,

code] <jsp:include page="/CalendarServlet"> <------------shows error here as fragment was not found at the path
<jsp:param name="type" value="orig" />
</jsp:include>[ [/code]

This is the code i am using to invoke the servlet from welcome.jsp.
Preethi Dev
Ranch Hand

Joined: Sep 07, 2008
Posts: 265
anyone there to help me?


Preetha
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: fragment was not found error