about authentication
Hi! Can someone explain how tomcat handles authentication. My problem is, that i must access secure EJB's from my web application, and everything work fine, if i use tomcat's basic or form authentication, but the problem is that i cannot show login page (basic or form), and i will use static principal & credential. (username/password). I have make security filter, which login to loginmodule (org.jboss.security.ClientLoginModule) in filter, and login seems to success. i put subject to session, and i use it in my code: Subject s = (Subject) getHttpServletRequest().getSession().getAttribute("subject"); System.out.println("Delegate.test() subject: " + s); s.doAs(null, new PrivilegedAction() { public Object run() { try { DocumentControllerHomeLocal home = ((DocumentControllerHomeLocal)getRunData().getBean("documentControllerHomeLocal")); DocumentControllerLocal local = home.create(); getEjbLocalObject(local); setEjbLocalObject(((DocumentControllerHomeLocal) getBean("testLocalHome")).create()); } catch(Throwable t) { t.printStackTrace(); } return null; } }); That system.out show's me that correct principal / credential is associated with subject, so login in success when i get home object. (by springframework JndiAccess) but it just wont work! authentication data is not marshalled with (home.create()) RMI call, no matter what i try. I have tried to search what tomcat do in different way in basic authentication, but i am very busy, and i have no time to read all authentication code.. so i will be very happy every help. btw. i use jboss.. Thnx already, Artsi - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: about authentication
Solution was to fix configuration name.. my stubid mistake.. Happy christmas and new year, Tomcat is best servlet container, keep up good work team! Artsi On Mon, 2004-12-27 at 10:48, Arto Pastinen wrote: > Hi! > > Can someone explain how tomcat handles authentication. > > My problem is, that i must access secure EJB's from my web application, > and everything work fine, if i use tomcat's basic or form > authentication, but the problem is that i cannot show login page (basic > or form), and i will use static principal & credential. > (username/password). > > I have make security filter, which login to loginmodule > (org.jboss.security.ClientLoginModule) in filter, and login seems to > success. > > i put subject to session, and i use it in my code: > > Subject s = (Subject) > getHttpServletRequest().getSession().getAttribute("subject"); > System.out.println("Delegate.test() subject: " + s); > s.doAs(null, new PrivilegedAction() { > public Object run() { > try { > DocumentControllerHomeLocal home = > ((DocumentControllerHomeLocal)getRunData().getBean("documentControllerHomeLocal")); > > DocumentControllerLocal local = home.create(); > getEjbLocalObject(local); > > setEjbLocalObject(((DocumentControllerHomeLocal) > getBean("testLocalHome")).create()); > } > catch(Throwable t) { > t.printStackTrace(); > } > return null; > } > }); > > That system.out show's me that correct principal / credential is > associated with subject, so login in success when i get home object. (by > springframework JndiAccess) but it just wont work! > authentication data is not marshalled with (home.create()) RMI call, no > matter what i try. > > I have tried to search what tomcat do in different way in basic > authentication, but i am very busy, and i have no time to read all > authentication code.. so i will be very happy every help. > > btw. i use jboss.. > > Thnx already, Artsi > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Bug??
Hi! Isn't that maven plugins fault? Artsi On Mon, 2004-12-27 at 18:18, Carbone, Adam wrote: > I noticed that in several discussions and bugs about locking and how > resources got deployed and this was causing them to be locked so they need > to be un-deployed manually. The reason I'm asking it that I 'm having issue > with tomcat 5.5. I have been using tomcat 5.0.28 for quite a while in > combination with maven to do a un-deploy and deploy using the manager > console. I just upgraded to tomcat 5.5 because the decision was made that we > are upgrading which I agree with for the features that it provides. But now > when I un-deploy it succeeds successfully but doesn't really undeploy there > are still thing left in the webapps/contextXXX folder. > > [echo] /XXX-portal > > build:start: > > > > war:init: > > > > tomcat:undeploy: > > [echo] {USER_WORKSPACE}\XXX-portal/target/XXX-portal > > [undeploy] OK - Undeployed application at context path /XXX-portal > > [undeploy] > > BUILD SUCCESSFUL > > Total time: 4 seconds > > Finished at: Wed Dec 22 10:29:24 GMT-05:00 2004 > > > > So I try to deploy and it says I can because there is an application with > the same name. > > tomcat:deploy: > > [deploy] FAIL - Application already exists at path /mss-portal > > [deploy] > > > > BUILD FAILED > > > > So try to un-deploy again and I get this. > > tomcat:undeploy: > > [echo] {USER_WORKSPACE}\XXX-portal/target/XXX-portal > > [undeploy] FAIL - Encountered exception LifecycleException: Container > org.apache.catalina.core.ContainerBase.[Catalina]. > > [localhost].[/XXX-portal] has not been started > > [undeploy] > > > > BUILD FAILED > > > > So at this point I need to manually shut down tomcat and remove the > directory. I have tried both of the options that were listed for context > without any avail?> > > > > All combinations listed below have been tried > > > > * > > * > > * > > > > Is there anything else I can do or try? > > > > I'm using the following configuration > > > > * Windows XP sp2 > * J2SDK 1.4.2_04 > * Tomcat 5.5.4 with compatability patch > > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Bug??
Hi! I remember one time my friend has same problem in windows. It was because windows file system has lock directory, so it cannot be removed until JVM process was shutdown. I don't know any solution, i haven use windows in software development in years now.. =)) Artsi ti, 2004-12-28 kello 14:04 -0500, Carbone, Adam kirjoitti: > Has anyone else encountered this problem? I have heard several replies like > well it only happens on windows so we are not going to worry about it well a > lot of people use windows. As soon as I can I will no longer be using > windows but for now I'm stuck. > > Case to reproduce > > 1) Deploy a jar through the tomcat manager console > 2) Access that web context. > 3) Un-Deploy through the tomcat manager console (notice it does not > disappear in the list only gets stopped). > 4) Try to redeploy - Message: FAIL - Application already exists at path > /mss-portal > 5) Try to undeploy again. - Message: FAIL - Encountered exception > LifecycleException: Manager has not yet been started > > I need help if there is a work around please let me know... > > As I have said below I have tried the locking flags on context. > > ACARBONE > > -Original Message- > From: Carbone, Adam [mailto:[EMAIL PROTECTED] > Sent: Tuesday, December 28, 2004 9:11 AM > To: 'Tomcat Developers List' > Subject: RE: Bug?? > > No, the plugin is just using the manager deploy function. Happens if I do it > through the manager console. > > > -Original Message- > From: Arto Pastinen [mailto:[EMAIL PROTECTED] > Sent: Tuesday, December 28, 2004 2:24 AM > To: Tomcat Developers List > Subject: Re: Bug?? > > Hi! > > Isn't that maven plugins fault? > > Artsi > > On Mon, 2004-12-27 at 18:18, Carbone, Adam wrote: > > I noticed that in several discussions and bugs about locking and how > > resources got deployed and this was causing them to be locked so they need > > to be un-deployed manually. The reason I'm asking it that I 'm having > issue > > with tomcat 5.5. I have been using tomcat 5.0.28 for quite a while in > > combination with maven to do a un-deploy and deploy using the manager > > console. I just upgraded to tomcat 5.5 because the decision was made that > we > > are upgrading which I agree with for the features that it provides. But > now > > when I un-deploy it succeeds successfully but doesn't really undeploy > there > > are still thing left in the webapps/contextXXX folder. > > > > [echo] /XXX-portal > > > > build:start: > > > > > > > > war:init: > > > > > > > > tomcat:undeploy: > > > > [echo] {USER_WORKSPACE}\XXX-portal/target/XXX-portal > > > > [undeploy] OK - Undeployed application at context path /XXX-portal > > > > [undeploy] > > > > BUILD SUCCESSFUL > > > > Total time: 4 seconds > > > > Finished at: Wed Dec 22 10:29:24 GMT-05:00 2004 > > > > > > > > So I try to deploy and it says I can because there is an application with > > the same name. > > > > tomcat:deploy: > > > > [deploy] FAIL - Application already exists at path /mss-portal > > > > [deploy] > > > > > > > > BUILD FAILED > > > > > > > > So try to un-deploy again and I get this. > > > > tomcat:undeploy: > > > > [echo] {USER_WORKSPACE}\XXX-portal/target/XXX-portal > > > > [undeploy] FAIL - Encountered exception LifecycleException: Container > > org.apache.catalina.core.ContainerBase.[Catalina]. > > > > [localhost].[/XXX-portal] has not been started > > > > [undeploy] > > > > > > > > BUILD FAILED > > > > > > > > So at this point I need to manually shut down tomcat and remove the > > directory. I have tried both of the options that were listed for context > > without any avail?> > > > > > > > > All combinations listed below have been tried > > > > > > > > * > > > > * > > > > * > > > > > > > > Is there anything else I can do or try? > > > > > > > > I'm using the following configuration > > > > > > > > * Windows XP sp2 > > * J2SDK 1.4.2_04 > > * Tomcat 5.5.4 with compatability patch > > > > > > > > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
bug with konqueror?
Hi! I don't know is this tomcat, konqueror or konqueror/pdf plugin's fault, but i have made resource servlet, which read pdf document from disk and writes it to OutputStream, tomcat keep throwing following stack: 11:36:39,898 INFO [STDOUT] ClientAbortException: java.net.SocketException: Connection reset 11:36:39,899 INFO [STDOUT] at org.apache.coyote.tomcat5.OutputBuffer.realWriteBytes(OutputBuffer.java:373) 11:36:39,899 INFO [STDOUT] at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:398) 11:36:39,900 INFO [STDOUT] at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:262) 11:36:39,900 INFO [STDOUT] at org.apache.coyote.tomcat5.OutputBuffer.writeByte(OutputBuffer.java:427) 11:36:39,900 INFO [STDOUT] at org.apache.coyote.tomcat5.CoyoteOutputStream.write(CoyoteOutputStream.java:64) 11:36:39,900 INFO [STDOUT] at fi.canter.kp.servlets.FileResourceServlet.service(FileResourceServlet.java:33) 11:36:39,900 INFO [STDOUT] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810) 11:36:39,901 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) 11:36:39,901 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) 11:36:39,901 INFO [STDOUT] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214) 11:36:39,901 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) 11:36:39,902 INFO [STDOUT] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) 11:36:39,902 INFO [STDOUT] at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198) 11:36:39,902 INFO [STDOUT] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152) 11:36:39,902 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) ... Everything works fine if i use wget or firefox. I just wonder reason, because i can use konqueror to read documents from apache or some other application server's. btw. my application is in JBoss 3.2.4. Artsi - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JNDI InitialContext problem
Define jndi provider url. Artsi On Wed, 2005-01-12 at 12:42, Jyrki Saarinen wrote: > Hello, > > I'm using Java Message Service (JMS) in a webapp. My > standalone JMS test programs works as it should, but > the same code fails when run under Tomcat. The > problem is what "new InitialContext()" returns. > > In standalone JMS test program, > Context context = new InitialContext(); returns > > defaultInitCtx: javax.naming.Context = > [EMAIL PROTECTED] > > Howevern, when running inside Tomcat, > Context context = new InitialContext(); returns > > defaultInitCtx: javax.naming.Context = > [EMAIL PROTECTED] > > this later Context has of course no knowledge of > JMS Administrated Objects (Topic and ConnectionFactory). > > Is there a way > > Jyrki > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]