JAVA-XML Please Help
Hello All,
I'm somewhat new to Java and XML and I'm having this problem:
I have an program that does an HTTP Post and gets back an XML response. I'm trying to parse the response. I'm completely lost I think, and I apologize for my utter stupidity or if I haven't provided enough information. What follows is a snippet of code and the error message I'm getting:
//conn is my Http connection
// get the results
conn.connect(); // throws IOException
int responseCode = conn.getResponseCode(); // 200, 404, etc
String responseMsg = conn.getResponseMessage(); // OK, Forbidden, etc
// Read the response XML document
XMLReader parser = XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");
org.xml.sax.ContentHandler handler = new DefaultHandler();
parser.setContentHandler(handler);
InputStream in = conn.getInputStream();
InputSource source = new InputSource(in);
parser.parse(source);
in.close();
conn.disconnect();
Error Message:
org.xml.sax.SAXParseException: The root element is required in a well-formed document.
I think my problem is here but I'm not sure:
org.xml.sax.ContentHandler handler = new DefaultHandler();
Thanks for all of your help,
Lance
hi
i think u should first read the file using JFlieChooseran d grt the file likr this:::::::
public File getXMLFileChooser()
//Create a file chooser
fc = new JFileChooser();
String type[] = new String[] {"xml"};
fc.addChoosableFileFilter(new MyFileFilter(type,"XML Files(*.xml)"));
fc.setMultiSelectionEnabled(false);
int returnVal = fc.showOpenDialog(XMLFileChooser.this);
if (returnVal == JFileChooser.APPROVE_OPTION)
file =fc.getSelectedFile();
return file;
///now this file is to be read using BufferedReader & FileInputStream
File file;
FileInputStream fis;
BufferedReader bdr=null;
String record=null;
FileInputStream fis = new FileInputStream(file);
bdr= new BufferedReader(new InputStreamReader(fis));
while ( (record=bdr.readLine()) != null )
ParseFile(record);//in this method u can parse the file
if it something u want i can help u more....
cheers||||
Similar Messages
-
Displaying Picture in a Java APPLICATION please help!!
I have been trying to write a method that Displays a .jpg file when called. However I have not gotten far, every book I have tell you how to display pictures in an applet but not an application. I did find some code that is supposed to be for an application, but It does not compile right. Any help would be apprecidated!
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class PictureIt{
public void makeImage() {
//***Image Output Stream
String imgFile
= "d:\\temp\\TestImage.jpeg";
out = new FileOutputStream(imgFile);
BufferedImage image = null;
image = (BufferedImage)createImage
(panelJpeg.size.width, panelJpeg.size.height);
Graphics g = image.getGraphics();
panelJpeg.paintAll(g);
}Displaying Picture in a Java APPLICATION please help!!
Hope this helps.There is going to be two classes compile seperatly first class is what does the drawing
here it is
import javax.swing.*;
import java.awt.*;
public class draww extends JPanel {
Image ball;
int width1 = 100;
int height1 = 100;
public draww() {
super();
Toolkit kit = Toolkit.getDefaultToolkit();
ball = kit.getImage("pic1.gif");
public void paintComponent(Graphics comp) {
Graphics2D comp2D = (Graphics2D) comp;
comp2D.drawImage(ball, 20, 20, width1, height1, this);
sound class is the container JFrame here it is
import javax.swing.*;
import java.awt.*;
public class drawing extends JFrame {
public drawing() {
super("draw");
setSize(400,400);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Container pane = getContentPane();
draww d = new draww();
pane.add(d);
setContentPane(pane);
setVisible(true);
public static void main(String[] args) {
drawing drawing1 = new drawing();
PS Hope this helps and see you around -
Procedure to generate invoice in xml---please help
Hi all,
I have to write code review of a pakage which contain procedure to generate invoice in XML.The procedure contain two
files .pkb and .pks.All i know is that it will deliver elemt of the post script layout.?But i dont understand what it mean nor i am able to understand the code.I dont have any prior knowledge about this.Please help me and tell me any tutorial to understand and know how this is done.
Also i have pasted some part of code here .please help me in understanding what is going on.
help help help
* GET_INVOICE_XML
FUNCTION GET_INVOICE_XML(inInvId NUMBER) RETURN CLOB IS
BEGIN
IF NOT isClobReady THEN
dbms_lob.createtemporary(invClob, TRUE);
isClobReady := TRUE;
ELSE
dbms_lob.trim(invClob, 0);
END IF;
vInvoice :=
XML_VER_STR || NL ||
' <!DOCTYPE INVOICE_FILE SYSTEM "invoicfile.dtd">' || NL ||
'<INVOICE_FILE VERSION="1.1">' || NL;
GEN_PROLOG(InvId);
GEN_INVOICE(InvId, 1);
vInvoice := vInvoice ||
'</INVOICE_FILE>' || NL || NL;
APPEND_INVOICE(0);
RETURN invClob;
END GET_INVOICE_XML;
PROCEDURE GEN_INVOICE(InvId NUMBER, inITBMode NUMBER) IS
vP1 PLS_INTEGER;
vP2 PLS_INTEGER;
vAtt BOOLEAN;
inv ABCINVOICE%ROWTYPE;
cdr_no NUMBER;
t0 TIMESTAMP;
t1 TIMESTAMP;
execTime NUMBER(12,6);
BEGIN
t0 := LOCALTIMESTAMP;
SELECT * INTO inv FROM ABCINVOICE WHERE OACT = InvId;
dti := inv.DTI;
SELECT NVL(SUM(cdrNO),0) INTO cdr_no FROM ABCCONTRACTS WHERE OACT = InvId AND ITB IN ('Y', 'F');
vInvoice := vInvoice ||
' <INVOICE>' || NL ||
' <HEADER>' || NL ||
' <SEQ>' || inv.SEQ || '/' || inv.PROC_ID || '</SEQ>' || NL ||
' <LEN ';
vPos1 := INSTR(inv.LEN, '|', 1, 1);
vInvoice := vInvoice || 'INV="' || SUBSTR(inv.LEN, 1, vPos1-1) || '" ';
vPos2 := INSTR(inv.LEN, '|', vPos1+1, 1);
vInvoice := vInvoice || 'BAL="' || SUBSTR(inv.LEN, vPos1+1, vPos2-vPos1-1) || '" ';
vPos1 := INSTR(inv.LEN, '|', vPos2+1, 1);
vInvoice := vInvoice || 'DET="' || SUBSTR(inv.LEN, vPos2+1, vPos1-vPos2-1) || '" ';
vPos2 := INSTR(inv.LEN, '|', vPos1+1, 1);
vInvoice := vInvoice || 'PDET="' || SUBSTR(inv.LEN, vPos1+1, vPos2-vPos1-1) || '" ';
vPos1 := INSTR(inv.LEN, '|', vPos2+1, 1);
vInvoice := vInvoice || 'ITM="' || SUBSTR(inv.LEN, vPos2+1, vPos1-vPos2-1) || '" ';
vPos2 := INSTR(inv.LEN, '|', vPos1+1, 1);
vInvoice := vInvoice || 'PITM="' || SUBSTR(inv.LEN, vPos1+1, vPos2-vPos1-1) || '" NTF="' ||
SUBSTR(inv.LEN, vPos2+1) || '"/>' || NL;
vInvoice := vInvoice ||
' <BAR>' || inv.BAR || '</BAR>' || NL ||
' <BCD>' || inv.BCD || '</BCD>' || NL ||
CASE WHEN inv.BIC IS NULL THEN '' ELSE ' <BIC>' || inv.BIC || '</BIC>' || NL END ||
' <REF>' || inv.REF || '</REF>' || NL ||
' <OHX>' || inv.OHXACT || '</OHX>' || NL ||
' <CID>' || inv.CID || '</CID>' || NL ||
' <CCO>' || inv.CCO || '</CCO>' || NL ||
' <CND>' || inv.CND || '</CND>' || NL ||
' <PBF>' || inv.PBF || '</PBF>' || NL ||
' <DTI>' || inv.DTI || '</DTI>' || NL ||
' <DTD>' || inv.DTD || '</DTD>' || NL ||
' <DPS>' || inv.DPS || '</DPS>' || NL ||
' <DPE>' || inv.DPE || '</DPE>' || NL ||
' <DAS>' || inv.DAS || '</DAS>' || NL ||
' <DAE>' || inv.DAE || '</DAE>' || NL ||
' <PAY>' || inv.PAY || '</PAY>' || NL ||
' <NAM>' || ABCUTIL.CONVERT_POL_CHAR(inv.NAM) || '</NAM>' || NL ||
CASE WHEN inv.ADS1 IS NULL THEN '' ELSE ' <ADS>' || ABCUTIL.CONVERT_POL_CHAR(inv.ADS1) || '</ADS>' || NL END ||
CASE WHEN inv.ADS2 IS NULL THEN '' ELSE ' <ADS>' || ABCUTIL.CONVERT_POL_CHAR(inv.ADS2) || '</ADS>' || NL END ||
' <ADZ>' || ABCUTIL.CONVERT_POL_CHAR(inv.ADZ) || '</ADZ>' || NL ||
' <NIP>' || inv.NIP || '</NIP>' || NL ||
' <REG>' || inv.REG || '</REG>' || NL ||
' <PES>' || inv.PES || '</PES>' || NL ||
' <BCY>' || inv.BCY || '</BCY>' || NL ||
' <TXT>' || ABCUTIL.CONVERT_POL_CHAR(inv.TXT) || '</TXT>' || NL ||
' <GRO>' || TO_CHAR(inv.GRO, 'FM999990.90') || '</GRO>' || NL ||
' <FBL>' || inv.FBL || '</FBL>' || NL;
IF inv.STP > 0 THEN
GEN_TEXT(inInvId, 1);
END IF;
vInvoice := vInvoice ||
' </HEADER>' || NL ||
' <ADDRESS>' || NL ||
' <ENV>' || inv.ENV || '</ENV>' || NL ||
' <TNA>' || ABCUTIL.CONVERT_POL_CHAR(inv.TNA) || '</TNA>' || NL ||
CASE WHEN inv.TAS1 IS NULL THEN '' ELSE ' <TAS>' || ABCUTIL.CONVERT_POL_CHAR(inv.TAS1) || '</TAS>' || NL END ||
CASE WHEN inv.TAS2 IS NULL THEN '' ELSE ' <TAS>' || ABCUTIL.CONVERT_POL_CHAR(inv.TAS2) || '</TAS>' || NL END ||
' <TAZ>' ||ABCUTIL.CONVERT_POL_CHAR(inv.TAZ) || '</TAZ>' || NL;
GEN_TEXT(inInvId, 2);
vInvoice := vInvoice ||
CASE WHEN inv.MTX IS NULL THEN '' ELSE ' <MTX>' || inv.MTX || '</MTX>' || NL END ||
' </ADDRESS>' || NL;
APPEND_INVOICE(0);
IF inv.BCY <> '99' THEN
GEN_INVOICE_BILLING(inInvId);
GEN_BALANCE(inInvId);
vPos1 := INSTR(inv.LEN, '|', 1, 2) + 1;
vPos2 := INSTR(inv.LEN, '|', vPos1, 1);
vPos1 := SUBSTR(inv.LEN, vPos1, vPos2 - vPos1);
IF vPos1 > 1 THEN
GEN_SUMMARY(inInvId);
END IF;
END IF;
vInvoice := vInvoice || ' </INVOICE>' || NL;
APPEND_INVOICE(0);
END GEN_INVOICE;Edited by: BluShadow on 28-Aug-2012 09:46
added {noformat}{noformat} tags for readability. Please read: {message:id=9360002}Not quite sure what you want to know about it.
If you want a code review of it, I can tell you it's very poor code, because that's not how to generate XML data in Oracle. Oracle has built in XML functionality for generating such data, and doesn't require hard-coding XML tags.
Here's the Oracle documentation...
http://tahiti.oracle.com/
pick your database version and search for things like XDB, SQLX or more specifically XMLELEMENT, XMLAGG, XMLATTRIBUTES etc. -
URGENT!!! Java Gurus Please Help with adf issue!
PLEASE SEE MY LATEST POST BELOW TIMO'S RESPONSE. THE REQUIREMENT HAS CHANGED. THAT IS THE ISSUE I AM LOOKING A SOLUTION FOR.
Hello All,
We have a requirement where our adf/jsf app needs to pick an EXCEL file from the server where the application is deployed. The sequence is :
User comes to the page
Clicks on "Open EXCEL" button
EXCEL file located in the c:/ of the server opens up.
How can this be done? I do not see any coding needed because the EXCEL file is being opened as is (and after user views it he closes the file) and the data is not being transferred to the jspx page.
*We are totally flexible in how this is implemented - ie, using button, link , html etc etc. What ever works!!!!*
Thanks,
Edited by: user12054715 on Aug 17, 2010 8:54 PM
Edited by: user12054715 on Aug 18, 2010 4:11 PM
Edited by: user12054715 on Aug 18, 2010 4:13 PMHello Timo,
I am using 10.1.3g so your response is not going to help me.
However, I have another question that I have already posted on the Forum. Please help me...
Requirement:
*1. Java application should be able to write "Hello World" in the excel file, when the user opens it.*
I CAN DO THIS WITH THE FOLLOWING CODE:
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.createSheet("newSheet");
HSSFRow row = sheet.createRow(1);
row.createCell(1).setCellValue("HelloWorld!!!!!!!!!");
*2. A "Write To Excel" button on jsf page opens a dialog asking user to Save or Open the excel file. (user can save the file anywhere on his machine)*
I CAN DO THIS WITH THE FOLLOWING CODE:
In jsf:
<af:commandButton text="Download" action="#{myBackingBean.writeToExcel}" useWindow="true"/>
In backing bean:
public static void writeToExcel() throws IOException
String filename = "workbook.xls";
// //Setup the output
String contentType = "application/vnd.ms-excel";
FacesContext fc = FacesContext.getCurrentInstance();
HttpServletResponse response = (HttpServletResponse)fc.getExternalContext().getResponse();
response.setHeader("Content-disposition", "attachment; filename=" + filename);
response.setContentType(contentType);
PrintWriter out = response.getWriter();
BOTTLENECK: When the user opens the excel how do I show "HelloWorld!!!!!!!!!" ? -
How to program this in java? Please help
How to program this in java?
please explain steps, it has to come out like this:
example
input: 3b1w3b
output:
BBBWBBBimport java.io.*;
public class Test {
static java.io.PrintStream o = java.lang.System.out;
public static void main(String[] args)throws Exception {
BufferedReader BR = new BufferedReader(new InputStreamReader(System.in));
System.out.print("Enter plot for printing: ");
String s = BR.readLine();
char[] cs = s.toLowerCase().toCharArray();
for(int i=0, j=0; i < cs.length-0x1; i+=0x2, j=0)
while(j++ < (int)(cs[i]-0x30))
o.print((char)(cs[i+0x1]-0x20));
I tried changeing it to this so I can enter my own string, but I want to change it some more so that it can enter multiple input separated by space, so that it can form a sort of picture line by line. I tried using tolkenizer but I get errors. I dont know how to use tolkenizer properly can anyone please TEACH. you dont have to tell how or give me the code if you dont want to. yes I know Im a noob and I dont know java as good as everyone here, If everyone thinks I don't deserve help then DON'T help, I'm just trying to learn programming -
Java Import -- please help!!!
I look into http://otn.oracle.com/sample_code/products/forms/content.html for the demo of Java Importer.
Does anyone knows where / how can I get the source code?
According to that demo, the Importer creates functions called new() for each of the constructors in the class.
For me, after I imported one of the class "successfully",
I can't see this function new().
How can I get it? Does anyone has the sample code for the package body?
Please help!!! Anybody?
thanksHi Shay,
Where is this src subdirectory?
I see other demo (i.e the Oracle 9i forms demos) with source in it, but not Java Importer demo. It only has Viewlet next to it.
Am I looking into the wrong thing?
thanks -
Java VM Please help, Cannot remove and cannot Reinstall.
hello, I hope somebody can help me out here, I'm at my wits end. First of all I have xp pro file system NTFS, I have AOL DSL Broad band. I have attempted to get my Java Download DAYS ago and something went terribly wrong.
After the download I noticed that my java VM was not working so I attempted to remove it.
The program uninstalled but not totally. In My add remove software it says this: JAVA 2 RUNTIME ENVIROMENT, SE v1.4.1_01 size 88kb.
It has the regular change/remove but when pushed it uninstalls Then asks this: DO YOU WANT TO COMPLETELY REMOVE THE SELECTED APPLICATION AND ALL OF IT'S COMPONENTS? AND INSTEAD OF ASKING YES OR NOW IT HAS ON THE BUTTONS "OK" AND "CANCEL tHEN IF YOU SELECT OK IT ACTS AS IF IT IS UNINSTALLING BUT THEN IT STAYS RIGHT WHERE IS WAS.
With this being this way the download program will still do the download, But then states that there is already one in there, Then prompts to Would you like to uninstal this? ad then uninstals it but the same results happen, no working copy is installed.
If I try this: START RUN COMMAND Then type in jview te computer says "view is not recognised as an internal or external command,operable program or batch file."
If i go to the java cup in control panel, open it it reads " The system cannot find the registry key specified.: Hkey_local_machiene\software\javasoft\javaplugin\1.4.1_01"
From what I have described, cansomebody please help me to get a working a copy of java VM in my system? Please. My whole Buisness centers around placeing items for sale on Ebay and I cannot do this with out the VM. I really need help fast.
I can be emailed or imed, imeverlast is also my aol name. Please hurry if you know that answer to this problem. Thanks a Million! ;)
MDIf you want, I can fix you with remote assistance. Just ask. [email protected] (remove the leading )
-
Java beginner, please help!! (oracle jdbc setting)
Hi, I am a java beginner. I can't access remote oracle db from my computer. please help me. I can't figure out the problem.
1.The error------------------------------------------------------------
Exception in thread "main" java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(DriverManager.java:532)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at testdb.main(testdb.java:9)
2.JDBC DRIVER is in----------------------------------------------------
c:\j2sdk1.4.1_02\jdbc\classes12.zip
3.CLASSPATH is --------------------------------------------------------
.;c:\j2sdk1.4.1_02\bin;c:\j2sdk1.4.1_02\jdbc;
4.My program is--------------------------------------------------------
import java.sql.*;
class testdb
public static void main (String args[])
throws SQLException,ClassNotFoundException
Connection conn=
DriverManager.getConnection("jdbc:oracle:thin:@111.31.111.11:1526:ORA81","scott","tiger");
Statement stmt = conn.createStatement();
ResultSet rset=stmt.executeQuery("SELECT EMPNO FROM EMP");
while (rset.next()) {
System.out.println (rset.getString(1));
5. Why can't i connect to db?Hi...i have the same problem and can't seem to solve it
this is my source code
import java.io.*;
import java.sql.*;
import java.util.*;
public class TextToDatabaseTable {
public static void main (String[] args) {
try {
// connect to db
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con = DriverManager.getConnection("jdbc:oracle:thin:@cs-bid:1521:SVRDESK", "lynn", "abc");
catch( Exception e) {
e.printStackTrace();
and this is my error
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at TextToDatabaseTable.main(TextToDatabaseTable.java:12)
and i try the methods above
C:\download\Lynn>java -classpath c:\download\lynn;classes12.zip TextToDatabaseTable
C:\download\Lynn>java TextToDatabaseTable
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at TextToDatabaseTable.main(TextToDatabaseTable.java:12)
i'm using oracle 8i with tomcat on win 2k server.
i dunno what's wrong with it...do i need to set any classpath?
i have TOMCAT_HOME and JAVA_HOME Variables in My Environment Variables.
Do i need to set anything for these variables?
Do i need to download any patches? I'm kinda confused.
Thanks! -
class HelloWorld {
private native void print();
public static void main(String[] args) {
new HelloWorld().print();
static {
System.loadLibrary("HelloWorld");
//this is .h file
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <C:\java\jdk1.5.0_06\include\jni.h>
/* Header for class HelloWorld */
#ifndef IncludedHelloWorld
#define IncludedHelloWorld
#ifdef __cplusplus
extern "C" {
#endif
* Class: HelloWorld
* Method: print
* Signature: ()V
JNIEXPORT void JNICALL Java_HelloWorld_print
(JNIEnv *, jobject);
#ifdef __cplusplus
#endif
#endif
//this is .h file end
// C File starts
#include "C:\java\jdk1.5.0_06\include\jni.h"
#include <stdio.h>
#include "HelloWorld.h"
JNIEXPORT void JNICALL
Java_HelloWorld_print(JNIEnv *env, jobject obj)
printf("Hello World!\n");
return;
//C file ends
I have used following commands to create dll
cl -I"C:\Program Files\Microsoft Visual Studio 8\VC\include" -I"C:\java\include\win32"
-I"C:\java\jdk1.5.0_06\include\win32" -I"C:\Program Files\Microsoft SDKs\Windows\v6.0\Include" HelloWorld.c
-FeHelloWorld.dll -LDd -MD -link -libpath:"C:\Program Files\Microsoft SDKs\Windows\v6.0\VC\LIB"
-libpath:"C:\Program Files\Microsoft Visual Studio 8\VC\lib"
At runtime I get error the " an atempt has made to load a C library in correcty" and then error
"A dynamic link library (DLL) initialization routine failed"
please help me ASAP.
thanks in advance.class HelloWorld {
private native void print();
public static void main(String[] args) {
new HelloWorld().print();
static {
System.loadLibrary("HelloWorld");
//this is .h file
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <C:\java\jdk1.5.0_06\include\jni.h>
/* Header for class HelloWorld */
#ifndef IncludedHelloWorld
#define IncludedHelloWorld
#ifdef __cplusplus
extern "C" {
#endif
* Class: HelloWorld
* Method: print
* Signature: ()V
JNIEXPORT void JNICALL Java_HelloWorld_print
(JNIEnv *, jobject);
#ifdef __cplusplus
#endif
#endif
//this is .h file end
// C File starts
#include "C:\java\jdk1.5.0_06\include\jni.h"
#include <stdio.h>
#include "HelloWorld.h"
JNIEXPORT void JNICALL
Java_HelloWorld_print(JNIEnv *env, jobject obj)
printf("Hello World!\n");
return;
//C file ends
I have used following commands to create dll
cl -I"C:\Program Files\Microsoft Visual Studio 8\VC\include" -I"C:\java\include\win32"
-I"C:\java\jdk1.5.0_06\include\win32" -I"C:\Program Files\Microsoft SDKs\Windows\v6.0\Include" HelloWorld.c
-FeHelloWorld.dll -LDd -MD -link -libpath:"C:\Program Files\Microsoft SDKs\Windows\v6.0\VC\LIB"
-libpath:"C:\Program Files\Microsoft Visual Studio 8\VC\lib"
At runtime I get error the " an atempt has made to load a C library in correcty" and then error
"A dynamic link library (DLL) initialization routine failed"
please help me ASAP.
thanks in advance. -
Java Installation: Please Help Me
Please Help! For school we need to install JAVA. I installed JDK 5.0 and id did not work. I got exception in thread "main" java.lang.noclassdeffounderror: hello. I was using Texpad to write, compile, and run it. In short I deleted all JAVA 5.0 using My Computer program removal. I installed JAVA 1.4..2_10 and I am still getting that same error.
My System Variable CLASSPATH still shows C:\Program Files\Java\jre1.5.0_03\lib\ext\QTJava.zip. My System Variable PATH has nothing as far as JAVA in it. MY PATHEXT has JS and JSE amoung other things in it. My System Variable QTJAVA still has Files\Java\jre1.5.0_03\lib\ext\QTJava.zip in it.
Please tell me step-by-step how I can fix this. I never updated these variables before. What do I need to type and where? What do I need to get rid of or change?
PLEASE HELP!
Thanks,
JimTopic was solved by adding .; to the class path.
Jim -
Llist.java? llistnumbernode.java? PLEASE HELP
I'm programming linked-list. I know how to program, not that well though, but I don't understand how the linked-list works.
Here's what I got so far:
import java.util.*;
** Author: Yuan-Fang Wang
** The skeleton of a singly-linked-list class using interface
** DO NOT delete anything or change any parameters or return types
public class llist {
int length; // number of nodes in the list, for am empty list length = 0
node head; // must poinnt to the head (the first element) of the list
// interface definition of a node
public interface node {
public Object getValue(); // get stored KEY value
public node getNext(); // get next node
public void setNext(node l); // set next node
public int compares(node l); // compare values
public String toString(); // for printing
// constructor for a null list
public llist() {
head = null;
length = 0;
// constructor using the first node
public llist(node l) {
head = l;
length++;
// truncate the linked list to null
public void empty() {
//head.setNext(null);
// don't change anything here
public Enumeration getEnum() {
return new Enumeration () {
node current = head;
public boolean hasMoreElements() {
return (current!=null);
public Object nextElement() {
if (current==null) throw new NoSuchElementException("Linkedlist");
Object value = current;
current = current.getNext();
return value;
// return the number of nodes in the linked-list
public int getLength() {
return length;
// search for a node in the linked-list
// return its position in the linked list (the first node is 0)
// return -1 if the node is not found in the linked list
public int search(node elem) {
while(head != null){
// insert a node into the linked list
// return its position in the linked list (the first node is 0)
// return -1 if the node already in the linked list (no duplicated insert)
public int insert(node elem) {
if(head==null){
head = elem;
length++;
return 0;
else if(elem<head){
elem.setNext(head);
head = elem;
length++;
return 0;
else{
ptr = head;
while(ptr != null){
if(ptr == elem) return -1; //duplicate
else if(ptr.getNext() != null
return -1; // you must change this line to return the true insert result
// delete a node from the linked list
// return deleted node if is in the linked list and null otherwise
public node delete(node elem) {
return null; // you must change this line to return true delete result
// return the n-th node of the linked list
// return null if n is < 0 or larger than or equal to the current length
public node findNth(int n) {
return null; // you must change this line to return true findnth result
// print the list, DO NOT modify this method in anyway
public void printList() {
node ptr = head;
while (ptr!=null) {
System.out.print(ptr + " ");
ptr = ptr.getNext();
System.out.println();
// utility routine that will be used later, DO NOT modify this method
node findLast() {
if (head==null) return null;
node ptr = head;
while (ptr.getNext()!=null) {
ptr = ptr.getNext();
return ptr;
}And for llistnumbernode.java
** Author: Yuan-Fang Wang
** The skeleton of a singly-linked-list node using interface
** DO NOT delete anything or change any parameters or return types
public class llistnumbernode implements llist.node {
Number element; // stored element
llist.node next; // next node
public llistnumbernode (Number elem) {
// return the KEY value for comparison
public Object getValue() {
return null; // you must change this to return true result of getValue()
// get the next node in the list
public llist.node getNext() {
return null; // you must change this to return true result of getNext()
// set the next node in the list
public void setNext(llist.node l) {
// return 1 if this (self) > node l
// return 0 if this (self) == node l
// return -1 if this (self) < node l
public int compares(llist.node l) {
return -1; // you must change this to return true result of compares()
// DO NOT change this method
public String toString() {
return element.toString();
}Please HELPPPPPWill someone please help!!!
-
Any Java experts,please help this Newbie.
Hey,any one of you knows how do you call a program from a button?
For example,I created a chat program and peer to peer share Program,and I want to join them together.
By clicking on a button on the peer to peer share program,the chat program would open in a new window.
Please Help Me!
Thanks alot.Hi here is the complete example for you how you can call the other java classes in your main java class. Hope it will give you the idea. If still you have problems do write to me at [email protected]
* SixFrame.java
* Created on July 15, 2003, 10:26 AM
* @author sandeep
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
public class SixFrame extends JFrame implements ActionListener{
JButton btn[] = new JButton[6]; // this no will vary as per you requirements
/** Creates a new instance of SixFrame */
public SixFrame() {
JPanel pan = new JPanel();
for(int i=0;i<btn.length;i++){
btn[i] = new JButton((i+1)+"");
btn.addActionListener(this);
pan.add(btn[i]);
getContentPane().add(pan,BorderLayout.CENTER);
setSize(300,300);
setVisible(true);
/** Invoked when an action occurs.
public void actionPerformed(ActionEvent e) {
String comm = e.getActionCommand();
if(comm.equals("1")){
new FrameOne("One");
}else if(comm.equals("2")){
new FrameTwo("Two");
}else if(comm.equals("3")){
new FrameThree("Three");
}else if(comm.equals("4")){
new FrameFour("Four");
}else if(comm.equals("5")){
new FrameFive("Five");
}else if(comm.equals("6")){
new FrameSix("Six");
public static void main(String args[]){
new SixFrame();
class FrameOne extends JFrame{
FrameOne(String str){
super(str);
setSize(200,200);
setVisible(true);
class FrameTwo extends JFrame{
FrameTwo(String str){
super(str);
setSize(200,200);
setVisible(true);
class FrameThree extends JFrame{
FrameThree(String str){
super(str);
setSize(200,200);
setVisible(true);
class FrameFour extends JFrame{
FrameFour(String str){
super(str);
setSize(200,200);
setVisible(true);
class FrameFive extends JFrame{
FrameFive(String str){
super(str);
setSize(200,200);
setVisible(true);
class FrameSix extends JFrame{
FrameSix(String str){
super(str);
setSize(200,200);
setVisible(true); -
Problem with creating JAVA Source. please help
Dear all
how are you.
In fact I have made a simple java class that return a string which represents the screen size . for example 800/600 or 1024/768 or others
but I face error ORA-29541 class string.string could not be resolved
This what i made
first i created my JAVA Source
CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED "ScreenProperty" AS
import java.lang.Object;
import java.awt.*;
public class ScreenProperty
int w;
int h;
public static String getScreenSize()
w = Toolkit.getDefaultToolkit().getScreenSize().width;
h = Toolkit.getDefaultToolkit().getScreenSize().height;
return w+"/"+h;
SQL>Operation 160 succeeded.
this means the the java source created successfuly
and I'm sure that my java code is correct
then i created a fuction to call this java source as fellow
SQL> create or replace function f_get_screen_size
return varchar2
as language java
name 'ScreenProperty.getScreenSize() return java.lang.String';
Function created.
the I Issued this sql statement to return the result that should be varchar2 that represent the sceen size(1024/768)
SQL> select f_get_screen_size from dual;
ORA-29541 class string.string could not be resolved.
I do not know what is the reason for this error
and when i searched the documentation for this error i found
ORA-29541 class string.string could not be resolved
Cause: An attempt was made to execute a method in a Java class that had not been previously and cannot now be compiled or resolved successfully.
Action: Adjust the call or make the class resolvable
I need to know what is the problem.
And is there another way to load this class other than making JAVA SOURCE
please helpbefore drawing hands of clock you could fill a circle/oval with certain color, then you'd have that kind of circle that has been filled as backgound.
you may change those dots to be small lines for 12, 3, 6 and 6 o'clock and then have small dots represent 1, 2, 4, 5, 7, 8, 10 and 11 o'clock
anyhow, you should study that code and see how you can modify it whitout breaking it but having it look different.
better yet would be trying to understand how it works, what any line there means and then recreate your own... this way you would learn more....
and if there are some methods or anything you don't understand, then look them up from API documentation
good luck. -
Datacapturing using Java Bean (Please help)
I am stressed with this projeject. The stage I am at right now is that I want to capture some parameters from a posted form in my bean and send it to the database.
Can anyone please help with advice.Here is the methos used to insert it did not work
public String insertSkills_Developer() {
try {
// load the driver
// create the connection
// create the statement
Stmt = C.createStatement();
// create the sql to execute and execute
String[] skill_dev_array = this. getDev_id();
String[] skill_sets_array = this.getSkills_sets();
int counter = 0;
for(int i=0;i<skill_sets_array.length;i++)
String insert_skill = "INSERT INTO ADEBAYO.DEV_SKILLS (dev_id, skill_id, skilled, interested, deliver_session, description) VALUES (" + this.getDev_id() +'","' + skill_sets_array'","' + this.getSkilled_id() + "','" + this.getSkills_ptp() + "','" + this.getSkill_ta() + "','" + this.getDescription() + "')";
int stmtInt_2 = Stmt.executeUpdate(insert_skill);
System.out.println("SQL COMMAND " + insert_skill);
counter++;
System.out.println("Inserted row " + counter);
return "Inserted rows " + counter;
} catch (SQLException E) {
System.out.println(E);
return "SQLException: " + E.getMessage();
} catch (Exception e) {
e.printStackTrace();
return e.getMessage();
} finally {
// ALWAYS, ALWAYS close the connections to the db
try {
Stmt.close();
C.close();
} catch (Exception E) {
E.printStackTrace(); -
Hi....iam trying to display Fusion Charts. Iam using Hibernate to bring data from database.
what i want to do is to put data on xml, once my xml gets dynamic data from database, then it will be clubbed with swf files(fusion charts) to show graphs such as line charts,etc.
I know wat to do. But big Question is how to do ?
am i right in my Logic ?Hi
Your approach seems to be right.
Get the data using hibernate into your struts action ( if you are using struts ).
Set the xml and any other property as request attribute.
Embed the chart in JSP, by including FusionChartsRenderer.jsp ( found in download package ) and passing xml ( got from request attribute ) and other values as parameters to it.
Please check the FusionCharts forum for some discussions on Struts, JSP implementation. ( /forum - you could use the search feature available there )
Please refer to the documentation of FusionCharts as well. ( /docs )
Hope this helps!
Srividya
Maybe you are looking for
-
How do you combine two pictures?
Not "ghost" them as transparancies, but cut out an image and put it over another?
-
Good Day, I had Itunes downloaded on my Windows Laptop how ever this laptop has broken down and is not longer repairable. So i am planing to buy a IMac. So my question is all the data on my IPhone, IPad, IPod that i used to snyc with my now broken la
-
Everything on my mac crashes after OS update
Seriously, WHAT?! I decided to update iTunes today, but in stead of updating iTunes, everything went straight to ****. First of all, iTunes wouldn't launch. I reinstalled it, functioning again. Skype however, wouldn't start?! I reinstalled TWICE, but
-
Best option for upgrading to CS 6
Hello, I need some help. I currently have CS 5 and 5.5 installed across 7 PCs and 1 MAC within the marketing department in my company. What would be the best option for upgrading all of them to CS 6 Master Collection. (how many PCs can I use a licens
-
OT: help converting image from Illustrator .eps file to
I have 2 files that were sent to me as (supposedly) full vector-based format from Illustrator. When I view these in FW, I see only a bitmap. I know it is possible to convert these to a FW png where each element of the graphic is a separate object but