Geoff Garcia

Greenhorn
+ Follow
since Jul 10, 2003
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 Geoff Garcia

so does my experience (in first post) classify as j2ee work?
I'm guessing its just fringe even though it was integration of a java based application deployed to an entire company (aka enterprise).
19 years ago
What exactly is J2EE?

Is this just an umbrella term to capture all Java related work?
akin to using web development to encapsulate html, dhtml, javascript, css..

For instance, I've been working for the past year with Apache Tomcat, j2sdk1.4.1_02 creating various JSP's (in Struts), a few classes dealing with Java mail functionality, and Apache Axis to create a few webservices for the app. Does this fall under J2EE?
19 years ago
I made a CATALINA_HOME
and a TOMCAT_HOME and set their values to:
D:\Program Files\Apache Group\Tomcat 4.1

I restarted the server machine twice however nothing changed.
In my apache stdout log file I see its still using the same old 1.3 jdk.
At this point I shut apache down from running as an NT service, then I started it as a command line running the startup.bat file
Starting it in this manner it does accept the new 1.4 jdk

I kinda figured this was the case. Knowing this does not help me, because I have to run it as a service... but perhaps this tidbit of info might help someone direct me to a solution.
Geoff
19 years ago
forgive me, I'm not sure which board this should go under! none seemed appropriate..but here goes:

I'm trying to do the most basic thing in the world.
Upgrade from my current jdk 1.3.1_07
to 1.4.1_02

The machine has a C and a D drive and I'm trying to install it to the D: drive.
The machine runs windows NT, and I am accessing it through Terminal Services (similar to NetOp), it Also has Apache Tomcat running on it

I work alone so perhaps I just need another set of eyes to pick something simple out that I'm missing.

The ClassPath is:
D:\Program Files\Apache Group\Tomcat 4.1\common\lib\mail.jar;D:\Program Files\Apache Group\Tomcat 4.1\common\lib\servlet.jar;D:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib\msbase.jar;D:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib\mssqlserver.jar;D:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib\msutil.jar;

The JavaHome is:
D:\j2sdk1.4.1_02

The Path is:
.;D:\j2sdk1.4.1_02\bin;C:\perl\bin;%SystemRoot%\system32;%SystemRoot%;%systemdrive%\Program Files\System Tools;%SystemRoot%\System32\Wbem;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;D:\Lotus\notes;D:\Program Files\Apache Group\Tomcat 4.1\common\lib\;D:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib;

when I go to the command line and type: java -version
it tells me that it is using the newly installed version (1.4)

when I run: echo %JAVA_HOME%
it tells me I'm running the newly installed version (1.4)

however, in my apache log files I see that its still using the wrong version!!! and when I uninstall the 1.3 version my apache wont even start because it complains it can't find the 1.3 version!

Needless to say this is very frustrating since its a production machine that can't be down for very long so I only work on this issue late at night.

One colleague suggested I might need to define a %Catalina_Home% environment variable for apache? I currently dont have one. What would I enter as a value for this? What would it do?

Should I try to install the j2sdk again, but try to do it on the actual server and not through the Terminal Service utility?

Can you think of anything I should check?
19 years ago
Awesome! that solved the problem! thanks a ton!
19 years ago
JSP
I tried adding this code to a class file but am getting an error.
The code is short and sweet, here it is:
import java.sql.*;
public class sqlTest{
public static void main(String[] args) {
try{
Connection con;
Statement stmt;
ResultSet rslt;

con = DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433/", "tacit", "tacit");
stmt = con.createStatement();
rslt = stmt.executeQuery("SELECT * FROM TKS_ACCOUNT");

while(rslt.next()){
System.out.println("Result"+rslt.getInt(1));
}
con.close();

}catch(Exception e){
System.out.println("Exception:" + e);
}
}
}

The exception states:
Exception:java.sql.SQLException: No suitable driver

any idea what this is? and how to get around it? I've been searching on google but no luck finding anything out...
[ September 28, 2004: Message edited by: Geoff Garcia ]
19 years ago
JSP

Originally posted by Neeraj Vij:
Hi,Try by adding driver installation location to CLASSPATH variable also...
rgds,
neeraj.


Thanks, Neeraj, I adjusted the classpath to now be:

CLASSPATH: D:\Verity\Webtop\Server\WEB-INF\lib\xt.jar;D:\Verity\Webtop\Server\WEB-INF\lib\xp.jar;D:\Verity\Webtop\Server\WEB-INF\lib\sax.jar;D:\Program Files\Apache Group\Tomcat 4.1\common\lib\mail.jar;D:\Program Files\Apache Group\Tomcat 4.1\common\lib\servlet.jar;D:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib\msbase.jar;D:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib\mssqlserver.jar;D:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib\msutil.jar;



This did the trick and now my jsp loads correctly and performs as expected!
yay!
Thanks for all the replies so far!
Geoff
[ September 28, 2004: Message edited by: Geoff Garcia ]
19 years ago
JSP
Forgive my noob question.
I've used the search tool but haven't found the info I need.

I'd like to connect from jsp to SQL and do a simple query.
I've come up with this amount of code so far, but it fails left right and center...

I'm using MS SQL Server 2000 and Tomcat, jdk is 1.4.1_06

I can't even get this line to run:
<%@ page language="java" import="java.sql.*" %>
<%
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
%>

the error I get is:
javax.servlet.ServletException: com.microsoft.jdbc.sqlserver.SQLServerDriver
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:536)
at org.apache.jsp.test_jsp._jspService(test_jsp.java:59)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)

any ideas to help guide me along?

I downloaded and installed teh "SQL Server 2000 Driver for JDBC Service Pack 2" from the microsoft site and I set the PATH variable, but do I need to modify the server.xml and web.xml files?
[ September 20, 2004: Message edited by: Geoff Garcia ]
19 years ago
JSP
I found one page on the web that shows an example of what I'm looking to do:
http://www.geocities.com/paikiran/articles/xml1.html

The code says to use these imports:
import org.w3c.dom.Document;
import org.w3c.dom.*;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.DocumentBuilder;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;

However when I add this to the top of my java file it complains that the package doesn't exist, where can I get them from?
(assuming this is even the solution!)

I'm using jdk1.3.1_07

I tried to do the wildcard and just add
import org.w3c.dom.*;
import javax.xml.parsers.*;
import org.xml.sax.*;

and it says I'm missing all of them.

I'm aware just how basic this question is, but I gotta start somewhere!
[ August 11, 2004: Message edited by: Geoff Garcia ]
19 years ago
I am integrating with a webservice in my jsp code.

I built a little class file that gets the results and outputs them to the jsp page.
Unfortunately the output is in XML format and looks like this:

- <xmlRouterResponse>
- <queryAndResponseSet>
- <queryAndResponse>
<query>JJ</query>
<response>JJ1</response>
<response>JJ2</response>
<response>JJ3</response>
</queryAndResponse>
</queryAndResponseSet>
</xmlRouterResponse>

My question is, how can I extract just the response data?
Obviously this requires an XML parser, which I assume is incorporated in Apache?
I've tried hunting google and looking through books, but all the examples I've seen are super duper in depth and don't spend any time or show any examples on how something this simple would be done.

Can this be done from the JSP code? or is this something that is done from within the class/java file?

Any specific help would be fantastic!

My current Java file looks like this:
package webTest2;
import java.net.*;
import java.io.*;
import java.util.*;

public class webTest2Bean {
String theQuery;

public void setGuess(String guess) {
try{
String linky = "http://centraldictionaryservices.xxx.com:7000/cds/index.cds?alternativeTerms/term/term="+guess;
URL u = new URL(linky);
InputStream is = u.openStream();
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
theQuery = br.readLine();
}
catch (MalformedURLException ex){
System.err.println("catch 1 "+ex);
}
catch(IOException ex){
System.err.println("catch 2 "+ex);
}
}

public String getHint() {
return theQuery;
}
}
19 years ago
Am already looking on google and in books.
Am not looking to learn the in's and out's of java at this time, just how to fix this tiny issue. I have to get it done by friday.
So if anyone has any specific help on how to do it (rather than generic) that would be appreciated.
Thanks
[ August 04, 2004: Message edited by: Geoff Garcia ]
19 years ago
JSP
I should have mentioned that I'm a complete j2ee noob.
On a scale of 1-10 (10 being expert) I'm about a 1.
So! I've never heard of JSTL, is that something additional I'd have to install?
I'm working on google doing searches trying to find out more about it, but everything dealing with JSTL seems to involve uber complex (to me) things, and nothing basic about what it is, how to install it, or how to use it.
19 years ago
JSP
I'm not sure if this is a JSP question, or a java/class file question? or xml or what, so forgive me if its in the wrong section.

Basically I'm integrating with a web service that returns some form of XML.

This is a snippet of my code from my JSP, this particular snippet is in client side javaScript.
numGuess is my java/class file and getHint processes my request to get the info by running the URL.

document.Search.searchText.value = "<%= numguess.getHint()%>"
alert(document.Search.searchText.value);




When I run this command an alert box pops up that contains the following test:

<xmlRouterResponse><queryAndResponseSet> <queryAndResponse>
<query>gsk</query>
<response>GSK</response>
<response>Glaxo SmithKline</response>
<response>GlaxoSmithKline</response>
</queryAndResponse></queryAndResponseSet></xmlRouterResponse>



which as you can see still contains the <> xml tags.
Is there a way I can yank out just the appropriate response data and query data?
I would like my result set to come back (for this example)
to include (space delimited): gsk GSK Glaxo SmithKline GlaxoSmithKline

Can this be done at the class/java file level? or should I persue doing this at the javascript level or in the server side JSP?
[ August 03, 2004: Message edited by: Geoff Garcia ]
19 years ago
JSP
Built a web app running on Apache Tomcat using struts.
Have another app on the same environment very similar, but not using struts (just jsp, but same API's)
Someone on another server here wants to access some of the API's for the app. The project manager is insisting on using "Web Services"
I know vaguely that means that some type of xml file will be generated that specifies which methods are available, and then the other server/code can open a port and make some calls to these API's...
is that the thick n thin of it?
I don't even know where to begin? any web Services for retards books out there? or anyone wanna give me a few steps to follow?
20 years ago
This is the entire struts-config.xml
- <struts-config>
- <!-- ========== Action Mapping Definitions ==============================
-->
- <action-mappings>
- <!-- ====================== Global Pages ===
-->
- <!-- Display the homepage
-->
- <action path="/index" type="com.tks.struts.action.JustShowAction">
<forward name="page" path="/search/mainframes.do" />
</action>
- <action path="/home" type="com.tks.struts.action.JustShowAction">
<forward name="page" path="/search/mainframes.do" />
</action>
- <!-- Launch app in a new window
-->
- <action path="/launch" type="com.tks.struts.action.JustShowAction">
<forward name="page" path="/search/jsp/launch.jsp" />
</action>
- <!-- Reload the application settings for this servlet
-->
- <action path="/reload" type="com.tks.struts.action.JustShowAction">
<forward name="page" path="/search/reload.do" />
</action>
</action-mappings>
- <!-- ========== Additional Message Resources ============================
-->
<message-resources parameter="com.tks.ui.search.Messages" key="search" null="true" />
<message-resources parameter="com.tks.ui.profile.Messages" key="profile" null="true" />
<message-resources parameter="com.tks.ui.conversation.Messages" key="conversation" null="true" />
<message-resources parameter="com.tks.ui.enrollment.Messages" key="enrollment" null="true" />
<message-resources parameter="custom.Search" key="search_custom" null="true" />
<message-resources parameter="custom.Profile" key="profile_custom" null="true" />
<message-resources parameter="custom.Conversation" key="conversation_custom" null="true" />
<message-resources parameter="custom.Enrollment" key="enrollment_custom" null="true" />
<message-resources parameter="custom.Default" key="_custom" null="true" />
</struts-config>
in the same folder web-inf/config there were 5 other struts-config- files that are xml:
base, conversations, enrollment, profile, search
the one above is the plain struts-config.xml
20 years ago