Hi Niall, Niall Haslam wrote: > Hi all, > > I had this working at the workshop some weeks ago and now that I am looking > at > it again I seem to have forgotten it. My copy of the VM from the workshop > didn't quite survive the transfer to Germany :( > > I get the following errors when trying to compile the tomcat server that will > be used to run the taverna jobs. > > t2tomcat.java:45: non-static method getServletContext() cannot be referenced > from a static context > ApplicationContext context = > WebApplicationContextUtils.getWebApplicationContext(getServletContext()); // > ERR > > Code: > TavernaBaseProfile profile; > ApplicationContext context = > WebApplicationContextUtils.getWebApplicationContext(getServletContext()); // > ERR > profile = new TavernaBaseProfile(context); > > Any help on this would be appreciated. I seem to remember Tom telling me to > initialise the context differently but I have followed the docs and can't > find anything else. >
Are you attempting to do this within a Servlet or within a JSP page? In which method are your trying to call getServletContext()? Could you show us some more of your code that puts it into context. You could also try getServletConfig().getServletContext() but I think you will get the same error. To state the obvious, the problem is that you are trying to call getServletContext() from within a static block. Stuart > Cheers, > > Niall. > > > > ------------------------------------------------------------------------------ > _______________________________________________ > taverna-hackers mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/taverna-hackers > Developers Guide: http://www.mygrid.org.uk/usermanual1.7/dev_guide.html > FAQ: http://www.mygrid.org.uk/wiki/Mygrid/TavernaFaq > ------------------------------------------------------------------------------ _______________________________________________ taverna-hackers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/taverna-hackers Developers Guide: http://www.mygrid.org.uk/usermanual1.7/dev_guide.html FAQ: http://www.mygrid.org.uk/wiki/Mygrid/TavernaFaq
