Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Embeded jetty 7.2.2 issue.

Well, one possibility is that the resource base is not pointing at the file system in the right locatioon so in fact there is no file where jetty is looking for it.
I was mistaken for enabling the directory listing: it is in fact enabled by default.
I would type an absolute path on your filesystem to point to the base resource.
For example if you are launching your application from eclipse PDE, the working directory is by default your user-home.
So the path <Set name="resourceBase">newWP/testapplication/src/</Set>
will not point to where your files are.

Also maybe jetty-osgi would be a good fit for your situation: you will have control over the jetty configuration with the usual jetty.xml and you will be able to deploy context handlers or applications easily.

Hugues


On Tue, Feb 8, 2011 at 10:50 PM, Mitul Adhia <mituladhia19@xxxxxxxxx> wrote:
Hi Hugues ,

Thanks for the reply .

I did not get your statement 'Maybe you could turn on the directory listing of the default servlet or use an absolute path to define the base ?' .
Maybe i can give you the dir structure of the project and wanted your inputs whether  the declaration which i did in jetty.xml is valid or not 

BundleName (myapplication)
--->src folder
      ---------->com.test (package name under src folder)
                  HelloServlet.java
--->Meta-INF folder
     ------------>MANIFEST.MF
--->jetty.xml (located in same hierachy with src folder )

Questions : 1) Is the location of jetty.xml is in correct folder structure?
                   2) Now do i need to address HelloServlet in jetty .xml somewhere ??? if yes how it can be incorporated in jetty.xml ? if no the how the default servlet decalration i.e "  <Set name="className">org.eclipse.jetty.servlet.DefaultServlet</Set> " wil point to required servlet i.e HelloServlet ??

No i did apply break points in resource resolver :(


Also how can i achive HttpService in jetty7.2.2 so that i can register my servlet on dynamically ??

Best Regards,
Mitul

     




On Tue, Feb 8, 2011 at 1:34 PM, Hugues Malphettes <hmalphettes@xxxxxxxxxxx> wrote:
Hi Mitul,
Looking at the jetty.xml file, I am not sure that the issue is OSGi specific although I could be mistaken.
Maybe you could turn on the directory listing of the default servlet or use an absolute path to define the base ?
Have you tried placing breakpoints inside the resource resolver?
Let us know,
Hugues

On Tue, Feb 8, 2011 at 2:14 PM, Mitul Adhia <mituladhia19@xxxxxxxxx> wrote:
Hi All,

I am using Jetty 7.2.2 embedded in my application . It is an osgi based application running on equinox. Now my requirement is to run jetty server using the configuration file . below is the snippet which i have used to read the configuration file . The execution goes fine w/o any exception but when i open the URL http://localhost:50099/timeline it says no resource found error 404.

I have written one servlet and now i wanted to register that servlet with the connector so that i can run the servlet from the broswer. To incorporate this did necessary changes in jetty.xml.

Resource fileserver_xml;
try {
Thread.currentThread().setContextClassLoader(Activator.class.getClassLoader());
fileserver_xml = Resource.newResource("newWP/testapplication/jetty.xml");
XmlConfiguration configuration = new XmlConfiguration(fileserver_xml.getInputStream());
       Server server = (Server)configuration.configure();
       server.start();
       server.join();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SAXException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}


Attached is the jetty .xml file attached for reference. 
Could you please let me know what went wrong in this ?

Best Regards,
mitul


_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jetty-users



_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jetty-users



_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jetty-users



Back to the top