javax.servlet.UnavailableException: Parsing error processing resource path
Hi, I have not been able to figure out why I have the following exception from tomcat: StandardContext[/ClientComponentTier]: Servlet /ClientComponentTier threw load() exception javax.servlet.UnavailableException: Parsing error processing resource path /WEB-INF/struts-config-client.xml The struts-config.xml and the struts-config-client.xml files contain minimum decleration that are listed in this email. Any help is greagly appreciated. Kam Lung Leung debug information 2005-09-17 10:43:40 WebappLoader[/ClientComponentTier]: Deploy JAR /WEB-INF/lib/xercesImpl.jar to /usr/local/catalina/webapps/ClientCom ponentTier/WEB-INF/lib/xercesImpl.jar 2005-09-17 10:43:41 StandardManager[/ClientComponentTier]: Seeding random number generator class java.security.SecureRandom 2005-09-17 10:43:41 StandardManager[/ClientComponentTier]: Seeding of random number generator has been completed 2005-09-17 10:43:42 StandardWrapper[/ClientComponentTier:AlertClientActionServet]: Marking servlet AlertClientActionServet as unavailab le 2005-09-17 10:43:42 StandardContext[/ClientComponentTier]: Servlet /ClientComponentTier threw load() exception javax.servlet.UnavailableException: Parsing error processing resource path /WEB-INF/struts-config-client.xml at org.apache.struts.action.ActionServlet.handleConfigException(ActionServlet.java:1035) at org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServlet.java:1014) at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:955) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:470) at javax.servlet.GenericServlet.init(GenericServlet.java:256) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:935) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:823) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3427) at org.apache.catalina.core.StandardContext.start(StandardContext.java:3628) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:821) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595) at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:307) at org.apache.catalina.core.StandardHost.install(StandardHost.java:788) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:492) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:400) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:718) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:358) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1196) at org.apache.catalina.core.StandardHost.start(StandardHost.java:754) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:363) at org.apache.catalina.core.StandardService.start(StandardService.java:497) at org.apache.catalina.core.StandardServer.start(StandardServer.java:2190) at org.apache.catalina.startup.Catalina.start(Catalina.java:512) at org.apache.catalina.startup.Catalina.execute(Catalina.java:400) at org.apache.catalina.startup.Catalina.process(Catalina.java:180) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203) *web.xml web-app !-- Standard Action Servlet Configuration (with debugging) -- servlet servlet-nameAlertClientActionServet/servlet-name servlet-classorg.apache.struts.action.ActionServlet/servlet-class init-param param-nameconfig/param-name param-value/WEB-INF/struts-config.xml, /WEB-INF/struts-config-client.xml/param-value /init-param init-param param-namedebug/param-name param-value0/param-value /init-param init-param param-namedetail/param-name param-value0/param-value /init-param load-on-startup1/load-on-startup /servlet servlet-mapping servlet-nameAlertClientActionServet/servlet-name url-pattern*.do/url-pattern /servlet-mapping !-- Struts Tag Library Descriptors -- taglib taglib-uristruts-bean/taglib-uri taglib-location/WEB-INF/tld/struts
RE: Blocking urls
Hi, I am also looking for a way to block access to the valid pages. Can you give a brief explanation on how would you use the filter to block? I am thinking to use the web.xml to set the privilege for each user. Thank you in advance, Kam Tomcat Users List tomcat-user@jakarta.apache.org wrote: I am also looking for a way to block access for administrator pages. Could you fill me in also? Thanks, Robyne -Original Message- From: Jim Henderson [mailto:[EMAIL PROTECTED] Sent: Thursday, June 23, 2005 7:49 AM To: Tomcat Users List Subject: RE: Blocking urls Found a solution: using filters to block direct access to the Web pages. -Original Message- From: Jim Henderson [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 22, 2005 8:48 AM To: Tomcat Users List Subject: Blocking urls I am working on porting a WebSphere JSP application to Tomcat. I can not seem to find a way in Tomcat to block access to valid pages within the application. I don't want the user to access selected pages by them typing the URL to the pages in question. Is there a means to prevent this in Tomcat? - 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]
Better explained of my problem with renaming a file in Tomcat
Hi, I have a servlet, RenameFile, that receives audio file via HTTP Post and writes it to /tmp/recording.0002002B-0C0022BB-0001.1.20050622.073208.wav. Then it creates directories under /alert_messages directory based on the timing parameters that it get. Finally, it renames the /tmp/recording.0002002B-0C0022BB-0001.1.20050622.073208.wav file to /alert_messages/2005/06/22/22/00/79_0_20050600_001.WAV. RenameFile runs fine when it runs by itself (ONLY one Tomcat, jakarta-tomcat-4.1.30, is running). However, RenameFile fails to rename the /tmp/recording.0002002B-0C0022BB-0001.1.20050622.073208.wav to /alert_messages/2005/06/22/22/00/79_0_20050600_001.WAV when it runs in a Linux box that jboss-3.2.1_tomcat-4.1.24 is also running. In this box, TWO versions of Tomcat are running at the same time. I set the /alert_messages directory with “chmod –R 777” and run jakarta-tomcat-4.1.30 as tomcat user. RenameFile fails the rename operation. But, it creates the /alert_messages/2005/06/22/22/00/ directories. It seem like RenameFile can create directory but can’t create file in the /alert_messages directory when both version of tomcats are running at the same time. Can it be due to both the jakarta-tomcat-4.1.30 and the jboss-3.2.1_tomcat-4.1.24 versions are running at the same time in one Linux box? Can this be Jboss prevented the operation? Any help in this issue is greatly appreciated. Debug listing from the RenameFile; - originalFilename: recording.0002002B-0C0022BB-0001.1.20050622.073208.wav - file.toString(): /tmp/recording.0002002B-0C0022BB-0001.1.20050622.073208.wav - file.getName(): recording.0002002B-0C0022BB-0001.1.20050622.073208.wav - file.length(): 122986 - file /alert_messages/2005/06/22/22/00/79_0_20050600_001.WAV - file NOT renamed /alert_messages/2005/06/22/22/00/79_0_20050600_001.WAV File Listing in the /tmp directory create by RenameFile; -rw-r--r--1 tomcat tomcat 122986 Jun 22 07:33 recording.0002002B-0C0022BB-0001.1.20050622.073208.wav Directoy Listing in the / directory with “ls –la”; drwxrwxrwx3 tomcat tomcat 4096 Jun 22 07:28 alert_messages Directory created by the RenameFile with “ls -la /alert_messages/2005/06/22/22/00”; drwxr-xr-x2 tomcat tomcat4096 Jun 22 07:33 . drwxr-xr-x3 tomcat tomcat4096 Jun 22 07:33 .. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Better explained of my problem with renaming a file in Tomcat
Hi Jason, Thank very much for helping me to solve this issue. Only the jakarta-tomcat-4.1.30 contains servlet named RenameFile. The other version of tomcat ( jboss-3.2.1_tomcat-4.1.24) is embedded in the Jboss. This version of tomcat does not contais the servlet named RenameFile. A color coded of the java class that does the renaming of the file is listed in the following site: http://forum.java.sun.com/thread.jspa?threadID=638498 Thank again for your help. Jason Bainbridge [EMAIL PROTECTED] wrote: On 6/22/05, Kam Lung Leung [EMAIL PROTECTED] wrote: Hi, I have a servlet, RenameFile, that receives audio file via HTTP Post I should have read your post better and realized there was no Java method for RenameFile as that is what I wrongly assumed... How exactly are you ceating the directories and trying to move the file? Are both servers running the same servlet and doing similar things? -- Jason Bainbridge http://kde.org - [EMAIL PROTECTED] Personal Site - http://jasonbainbridge.com - 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: Better explained of my problem with renaming a file in Tomcat
Hi, Thank to stdunbar for pointing out the problem that I was having. It turns out that the /tmp and the /alert_messages ware mounted on two different nodes in the file system. After changing the directory for writing the temporary audio file to be the same as the /alert_messages directory. The problem goes away. /dev/sda11 497829 27391444736 6% /tmp /dev/sda7 1011928217304743220 23% / Thank Jason for his help. Kam Kam Lung Leung [EMAIL PROTECTED] wrote: Hi Jason, Thank very much for helping me to solve this issue. Only the jakarta-tomcat-4.1.30 contains servlet named RenameFile. The other version of tomcat ( jboss-3.2.1_tomcat-4.1.24) is embedded in the Jboss. This version of tomcat does not contais the servlet named RenameFile. A color coded of the java class that does the renaming of the file is listed in the following site: http://forum.java.sun.com/thread.jspa?threadID=638498 Thank again for your help. Jason Bainbridge [EMAIL PROTECTED] wrote: On 6/22/05, Kam Lung Leung [EMAIL PROTECTED] wrote: Hi, I have a servlet, RenameFile, that receives audio file via HTTP Post I should have read your post better and realized there was no Java method for RenameFile as that is what I wrongly assumed... How exactly are you ceating the directories and trying to move the file? Are both servers running the same servlet and doing similar things? -- Jason Bainbridge http://kde.org - [EMAIL PROTECTED] Personal Site - http://jasonbainbridge.com - 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]
Just testing please ignore it.
Sincerely yours, br br br br br Kam Lung Leung br Presidentbr strong Advanced Voice Technologies, Inc.br /strong strong A href=http://www.advoicetech.com; target=_blankwww.advoicetech.com /A /strongbr strongOffice:/strong 303.539.2950br strongFax:/strong 303.539.2951br strongOur business is to bring your clients to you by personalized voice messaging. br/strong - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Can't rename a file using renameTo()
Hi, I have a servlet, Servlet-A, that rename a file from /tmp/oldFile to /someDirectory/newFile. The Servlet-A runs fine when it runs by itself in a Red Hat Linux 7.2 server that has jakarta-tomcat-4.1.30 running. However, it false to rename the /tmp/oldFile to /someDirectory/newFile when the Servlet-A run (within the jakarta-tomcat-4.1.30) in a Red Hat Linux 7.2 server box that also has jboss-3.2.1_tomcat-4.1.24 running. I thought it may be privilege issue so I set the /someDirectory directory with “chmod –R 777” and run Tomcat as a root user. But, it is still false to rename the /tmp/oldFile file to the /someDirectory/newFile. The strange thing is that the Servlet-A was able to write the oldFile to the /tmp directory but can not rename the oldFile to the /someDirectory directory that was allowed for writing for ALL user levels. Can this be Jboss prevented the rename operation. I used the canRead and canWrite to check allowable action by the File. It turns out that the Servlet-A can read and write the /tmp/ oldFile. But the Servlet-A can’t read or write the /someDirectory/newFile. The strangest thing is that when the Servlet-A runs in a Red Hat Linux 7.2 server that has ONLY jakarta-tomcat-4.1.30 running, the condition of canRead and canwrite are the same. Meaning that the Servlet-A was able to read, and write the oldFile. But can’t read, and write the newFile. However, the renameTo() method returned true and the Servlet-A was able to rename the /tmp/oldFile into /someDirectory/newFile. Any help in this issue is greatly appreciated. Kam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can't rename a file using renameTo()
Hi Jason, Thank you for the information. It is a long paragraph. I checked the /SomeDirectory again, and it is the same name. I was able to create directory with the mkdir -p /SomeDirectory/firstSubdirectory/secondSubdirectory and manually created a file by this command touch /SomeDirectory/firstSubdirectory/secondSubdirectory/newFile . The Servlet was able to create directories under the /SomeDirectory directory. For example, the Servlet was able to create /SomeDirectory/firstSubdirectory/secondSubdirectory directories. But the Servlet can’t rename the file named oldFile under the /tmp directory to /SomeDirectory/firstSubdirectory/secondSubdirectory/newFile. The Servlet did created all directories under the /SomeDirectory by not able to move the oldFile to the that directory. The same code work fines what it run without the Jboss running in the same server. Kam Jason Bainbridge [EMAIL PROTECTED] wrote: On 6/21/05, Kam Lung Leung [EMAIL PROTECTED] wrote: Hi, I have a servlet, Servlet-A, that rename a file from /tmp/oldFile to /someDirectory/newFile. The Servlet-A runs fine when it runs by itself in a Red Hat Linux 7.2 server that has jakarta-tomcat-4.1.30 running. However, it false to rename the /tmp/oldFile to /someDirectory/newFile when the Servlet-A run (within the jakarta-tomcat-4.1.30) in a Red Hat Linux 7.2 server box that also has jboss-3.2.1_tomcat-4.1.24 running. I thought it may be privilege issue so I set the /someDirectory directory with chmod –R 777 and run Tomcat as a root user. But, it is still false to rename the /tmp/oldFile file to the /someDirectory/newFile. The strange thing is that the Servlet-A was able to write the oldFile to the /tmp directory but can not rename the oldFile to the /someDirectory directory that was allowed for writing for ALL user levels. Can this be Jboss prevented the rename operation. I used the canRead and canWrite to check allowable action by the File. It turns out that the Servlet-A can read and write the /tmp/ oldFile. But the Servlet-A can't read or write the /someDirectory/newFile. The strangest thing is that when the Servlet-A runs in a Red Hat Linux 7.2 server that has ONLY jakarta-tomcat-4.1.30 running, the condition of canRead and canwrite are the same. Meaning that the Servlet-A was able to read, and write the oldFile. But can't read, and write the newFile. However, the renameTo() method returned true and the Servlet-A was able to rename the /tmp/oldFile into /someDirectory/newFile. It took me a few reads to even come close to following all that but is it possibly that you are trying to copy a subdirectory within /tmp to a subdirectory of /someDirectory that doesn't exist? -- Jason Bainbridge http://kde.org - [EMAIL PROTECTED] Personal Site - http://jasonbainbridge.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
java.lang.ClassCastException when casting from Object to a desired object
Hi, I have a servlet name TestGeneralServiceMenuGenerator that forwards a java object name, BasicUserInformationDO, to a jsp file that is in another web-app. However, these two web-app are in the same VMs. The jsp file keep getting java.lang.ClassCastException when it trys to casting the object to the desire object, BasicUserInformationDO. Any help are greatly appreciated. Kam Lung Leung ** code that forwads the BasicUserInformationDO to the jsp file. ** try { // Initialize BasicUserInformationDO basicUserInformationDO = new BasicUserInformationDO(firstName, lastName, middleName, iD, subID, numberServices, ServiceTypesSubscribed); if (basicUserInformationDO == null) { log.fatal(basicUserInformationDO is null ); throw new java.lang.Throwable(Can not create basicUserInformationDO object); } ServletContext context = request.getSession().getServletContext().getContext(/VoiceComponentTier); if (context == null) { log.fatal(ServletContext is null ); throw new java.lang.Throwable(Don't have the VoiceComponentTier Context); } RequestDispatcher reqDispatcher = context.getRequestDispatcher(/GeneralServiceMenuGenerator.jsp); request.setAttribute(basicUserInfoDO, basicUserInformationDO); reqDispatcher.forward(request, response); } catch (ServletException servletEx) { log.fatal(ServletException : + servletEx.getStackTrace()); request.getSession().getServletContext().log(Servlet Exception , new Throwable(servletEx.toString())); } ** Code on the jsp file that causes java.lang.ClassCastException ** BasicUserInformationDO basicUserInfo = (BasicUserInformationDO)request.getAttribute(basicUserInfoDO); ** debug information from the log file. ** - Root Cause - java.lang.ClassCastException at org.apache.jsp.GeneralServiceMenuGenerator_jsp._jspService(GeneralServiceMenuGenerator_jsp.java:277) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356) at com.wlwa.TestInfra.VoiceComponent.Dispatcher.TestGeneralServiceMenuGenerator.doPost(TestGeneralServiceMenuGenerator.java:95) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2422) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
please help urgent!! Exception when a method returned a Serializable object from Jboss
) { | log.debug(IOException + ExPrintingUtilities.PrintStackTraceElements(ioEx.getStackTrace())); | } catch (Exception Ex) { | log.debug(Exception + ExPrintingUtilities.PrintStackTraceElements(Ex.getStackTrace())); | } catch (Throwable throwableEx) { | log.debug(Throwable + ExPrintingUtilities.PrintStackTraceElements(throwableEx.getStackTrace())); | } | | if (log.isDebugEnabled()) { | log.debug(End validateUserPassword); | } | return basicUserInfoDO; | } /* End validateUserPassword method */ *** Here is the debug information in the log file FATAL [http8091-Processor7] (AccessController.java:180) - $Proxy1.validateUserPassword(Unknown Source) com.wlwa.Alert.VoiceComponentTier.Dispatcher.AccessController.doPost(AccessController.java:141) javax.servlet.http.HttpServlet.service(HttpServlet.java:760) javax.servlet.http.HttpServlet.service(HttpServlet.java:853) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256) org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2422) org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171) org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:163) org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:199) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828) org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:700) org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:584) org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683) java.lang.Thread.run(Thread.java:534) INFO [http8091-Processor7] (AccessController.java:200) - End doPost Thank you in advance for your help. Kam Kam Lung Leung Vice President of Engineering Wireless Web Access Inc. (303) 627-9684 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How To Access EJBs From Standalone Tomcat 4.1.30 and Jboss 3.2
Hi, Can I tried the following approach to lookup the EJBs instead of suggested by the document from http://www.amitysolutions.com.au/documents/JBossTomcatJNDI-technote.pdf Here is what I want to do to get the EJBs from tomcat: 1) use an InitialContext object to get the ENC variables that were declared in the web.xml file. For example, env-entry env-entry-name AppServerIPAddr1 /env-entry-name env-entry-valuelocalhost/env-entry-value env-entry-typejava.lang.String/env-entry-type /env-entry env-entry env-entry-name AppServerIPAddr1PortNumber /env-entry-name env-entry-value1099/env-entry-value env-entry-typejava.lang.String/env-entry-type /env-entry env-entry descriptionINITIAL CONTEXT FACTORY/description env-entry-nameinitialContextFactory/env-entry-name env-entry-value org.jnp.interfaces.NamingContextFactory /env-entry-value env-entry-typejava.lang.String/env-entry-type /env-entry env-entry env-entry-name urlPackagePrefixes /env-entry-name env-entry-value org.jboss.naming:org.jnp.interfaces /env-entry-value env-entry-typejava.lang.String/env-entry-type /env-entry ejb-ref descriptionReference to UserController Bean/description ejb-ref-nameejb/refToUserControllerBean/ejb-ref-name ejb-ref-typeSession/ejb-ref-type home com.wlwa.Infra.BusinessLogic.SessionBeans.Controller.UserControllerRemoteHome /home remote com.wlwa.Infra.BusinessLogic.SessionBeans.Controller.UserControllerRemote /remote ejb-linkUserControllerBean/ejb-link /ejb-ref InitialContext ctx = new InitialContext(); String applicationServer1IPAddress = (String) ctx.lookUp(AppServerIPAddr1); String applicationServer1PortNumber = (String) ctx.lookUp(AppServerIPAddr1PortNumber); String urlPackagePrefixes = (String) ctx.lookUp(urlPackagePrefixes); String initialContextFactory = (String) ctx.lookUp(initialContextFactory); 2) Now when I got all information to create a properties object to be used when create the new InitialContext object for lookup the EJBs outside of the tomcat space. String url = jnp:// + applicationServer1IPAddress + : + applicationServer1PortNumber; Properties props = new Properties(); props.setProperty(Context.INITIAL_CONTEXT_FACTORY, initialContextFactory); props.setProperty(Context.URL_PKG_PREFIXES, urlPackagePrefixes); props.setProperty(Context.PROVIDER_URL, url); InitialContext remoteCtx = new InitialContext(props); 3) Now I have a IinitailContext object that point to the Jboss JNDI service at port 1099. Then I use the following code to access the EJB home object: ... try { anEJBHome = (EJBHome) PortableRemoteObject.narrow(ctx.lookup(java:comp/env/ejb/refToUserControllerBean), aHomeClass); } catch (ClassCastException classCastEx) { throw new EJBHomeFactoryException(classCastEx); } catch (NamingException namingEx) { throw new EJBHomeFactoryException(namingEx); } Here is the ejb declaration for the bean in ejb-jar.xml enterprise-beans session display-nameUser Access Controller Session Bean/display-name ejb-nameUserControllerBean/ejb-name home com.wlwa.Infra.BusinessLogic.SessionBeans.Controller.UserControllerRemoteHome /home remote com.wlwa.Infra.BusinessLogic.SessionBeans.Controller.UserControllerRemote /remote ejb-class com.wlwa.Infra.BusinessLogic.SessionBeans.Controller.UserControllerEJB /ejb-class session-typeStateless/session-type transaction-typeContainer/transaction-type /session /enterprise-beans Here is the declaration in jboss.xml Code: jboss enterprise-beans session ejb-nameUserControllerBean/ejb-name jndi-nameUserControllerBeanJNDI/jndi-name resource-ref res-ref-namejdbc/AlertDB/res-ref-name jndi-namejava:/jdbc/AlertDB/jndi-name /resource-ref /session .. enterprise-beans jboss The UserControllerBean was packaged under a jar file named InfraSessionBeansControllerModule.jar in an ear file named MyApp.ear that was deployed in Jboss server in the same box as the tomcat was running. However, I got NamingException org.jnp.server.NamingServer.getBinding(NamingServer.java:495) org.jnp.server.NamingServer.getBinding(NamingServer.java:503)
Can Not Get Tomcat 4.1.27 To Unpack Web Component When There Is A Context Defined For The Web Component
Hi, I installed Tomcat 4.1.27 on our linux Redhat 7.2 box. Tomcat did unpack all web components when there is NO context definition defined for each of these web components in the server.xml file. However, when I create a context for each of these web components, then Tomcat did not unpack these web components. Any suggestion is greatly appreciated. Here is the context definition for one of my web component: Context path=/TestDistributedInputOutput docBase=TestDistributedInputOutput debug=0 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=TestDistributedInputOutput suffix=.log timestamp=true/ Resources className=org.apache.naming.resources.FileDirContext allowLinking=true / /Context Here is a listing of my steps to startup Tomcat: 1) Stop Tomcat 2) Remote the directory created by Tomcat for TestDistributedInputOutput.war 3) Add the above context definition in the server.xml for TestDistributedInputOutput.war. 4) Startup Tomcat Here is the message from Tomcat. 2004-04-13 14:20:26 StandardContext[/TestDistributedInputOutput]: Resources start failed: java.lang.IllegalArgumentException: Document base /usr/local/catalina/webapps/TestDistributedInputOutput does not exist or is not a readable directory at org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:193) at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:3343) at org.apache.catalina.core.StandardContext.start(StandardContext.java:3473) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188) at org.apache.catalina.core.StandardHost.start(StandardHost.java:738) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347) at org.apache.catalina.core.StandardService.start(StandardService.java:497) at org.apache.catalina.core.StandardServer.start(StandardServer.java:2190) at org.apache.catalina.startup.Catalina.start(Catalina.java:512) at org.apache.catalina.startup.Catalina.execute(Catalina.java:400) at org.apache.catalina.startup.Catalina.process(Catalina.java:180) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can someone help me to fix the soft link problem in Tomcat 4.1.27
Hi Doug, Thank for the information. Did you use Tomcat 4.1.27 version? I did not use the manager to restart the web component. What I did is following: 1) stop tomcat, remove the myApp.war, and the myApp directory. 2) copy the new myApp.war into the webapps directory. 3) start tomcat. When I removed the Context that was defined for the myApp.war then Tomcat unpack the myApp.war and everything is OK. I may missing something in the server.xml file. Can you provide a server.xml file that contains a simple Context definition that I may use to setup my myApp.war. Thank you in advance, Kam On Fri, 9 Apr 2004 18:12:20 -0400, Parsons Technical Services wrote: Kam, The existence of a context in the server.xml will not prevent Tomcat from unpacking a war. I have a development box that has the context defined and the manager can undeploy and deploy the war just fine. Also restart is not required. What Tomcat will not do is unpack any war for which a matching directory already exist under webapps. Part of the undeploy action of the manager is to delete the directory. Doug - Original Message - From: Kam Lung Leung [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, April 09, 2004 5:44 PM Subject: RE: Can someone help me to fix the soft link problem in Tomcat 4.1.27 Thank Subir, The link does help me to fix the problem. After creating a context for my web component DistributedInputOutput in the server.xml file. Tomcat is no longer unpack my web componemt DistributeInputOutput.war at startup. Tomcat complains the directory is not accessible. In fact Tomcat will not unpack any web components said myWebComp.war when there is a Context defined in the server.xml. However, Tomcat does unpack other web components when the server.xml does not contains a Context defined for this web component. I come to a conclusion is that the Context is used for web component that need not to be unpacked when Tomcat startup. Another the way to say this is that if I need the web component to be unpack when Tomcat startup, then I should not defined a Context for that web component in the server.xml. Please let me know if this is not the case. Thank, Kam On Thu, 8 Apr 2004 16:12:50 -0700, Subir Sengupta wrote: http://marc.theaimsgroup.com/?l=tomcat-userm=105159411609623w=2 -Original Message- From: Kam Lung Leung [mailto:[EMAIL PROTECTED] Sent: Thursday, April 08, 2004 2:54 PM To: [EMAIL PROTECTED] Subject: Can someone help me to fix the soft link problem in Tomcat 4.1.27 Hi, I installed Tomcat 4.1.27 on our server and drop a myApp.war into the webapps directory. We restart Tomcat and wait for it to finish to unpack all web components, then we stop Tomcat. We create a soft link within our web component to point to directory outside the root context of our web component. But Tomcat says the requested resource is not available when we try to access the soft linked directory from the browser. In fact a null shows up in the last modified column. Can someone please tell me what to do to fix this problem. Your help is greatly appreciated. Kam - 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] Kam Lung Leung Vice President of Engineering Wireless Web Access Inc. (303) 627-9684 - 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]
RE: Can someone help me to fix the soft link problem in Tomcat 4.1.27
Thank Subir, The link does help me to fix the problem. After creating a context for my web component DistributedInputOutput in the server.xml file. Tomcat is no longer unpack my web componemt DistributeInputOutput.war at startup. Tomcat complains the directory is not accessible. In fact Tomcat will not unpack any web components said myWebComp.war when there is a Context defined in the server.xml. However, Tomcat does unpack other web components when the server.xml does not contains a Context defined for this web component. I come to a conclusion is that the Context is used for web component that need not to be unpacked when Tomcat startup. Another the way to say this is that if I need the web component to be unpack when Tomcat startup, then I should not defined a Context for that web component in the server.xml. Please let me know if this is not the case. Thank, Kam On Thu, 8 Apr 2004 16:12:50 -0700, Subir Sengupta wrote: http://marc.theaimsgroup.com/?l=tomcat-userm=105159411609623w=2 -Original Message- From: Kam Lung Leung [mailto:[EMAIL PROTECTED] Sent: Thursday, April 08, 2004 2:54 PM To: [EMAIL PROTECTED] Subject: Can someone help me to fix the soft link problem in Tomcat 4.1.27 Hi, I installed Tomcat 4.1.27 on our server and drop a myApp.war into the webapps directory. We restart Tomcat and wait for it to finish to unpack all web components, then we stop Tomcat. We create a soft link within our web component to point to directory outside the root context of our web component. But Tomcat says the requested resource is not available when we try to access the soft linked directory from the browser. In fact a null shows up in the last modified column. Can someone please tell me what to do to fix this problem. Your help is greatly appreciated. Kam - 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] Kam Lung Leung Vice President of Engineering Wireless Web Access Inc. (303) 627-9684 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Can someone help me to fix the soft link problem in Tomcat 4.1.27
Hi, I installed Tomcat 4.1.27 on our server and drop a myApp.war into the webapps directory. We restart Tomcat and wait for it to finish to unpack all web components, then we stop Tomcat. We create a soft link within our web component to point to directory outside the root context of our web component. But Tomcat says the requested resource is not available when we try to access the soft linked directory from the browser. In fact a null shows up in the last modified column. Can someone please tell me what to do to fix this problem. Your help is greatly appreciated. Kam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
soft linking of directory in tomcat 4.1.27 is not working for me
Hi, I recently upgraded to tomcat 4.1.27. Some how the soft linking of directory within my web application directory is no longer accessible from a browser. It must be configuration issue. Can some please let me know how to configure tomcat 4.1.27 so that it will follow the soft linked directory. Thank you in advance, - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can Tomcat servers files outside the webapps directory
Hi Emerson, Thank you for your help. But I don't understand why I do I have to write Java code to transmit the file. Shouldn't Tomcat already has this capability. For example, when we press a link that references to a image said http://hostName:portNumber/ImageFile/myImage.jpeg from a browser, then image is render by the web container to the browser so that the user on the other end can see it. I thought all I have to do is to create a context for this purpose. Where the context path for this web component points to the directory at /audio instead of a directory under the webapps. Thanks, Kam On Thu, 01 Apr 2004 19:15:55 -0300, Emerson Cargnin wrote: I think you have to do the inverted way as described in the thread Re: redirecting uploaded files in tomcat5, by TomK, you have to accept the http request, read from an InputStream and write to an OutputStream... Just suggest to use Buffered streams, as it will help in the performance. BufferedInputStream bf=new BufferedInputStream(new FileInputStream(/file_or_dir)); The rest of the code remaisn the same... []s Emerson Kam Lung Leung wrote: Hi, I am working on a project that needs to retrieve audio files under the root directory of a server (/audio). My question is that Can Tomcat 4.x servers files that are not in the webapps directory. If it can, can someone point me to an example of such set up. Here is an example of how the audio file may be requested from a servlet using http. http://hostName:portNumber/myApp/Hi.wav Tomcat should fetch the audio file Hi.wav from the /audio directory and not from the myApp that is under the webapps directory. Thank you in advance, Kam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Emerson Cargnin Analista de Sistemas Setor de Desenvolvimento de Sistemas - TRE-SC tel : (048) - 251-3700 - Ramal 3181 - 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: Can Tomcat servers files outside the webapps directory
Thank Emerson, That was what we had done so far. This is what we did; 1) deploy the myApp.war to the webapps directory. 2) start up tomcat and watching tomcat unpacks the myApp.war 3) stop tomcat after all wars are deployed 4) manually create a soft link within the myApp directory ex. ls -s theActualAudioDirectory theSoftLinkAudioDirectoryName The theSoftLinkAudioDirectoryName now point to the theActualAudioDirectory 5) start up tomcat again. But what if we can not do that in the future version of tomcat then the above steps can not be done. Do you have any better idea? Thank, On Fri, 02 Apr 2004 15:38:22 -0300, Emerson Cargnin wrote: You can do this way, but a context just for containing the audio files is a kind of weird. Other approach is to have a symbolic link from your context to the audio directory... Kam Lung Leung wrote: Hi Emerson, Thank you for your help. But I don't understand why I do I have to write Java code to transmit the file. Shouldn't Tomcat already has this capability. For example, when we press a link that references to a image said http://hostName:portNumber/ImageFile/myImage.jpeg from a browser, then image is render by the web container to the browser so that the user on the other end can see it. I thought all I have to do is to create a context for this purpose. Where the context path for this web component points to the directory at /audio instead of a directory under the webapps. Thanks, Kam On Thu, 01 Apr 2004 19:15:55 -0300, Emerson Cargnin wrote: I think you have to do the inverted way as described in the thread Re: redirecting uploaded files in tomcat5, by TomK, you have to accept the http request, read from an InputStream and write to an OutputStream... Just suggest to use Buffered streams, as it will help in the performance. BufferedInputStream bf=new BufferedInputStream(new FileInputStream(/file_or_dir)); The rest of the code remaisn the same... []s Emerson Kam Lung Leung wrote: Hi, I am working on a project that needs to retrieve audio files under the root directory of a server (/audio). My question is that Can Tomcat 4.x servers files that are not in the webapps directory. If it can, can someone point me to an example of such set up. Here is an example of how the audio file may be requested from a servlet using http. http://hostName:portNumber/myApp/Hi.wav Tomcat should fetch the audio file Hi.wav from the /audio directory and not from the myApp that is under the webapps directory. Thank you in advance, Kam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Emerson Cargnin Analista de Sistemas Setor de Desenvolvimento de Sistemas - TRE-SC tel : (048) - 251-3700 - Ramal 3181 - 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] -- Emerson Cargnin Analista de Sistemas Setor de Desenvolvimento de Sistemas - TRE-SC tel : (048) - 251-3700 - Ramal 3181 - 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]
Can Tomcat servers files outside the webapps directory
Hi, I am working on a project that needs to retrieve audio files under the root directory of a server (/audio). My question is that Can Tomcat 4.x servers files that are not in the webapps directory. If it can, can someone point me to an example of such set up. Here is an example of how the audio file may be requested from a servlet using http. http://hostName:portNumber/myApp/Hi.wav Tomcat should fetch the audio file Hi.wav from the /audio directory and not from the myApp that is under the webapps directory. Thank you in advance, Kam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]