Ragav Seth

Greenhorn
+ Follow
since Jan 17, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ragav Seth

Thanks for the reply.

Iam getting the following error though when I try to open the PDF.Other applications are opening perfectly though like word,excel etc.

The error message is

"Adobe reader could not open the file because it is either not a supported file type
or because the file has been corrupted(for example, it
was sent as an email attachment and wasn't correctly decoded)".

The file is not corrupt as Iam able to open it.But when I upload the pdf file to the server and try to read it in my application(a jsp page with a href link to the document from the server),its giving me this error.

Thanks
Ragav
16 years ago
Hello All,

I have the following problem. I have my j2ee application installed in an Unix box.

I maintain a folder in the unix system which has got some PDF files.

Now in my application,I have a hyperlink which opens any one of these PDF files in a new window in a browser.

Iam not able to view the PDF in the browser.I used a plain ahref on the filepath in unix and its not working.

Does the unix system on which the J2EE app is hosted has to have a "Acrobat Reader" installed so that I can use Runtime.getRuntime().exec("") method to view the PDF file?

Thanks
Ragav
16 years ago
I have got this problem before.Check your system to see if you have an underlying virus scanner running. If so then this will cause that error called SMTP cannot connect to port 25.
18 years ago
yes they do.
18 years ago
I have a serious problem on hand.I have this scenario.

User1 logs into my application,sees screen 1.
User 2 logs into my application,sees screen 2.

Now user1 clicks on some link in my application and he sees the page seen by the user2.So he sees whatever page that was last accessed and not what he should be seeing.

I see in the tomcat admin application that 2 sessions are being created for the 2 users.

Does the problem arise because the user clicks an ahref link inside the application and the application loses state?

Iam not using any framework like struts.Iam using plain Jsp,servlets.

I dont think using the same connection object will cause this problem.

so wondering what this problem could be.

any idea to stimulate my brains?
18 years ago
The solution Dont know if this is a correct way of doing it).

Iam calling a servlet when i load a jsp page.The servlet calls a thread which executes every minute.The init method of the servlet opens a database connection and gets the number of rows in the table and stores it in a variable.

In the dopost method i call the above mentioned thread.The thread again polls the same table,gets the number of rows and stores in another variable.I keep comparing the two variables.If there is row update i do

out.println("<meta http-equiv='refresh' content='1'/>");
out.println("<html>");
out.println("<body bgcolor='#CCFFFF'>");

if(var1>var2)

out.println("<font color='#CC0033'>");
out.println("You have an Alert");
out.println("</font>");

else
out.println("<font color='#66CC33'>");
out.println("No Alert");
out.println("</font>");

Iam using mysql4.1.18.I guess it does not support triggers.

Any suggestions about my design idea?? Is it ok to call a user defined thread??

Thanks
Ragav
18 years ago
Hello Everyone,

Thank you very much for all of your replies.Infact I had forgot that i had posted this question.It now pains me to know that Iam late in acknowledging your replies.Sorry about that.

I did solve the problem but I have to review my code to explain what I did since its been a month now.I will do it in the next post.

Thanks
Ragav Seth
18 years ago
Hi guys,

Any ideas for creating a servlet executing in background periodically for every 1 min?? This servlet will keep reading a table in the database and will set a variable when a new row is added in the table.

Any ideas?? sorry for a naive question.

--Ragav
18 years ago
Karol,

I did not have the error message shown by u in the last post.All i have is

Invalid user name and password.To try again click here.where if u click again it takes you to the admin page again.

I tried using tomcat5(changing the tomcat-users.xml) in windows and it is working fine.

But tomcat 5.5.7 bundled with netbeans 4.1 on fedora 4 linux is not working.

I guess the "admin" function doesn't come by default in tomcat 5.5.7.Thats my guess and i think the admin.zip is required.Just trying to google.

if u have any ideas please pass it over.
18 years ago
Iam using the same environment and given below is the tomcat-users.xml file

<!--
NOTE: By default, no user is included in the "manager" role required
to operate the "/manager" web application. If you wish to use this app,
you must define such a user - the username and password are arbitrary.
-->
<tomcat-users>
<role rolename="admin" />
<role rolename="manager" />
<user name="tomcat" password="tomcat" roles="tomcat" />
<user name="role1" password="tomcat" roles="role1" />
<user name="both" password="tomcat" roles="tomcat,role1" />
<user name="ragav" password="ragav" roles="admin,manager" />
</tomcat-users>
18 years ago
Hi Karol,

I have the same issue too.I tried your advice but unfortunately its not allowing me to log in.

Does tomcat 5.5.7 require any additional packages?? Is there anyting like tomcat 5.5.7.admin.zip that should I use??

any ideas??

Thanks
Ragav
18 years ago
sorry dave to get back to you again with this question.

How do I allow an user to connect from any IP using the wildcard option.

I will try to do some research on this myself but just in case if you have some ideas please pass it over.

Thanks
Ragav
Hi all,

Iam using struts 1.1 on Fedora 4 linux with tomcat 5.5.7.The tomcat comes bundled with netbeans IDE.


I developed a sample application in windows and successfully deployed it in tomcat 5.0. I used the same sample application in the Linux environment.

The tomcat 5.5.7 server throws the error trace given below.



Listening for transport dt_socket at address: 11555
Aug 31, 2005 5:42:09 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8084
Aug 31, 2005 5:42:09 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 2099 ms
Aug 31, 2005 5:42:10 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Aug 31, 2005 5:42:10 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.7
Aug 31, 2005 5:42:10 PM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Aug 31, 2005 5:42:12 PM org.apache.catalina.core.ApplicationContext log
INFO: Marking servlet action as unavailable
Aug 31, 2005 5:42:12 PM org.apache.catalina.core.ApplicationContext log

SEVERE: Servlet /Fundamentals threw load() exception

javax.servlet.ServletException: Error instantiating servlet class
org.apache.struts.action.ActionServlet
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1034)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:900)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3823)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4087)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:590)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:535)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:470)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1106)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1019)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1011)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:440)
at org.apache.catalina.core.StandardService.start(StandardService.java:450)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:683)
at org.apache.catalina.startup.Catalina.start(Catalina.java:537)
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:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
Aug 31, 2005 5:42:13 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8084
Aug 31, 2005 5:42:14 PM org.apache.jk.common.ChannelSocket init
INFO: JK2: ajp13 listening on /0.0.0.0:8009
Aug 31, 2005 5:42:14 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/73 config=null
Aug 31, 2005 5:42:14 PM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Aug 31, 2005 5:42:15 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 5451 ms

The web.xml file is as follows

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">

<web-app>


<!-- Action Servlet Configuration -->
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>

<!-- Action Servlet Mapping -->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>

<!-- The Usual Welcome File List -->
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>


<!-- Struts Tag Library Descriptors -->
<taglib>
<taglib-uri>/tags/struts-bean</taglib-uri>
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib>

<taglib>
<taglib-uri>/tags/struts-html</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>

<taglib>
<taglib-uri>/tags/struts-logic</taglib-uri>
<taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
</taglib>



</web-app>

Is the problem due to calsspath issues in linux as the same application is working in windows perfectly fine.I have copied the struts.jar file in the classpath too.

sorry for the long post.Can anyone help me on this please??

Thanks
Ragav
18 years ago
Hi all,

Iam using netbeans 4.1 IDE on Fedora 4 linux.I have problems starting the tomcat server(tomcat-5.5.7) which comes bundled with the IDE.

I developed a sample application in windows and successfully deployed it in tomcat 5.0. I used the same sample application in the Linux environment.

The tomcat 5.5.7 server throws the error trace given below.



Listening for transport dt_socket at address: 11555
Aug 31, 2005 5:42:09 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8084
Aug 31, 2005 5:42:09 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 2099 ms
Aug 31, 2005 5:42:10 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Aug 31, 2005 5:42:10 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.7
Aug 31, 2005 5:42:10 PM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Aug 31, 2005 5:42:12 PM org.apache.catalina.core.ApplicationContext log
INFO: Marking servlet action as unavailable
Aug 31, 2005 5:42:12 PM org.apache.catalina.core.ApplicationContext log
SEVERE: Servlet /Fundamentals threw load() exception
javax.servlet.ServletException: Error instantiating servlet class org.apache.struts.action.ActionServlet
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1034)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:900)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3823)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4087)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:590)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:535)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:470)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1106)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1019)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1011)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:440)
at org.apache.catalina.core.StandardService.start(StandardService.java:450)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:683)
at org.apache.catalina.startup.Catalina.start(Catalina.java:537)
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:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
Aug 31, 2005 5:42:13 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8084
Aug 31, 2005 5:42:14 PM org.apache.jk.common.ChannelSocket init
INFO: JK2: ajp13 listening on /0.0.0.0:8009
Aug 31, 2005 5:42:14 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/73 config=null
Aug 31, 2005 5:42:14 PM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Aug 31, 2005 5:42:15 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 5451 ms

I copied the same web.xml file which i used in tomcat 5.0 and its structure is as follows

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">

<web-app>


<!-- Action Servlet Configuration -->
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>

<!-- Action Servlet Mapping -->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>

<!-- The Usual Welcome File List -->
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>


<!-- Struts Tag Library Descriptors -->
<taglib>
<taglib-uri>/tags/struts-bean</taglib-uri>
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib>

<taglib>
<taglib-uri>/tags/struts-html</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>

<taglib>
<taglib-uri>/tags/struts-logic</taglib-uri>
<taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
</taglib>



</web-app>

I guess the web.xml is the problem.

sorry for the long post.Can anyone help me on this please??

Thanks
Ragav
18 years ago
Thank you.Your solution just worked fine.But do u mean to say I have to configure each and every IP that is trying to connect remotely.

Thanks
Ragav