|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
help problem with extending dwrServlethi
i try to extends servlet and invoking it in web.xml but when the browser page opens it says (dbug with firebug utility) that dwr in javascript is not definited.. and give me this error: GRAVE: Error loading WebappClassLoader delegate: false repositories: /WEB-INF/classes/ ----------> Parent Classloader: org.apache.catalina.loader.StandardClassLoader@be2358 it.netbureau.DwrSessionspike.Initiate java.lang.ClassNotFoundException: it.netbureau.DwrSessionspike.Initiate at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1094) at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:808) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:619) the only things i do are: public class Initiate extends DwrServlet implements ScriptSessionListener{ .. //i override only this method @Override public void init(ServletConfig servletConfig) throws ServletException { super.init(servletConfig); System.out.println("- ** DWR Servelet initialization completed, add listener now"); //register DWR Session Listener after servelt initialization d = new DWRWebContextWrapper(WebContextFactory.get()); Container container = d.getWebContext().getContainer(); ScriptSessionManager manager = container.getBean(ScriptSessionManager.class); System.out.println(manager); manager.addScriptSessionListener(this); } ... .. and web.xml: <servlet> <servlet-name>dwr-invoker</servlet-name> <!-- replaced with my servlet--> <!-- org.directwebremoting.servlet.DwrServlet--> <servlet-class>it.netbureau.DwrSessionspike.Initiate</servlet-class> <init-param> <param-name>debug</param-name> <param-value>true</param-value> </init-param> <init-param> <description>enable/disable Comet(reverse ajax) </description> <param-name>activeReverseAjaxEnabled</param-name> <param-value>true</param-value> </init-param> <init-param> <param-name>maxWaitAfterWrite</param-name> <param-value>-1</param-value> </init-param> </servlet> <servlet-mapping> <servlet-name>dwr-invoker</servlet-name> <url-pattern>/dwr/*</url-pattern> </servlet-mapping> dwr 3.0 rc1 is a jar(.class files) in the lib folder of my project and the classes are under /build/classes folder (instead of src: /scr/java) like netbeans 6.7 do.. i wouldn't to include all dwr source and modify dwr code..... Init was not called, why? thank you ---------- Initial Header ----------- From : "Lance Java" lance.java@... To : users@... Cc : Date : Thu, 29 Oct 2009 10:33:18 +0000 Subject : Re: [dwr-user] help problem with diferentiating uses with dwr sessions > Unfortunately, you can't plugin a scriptsessionlistener using the normal DWR > dependency injection (see > http://bugs.directwebremoting.org/bugs/browse/DWR-384) > > You will need the following code to execute after the DWR servlet > initializes: > > Container container = ServerContextFactory.get().getContainer(); > ScriptSessionManager manager = > container.getBean(ScriptSessionManager.class); > manager.addScriptSessionListener(myScripSessionListener); > > Here's a couple of places you can do this: > 1. Extend the DWR servlet and execute the code after the DWR servlet > initializes > 2. Execute the code in a servlet that has a <load-on-startup /> value larger > than the DWR servlet. > > Cheers, > Lance. > > > 2009/10/29 ytrewq2002@... <ytrewq2002@...> > > > hi to all, > > > > problem: > > i write a dwr push.. a web page have got a textbox with a button. only the > > user that write abc and send with button to dwr can get the push data > > (BrowserwithPage and other update all pages so don't works for me i > > suppose). > > > > my solution: > > > > i begin with reading session created (1) and then (2) apply > > push; > > I read about to differentiate users using scriptsession at: > > http://directwebremoting.org/dwr/reverse-ajax/hints-and-tips.html: > > > > 1) > > > > when a try to construct a listener it doesn't works: > > > > public class Initiate implements ScriptSessionListener{ > > .. > > > > public void sessionCreated(ScriptSessionEvent arg0) { > > System.out.println("IDSessionDwrListener: new session created for > > user " + u.getUser_id() > > + "on WebContext: " + d.getWebContext()); > > } > > > > public void sessionDestroyed(ScriptSessionEvent arg0) { > > System.out.println("IDSessionDwrListener: Session destroyed" + > > u.getUser_id() > > + "on WebContext: " + d.getWebContext()); > > } > > .. > > > > public void startService(String id_user){ > > .. > > Container container = d.getWebContext().getContainer(); > > ScriptSessionManager manager = > > container.getBean(ScriptSessionManager.class); > > manager.addScriptSessionListener(this); > > .. > > } > > > > so i try to add to web.xml (servlet) this: > > > > <init-param> > > <description>enable SessionScriptListener</description> > > > > <param-name>org.directwebremoting.event.ScriptSessionListener</param-name> > > <param-value>it.netbureau.DwrSessionSpike.Initiate</param-value> > > </init-param> > > </servlet> > > > > but i get from dwr: > > GRAVE: - Can't use : it.netbureau.DwrSessionSpike.Initiate@14c5b37 to > > implement org.directwebremoting.event.ScriptSessionListener. Reason: > > java.lang.ClassNotFoundException: > > it.netbureau.DwrSessionSpike.Initiate@14c5b37 > > org.directwebremoting.impl.DefaultContainer@2da5a6 > > org.directwebremoting.impl.DefaultScriptSessionManager@1b09282 > > > > why? > > > > 2) i try to set the value properties of a session: > > > > webContext d = getWebContext.. > > > > if (u.getUser_id().equals("abc")){ > > ScriptSession scriptSession = d.getScriptSession(); > > scriptSession.setAttribute("user_id", "abc"); > > } > > //if i am user abc so pushing data > > ScriptSession scriptSession = d.getScriptSession(); > > String userid = ((String)scriptSession.getAttribute("user_id")); > > if (userid!=null && userid.equals(userIDSelected)){ > > System.out.println("i'm abc"); > > } > > > > .. ok this work open 2, 3 browser and write abc, dfg, hjj > > only one time "abc" appear on systm.out > > so now how can say to dwr to give data only to user (session with abc?)? > > > > Browser.withPage(page, new Runnable() { doesn't work > > Browser.withSession could be? i used it but it doesn't work, maybe i'm > > wrong? how does works? > > > > > > please help me, i'm terrible late in the project developping > > thank you very much > > > > Roby > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: users-unsubscribe@... > > For additional commands, e-mail: users-help@... > > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: help problem with extending dwrServletIt looks to me like you haven't deployed your class to tomcat.
2009/10/29 ytrewq2002@... <ytrewq2002@...> hi |
|
|
|
| Free embeddable forum powered by Nabble | Forum Help |