Dan Kim

Greenhorn
+ Follow
since Dec 17, 2005
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 Dan Kim

Could someone please point me to some reference information on what exactly the passShellenvironment variable does? I want more detail info on it besides what's available on Tomcat 6 CGI How-To doc.

The reason being is had it not been my lucky guess that this variable was the cause of my problem as per my earlier post here:
https://coderanch.com/t/440317/Tomcat/Help-with-setting-up-Tomcat#1958814

After doing some google searches, I found others who experienced similar problem. But the suggestion to set the passShellenvironment to "true" wasn't fully explained or why it was needed.

Thanks,
Daniel
12 years ago
Could someone tell me what specific relevance or ramifications are there if the passShellEnvironment is not set to true? I just want to know the details about this variable and why I did not get any indication that this was the root cause of my problem. I would expect to get some kind of feedback or indication other than a blank HTML page, but as stated previously, I did not get any error messages. I looked to see if other log files are being generated besides the usual standard log4j output, but could not find any others. Thanks in advance!

-Daniel
12 years ago
Eureka! I found what the problem was. For some reason, my environment variables weren't being passed correctly. So I added the following lines to my web.xml file to "force" the environment variables to be passed. Now my CGI scripts work!

<init-param>
<param-name>passShellEnvironment</param-name>
<param-value>true</param-value>
</init-param>

Errr, the Tomcat documentation is really lacking!


Dan Kim wrote:Sorry if my post is about Python, but not a lot of Python ppl run on Tomcat and I also develop in Java and was hoping perhaps some Java/Tomcat ppl could help me out.

I have done the following per the instructions from the Tomcat 6 CGI How-To (http://tomcat.apache.org/tomcat-6.0-doc/cgi-howto.html):
1) Added these lines in my web app's web.xml file:
<servlet>
<servlet-name>cgi</servlet-name>
<servlet-class>org.apache.catalina.servlets.CGIServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>cgiPathPrefix</param-name>
<param-value>WEB-INF/cgi</param-value>
</init-param>
<init-param>
<param-name>executable</param-name>
<param-value>d:\_python26\python.exe</param-value> <----- This is where I have Python installed
</init-param>
<load-on-startup>5</load-on-startup>
</servlet>

12 years ago
Sorry if my post is about Python, but not a lot of Python ppl run on Tomcat and I also develop in Java and was hoping perhaps some Java/Tomcat ppl could help me out.

I have done the following per the instructions from the Tomcat 6 CGI How-To (http://tomcat.apache.org/tomcat-6.0-doc/cgi-howto.html):
1) Added these lines in my web app's web.xml file:
<servlet>
<servlet-name>cgi</servlet-name>
<servlet-class>org.apache.catalina.servlets.CGIServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>cgiPathPrefix</param-name>
<param-value>WEB-INF/cgi</param-value>
</init-param>
<init-param>
<param-name>executable</param-name>
<param-value>d:\_python26\python.exe</param-value> <----- This is where I have Python installed
</init-param>
<load-on-startup>5</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>cgi</servlet-name>
<url-pattern>/cgi-bin/*</url-pattern>
</servlet-mapping>

2) In my web app's context.xml file I added privileged="true"

3) I saved this Python script (hello.py) below in "d:\_tomcat\webapps\python\WEB-INF\cgi" folder:
from os import *
from cgi import *

print "Content-type: text/html\n\n"
print "<B>Hello World!</B>"

4) Then I pointed my browser to "http://localhost/python/cgi-bin/hello.py" But all I get is a blank HTML page, no error messages at all. To see if it is because it is not finding my executable correctly, I removed the executable parameter, then I get a Perl not found error. I also used forward slashes and back slashes and I still get a blank page.

Let me preface this by saying my overall Tomcat installation is working correctly, my Java web apps work correctly. But for some reason, Tomcat is not parsing the .py file correctly or not at all. I also added the location of the python.exe to my OS's path variable (I'm on WinXP machine). But I still get the blank HTML page. Offline, my normal Python scripts run correctly also in interactive/command prompt mode.

I also tried adding "#!d:/_python26/python" or ""#!d:/_python26/python.exe" at the top of my Python script, but I still get a blank page (also tried back slashes too).

Any help on this would be greatly apprciated!

Regards,
Daniel
12 years ago
Hello, I created a simple web-based survey application using servlets, Hibernate, and MySQL. Out of sheer curiosity and boredom, I wanted to see if a full OODB version is more efficient than my current RDB version, so I went ahead and tried to create an OODB version of my web survey application using DB4O. I was able to do so, but it appears I have to write extensively more code to duplicate SQL's group by functionality. I am now in the process of improving my db4o version by creating a class that will encapsulate my survey responses and also has a method to calculate the qty and % of total for each response.

I actually posted at the db4o user forum, but was wondering what the ranchers here think :-) So far I actually enjoy using db4o. I think it is refreshing that I don't have to rely on O/R mapping. But it's been somewhat difficult since I am "tainted" with prior RDB experience. I feel like that character in the movie "Firefox" with Clint Eastwood in it. "This is very important Mr. Gant. You must think in Russian. You can't think in English and transpose it." :-)

http://developer.db4o.com/forums/thread/52447.aspx
Thanks that worked! I went to http://www.slf4j.org/dist/slf4j-1.5.2.zip, unzipped, then copied the slf4j-simple-1.5.2.jar into my classpath.

This is amazing, how can all those Hibernate testers miss this?! I hope the Hibernate people were notified that their Hibernate distribution is missing a dependency!
Thanks but I'm just not going to use this version. If I can't install it correctly after just copying the jar files in the installation zip files, then this version just isn't worth the hassle. I don't think I am doing anything wrong per se or perhaps just unlucky. Installed again but to a totally different machine, but I still have problems. But when I install the older 3.2.5 version, everything works ok. I don't know what to think, I am using a latest GA version, so this is weird. All those version testers can't be wrong. Oh well...
Here are the jar files I have saved in my c:\_hiblib folder:

From the Hibernate Core installation zip:
hibernate3.jar
antlr-2.7.6.jar
commons-collections-3.1.jar
dom4j-1.6.1.jar
javassist-3.4.GA.jar
jta-1.1.jar
slf4j-api-1.5.2.jar

From the Hibernate Annotations zip:
ejb3-persistence.jar
hibernate-commons-annotations.jar
hibernate-annotations.jar

plus MySQL connector/J:
mysql-connector-java-3.1.14-bin.jar

With these jars, I'm getting a slf4j-related error. So if I'm missing jar(s) or doing something else wrong, I'd appreciate it if someone lets me know :-) Thanks!
I thought maybe I should ask this since I'm not sure I am interpreting the Compatibility Matrix correctly. Is hibernate core 3.3.1 compatible with hibernate annotations 3.4?
I've unzipped the contents of the hibernate 3.3.1 core zip installation file. Then I grabbed what I *think* are the necessary jar files located under the "lib" directory. But in the current version (3.3.1) there are 3 folders under the "lib" directory. One of the directory is called "required", so I figured I just need to grab the 6 jar files in this directory then save them to a directory called d:\_hiblib, which I have designated in my classpath. I installed an older version of hibernate (3.2.5) and it had more jar files, but in this current version, there are fewer jar files so it seems.

Then I unzipped the contents of the hibernate annotations zip installation file (ver 3.4) and then moved the 3 jar files to the c:\_hiblib directory.

Then I created a User.java and then compiled it. It compiled successfully. But when I went to run it (java.exe), I get the failed to load class "org.slf4j.impl.StaticLoggerBinder" error message and it even also states to visit http://www.slf4j.org/codes.html#StaticLoggerBinder for more info. I went to that link and it states:

"This error is reported when the org.slf4j.impl.StaticLoggerBinder class could not be loaded into memory. This happens when no appropriate SLF4J binding could be found on the class path. Placing one (and only one) of slf4j-nop.jar, slf4j-simple.jar, slf4j-log4j12.jar, slf4j-jdk14.jar or logback-classic.jar on the class path should solve the problem."

OK...so I downloaded an installation zip file from the SLF4J site and grabbed one of those jar files and saved it in the c:\_hiblib directory. Re-compiled (successful) my java source file (User.java), but still I get another different error. So I went back and removed that jar file, and installed the other jar file, and did this (one by one) until I won't get an error message. Well it turns out no matter which slf4j jar file I install into my c:\_hiblb directory, I still get error message at runtime.

I know there's nothing wrong with my java source file (User.java) or my MySQL setup since what I did was revert back to the old hibernate version and everything works fine (compiles and executes correctly). But dang it, with this new version, it seems I'm missing a jar file or perhaps I got a corrupt file. But I re-downloaded the installation zip file and still no change. I also installed the jar files located in the "optional" and "bytecode" folders under the lib folder.

Any ideas? Anyone else seeing this? Can someone please list out the jar files that I need at minimum?

Thanks in advance.
Dan
If anyone's interested, apparently the JDateChooser class does not work with JRE 1.5 update 6. Dunno about earlier updates. I uninstalled 1.5 and installed 1.4 update 10. My applet now works. I already sent Mr. Toedter an e-mail to inform him of this.
15 years ago

Originally posted by Vasudhaiv Naresh:
Sorry I did't get you, i need the sample code which communicate
applet to php and vice versa.



Try this. It's a applet-to-servlet example, but you may be able to get the jist of it to apply it to PHP environment. Hope this helps.

http://www.frank-buss.de/echoservlet/
15 years ago
Hmmm, I don't know if my problem (https://coderanch.com/t/257871/Applets/java/Any-JCalendar-package-users)

applies to your problem also, but the problem I am having is with Java 1.5.6. Now you got me wondering. I may uninstall update 6 and install a previous version.

[ UD: removed copy of original question, to make it clearer what's the Q and what's the A ]
[ December 19, 2005: Message edited by: Ulf Dittmer ]
15 years ago
Hello Ulf, thanks for the welcome.

Well...I compiled the applet using Java SDK 1.5.6 on WinXP machine. What's also weird is, I just created a regular Java application, not applet, again using JDateChooser class and it works fine with no problems. This is driving me nuts. For some reason, I can't use the JDateChooser class in an applet environment on my machine. I tried to download an earlier version of the JCalendar (1.1.4) package, but it doesn't have the JDateChooser class. I prefer to use the JDateChooser class since it is more compact, doesn't take as much space as the JCalendar class. I tried using both Firefox browser and IE, still no go on my machine. Oh well.

I e-mail Mr. Kai Toedter, hopefully he can help. I guess for the time being I can live with using the JCalendar class. Thanks again.

-Dan
15 years ago