Lee Wallen

Greenhorn
+ Follow
since Jul 14, 2001
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 Lee Wallen

I have some code that runs on one machine, but not on another. The JDK versions are nearly identical (one minor revision difference).

Version of JDK on machine where the code works:
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_07-b02)

Version of JDK on machine where the code does not work:
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_06-b01)

My assumption is that there is a classpath issue which causes the wrong version of a class to be loaded.

Does anyone know which JAR file I should be looking for, and/or does anyone recognize this error and know how to troubleshoot it?

I'm getting the following exception:

Exception in thread "main" java.lang.NoSuchMethodError: org.w3c.dom.Document.getXmlStandalone()Z
at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.setDocumentInfo(DOM2TO.java:373)
at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:127)
at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:94)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(TransformerImpl.java:663)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:709)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:313)
at com.gettyimages.util.tools.ConfigUtil.convertXmlDocToString(ConfigUtil.java:186)


This is the method where the error is occuring:

/**
* Converts an XML Document to a String.
*
* @param doc An XML Document.
* @return The content of the XML Document as a String.
*/
public String convertXmlDocToString(Document doc) throws Exception {

TransformerFactory tf = TransformerFactory.newInstance();
Transformer transformer = tf.newTransformer();
transformer.setOutputProperty("omit-xml-declaration", "no");
StringWriter sw = new StringWriter();
StreamResult result = new StreamResult(sw);
DOMSource source = new DOMSource(doc);
transformer.transform(source, result);
return sw.getBuffer().toString();
}
The web service was deployed using wsdeploy. I'm using iPlanet 6.0 Web Server.
This is the content of the web.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>Unique ID Application</display-name>
<description>A web application containing a simple JAX-RPC endpoint</description>
<session-config>
<session-timeout>60</session-timeout>
</session-config>
</web-app>
20 years ago
Basically I'm getting file not found errors. The list of errors below show how I tried to alter the URL that the client was using to access the service.
[10/Nov/2003:15:23:44] warning (17579): for host trying to GET /leew/uniqueid/, send-file reports: can't find /u001/iplanet/https-leew/webapps/uniqueid/ (File not found)
[10/Nov/2003:15:25:10] warning (17579): for host trying to GET /leew/uniqueid-jaxrpc/uniqueid, send-file reports: can't find /u001/iplanet/https-leew/webapps/uniqueid-jaxrpc/uniqueid (File not found)
[10/Nov/2003:15:25:22] warning (17579): for host trying to GET /leew/uniqueid, send-file reports: can't find /u001/iplanet/https-leew/webapps/uniqueid (File not found)
[10/Nov/2003:15:25:42] warning (17579): for host trying to GET /leew/uniqueid-jaxrpc/uniqueid, send-file reports: can't find /u001/iplanet/https-leew/webapps/uniqueid-jaxrpc/uniqueid (File not found)
[11/Nov/2003:12:59:08] warning (17579): for host trying to POST /leew/uniqueid-jaxrpc/uniqueid, send-file reports: can't find /u001/iplanet/https-leew/webapps/uniqueid-jaxrpc/uniqueid (File not found)
20 years ago
Does anyone use JAX-RPC with iPlanet 6.0 Web Server? I'm having difficulty accessing a JAX-RPC web service deployed on an iPlanet 6.0 Web Server, and don't know if I deployed the service incorrectly (no errors on deployment), if the client is trying to access the service incorrectly (seems likely), if iPlanet 6.0 requires certain files that are not currently installed (ie, J2SE 1.3.1 instead of 1.2.2), or if iPlanet 6.0 Web Server just doesn't support JAX-RPC.
Thank you!
Lee
20 years ago
I've installed the Petstore sample on XP, and have successfully deployed the application using Ant (asant all).
When I try to enter the Petstore I get a message stating that the database is being populated. Afterwards an exception is displayed that starts out with this line:
javax.servlet.ServletException: Populate exception occured :Can't get catalog data source connection
at com.sun.j2ee.blueprints.petstore.tools.populate.PopulateServlet.doPost(Unknown Source)
at com.sun.j2ee.blueprints.petstore.tools.populate.PopulateServlet.doGet(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
Then there is a root cause explanation of this:
java.sql.SQLException: Error in creating connection
I'm assuming that there is a configuration problem, but I don't know how I should go about trouble-shooting this.
Does anyone have suggestions on how I can trouble-shoot this problem?
Thank you,
Lee
1 appears to work. I have the fourth field defined as a byte.
The text file contents:
<pre>
Field1,Field2,Field3,1
this,is,a,0
this2,is2,a2,0
this3,is3,a3,1
</pre>
The sample code:
<code>
import java.sql.*;
public class TextReader
{
public static void main( String [] args ) {
Connection c = null;
Statement stmnt = null;
try {
Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver" );
c = DriverManager.getConnection( "jdbc:odbc:text_test", "", "" );
stmnt = c.createStatement();
String query = "select * from [test.txt];";
ResultSet rs = stmnt.executeQuery( query );
while( rs.next() )
{
System.out.print( rs.getString( "Field1" ) + "\t");
System.out.print( rs.getString( "Field2" ) + "\t");
System.out.print( rs.getString( "Field3" ) + "\t");
</code>
<em>
System.out.println( rs.getBoolean( "Field4" ) );
</em>
<code>
}
rs.close();
} catch( Exception e ) {
System.err.println( e );
} finally {
try {
stmnt.close();
c.close();
} catch( Exception e ) {
System.err.println( e );
}
} // end of try catch
} // end of main
}
</code>
Output of code:
<pre>
Field1 Field2 Field3 true
this is a false
this2 is2 a2 false
this3 is3 a3 true
</pre>

[This message has been edited by Lee Wallen (edited July 15, 2001).]
make sure that you import java.sql.* or java.sql.Connection.
import java.sql.*;
public class TestConn {
public static void main (String args []) {
try {
String dbUrl = args[0];
String driverName = args[1];

Class.forName(driverName).newInstance();
Connection con =
DriverManager.getConnection(dbUrl, "", "");
System.out.println("conn.isClosed = " + conn.isClosed());
} catch (Exception e) {
e.printStackTrace();
}
}
}
[This message has been edited by Lee Wallen (edited July 15, 2001).]
I am unsure if this will work, but try something like this:

String dataPath = "jdbc dbc RIVER={SQL Server}:SERVER={ip_address}:<port>?DATABASE=MY_DBASE";
where <port> is the value of the port you want to use...like 1433 or something like that.
Use the user id and password like this:
Connection conn = DriverManagner.getConnection( dataPath, USER_NAME, my_pass);
[This message has been edited by Lee Wallen (edited July 15, 2001).]
[This message has been edited by Lee Wallen (edited July 15, 2001).]
Try something like:
Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver" );
c = DriverManager.getConnection( "jdbc:odbc:excel_dsn", "", "" );
stmnt = c.createStatement();
String query = "select * from [main$] where [Field1]='Test';";
ResultSet rs = stmnt.executeQuery( query );
With a DSN of "excel_dsn" pointing to your Excel workbook file.