Problem in compiling java code

Hi,
I have class (say A) which has an inner class (say B). There is a method(say m1) in A which has a return type as a Vector (say v1). The skeletal of the code is as :-
public class A {
public A (String mesg) {
System.out.println(mesg);
//inner class B starts
public class B {
public String name;
public int age;
public B (String name, int age) {
this.name = name;
this.age = age;
//inner class B ends
public final Vector m1 (String code) {
Vector v1 = new Vector();
B b;
if (code.equals("1111")) {
b = new B("Tutty",26);
v1.addElement(b);
return v1;
public final String m2 (B b1) {
return b1.name;
public final int m3 (B b1) {
return b1.age;
// end of class A
The above class is called in the following code :-
public class check{
public static void main(String args[]) {
A a1 = new A1("Hello");
Vector v = new Vector();
v = a1.m1("1111");
for (int i=0; i<=v.size(); i++) {
String name = a1.m2(v.elementAt(i));
//end of class check
When i compile the above class check.java , i get the following error:-
check.java:15: m2(A.B) in A cannot be applied to (java.lang.Object)
String name = a1.m2(v.elementAt(i));
^
1 error
Kindly help me in rectifying the error.
Thanks in advance.
regards,
Parag, Asmita.

Hi,
Thanks for the re-designed code.
But i think if i tell you what exactly we are aiming at, may be you can give us some better and a compact solution.
We are writing some classes which are based upon entities like student, department etc etc. The return type of the various methods in these classes was becoming a debatable issue, esp. when the output was in the form of an m by n matrix...basically of 'm' columns ('m' fields of the table which was queried) and 'n' rows(records). Out of the various options, we decided that we pass every single record (of the result set) as an object (which will be non-interpretable by the programmer using our class) in a single vector.
Speaking in an elaborate way, if the query fired was like "show departments with code and name", the output was :-
"select deptcode,deptname from dept order by deptcode";
deptcode deptname
01 Chemical Enginnering
02 Computer Engineering
(etc etc)
Now we decided to pass the above as :-
Vector v1 = new Vector();
and to ' v1' we didn't want to add the string as it is but the object of the record like
v1.addElement ( objectOf(01 and Chemical Engineering) );
v1.addElement ( objectOf(02 and Computer Engineering) );
Now this 'objectOf' was upto us to decide.
So we decided that it can be an object of some inner class (in our case B). But now we realised that we have to reveal the class B also to others (during the A.B casting). So is there a way we can keep this 'objectOf' just to ourselves and when the programmer asks for 'getDeptCode(objectOf(01 and Chemical Engineering))', we have our method to interpret the argument passed and then pass the department code.
I hope i have not bugged much and made myself clear. I am sure the doubt may be silly, but we have still not come down to any solution and hence we seek help/suggestions.
thanks,
Asmita.

Similar Messages

  • Error while running compiled java code

    Hi
    I have an evaluation license of the JDeveloper2.0 installed on my WindowsNT 4.0 workstation.
    I seem to have a problem running my compiled jave code. After compiling the source code(.java file) when I try to run the same I get a message saying
    "<FileName> not found in outpath classpath or sourcepath ".
    What does this mean and how can I rectify it?
    Regards
    Sree
    null

    Your classpath tells Java run time where to look for the class files it needs. In JDeveloper the class path is set in your project properties. Select Project->Properties and check that the source and output paths correspond to your myprojects and myclasses directories.

  • EXCEPTION_ACCESS_VIOLATION (0xc0000005) on compiled Java code

    I'm confronted with the following error of this code.
    http://db-www.naist.jp/~makoto-y/tmp/Int2LongHash.java
    The exception appears only when the system gets high-load.
    Is there work-arounds?
    I've tried also with jdk1.5.0_06, but the same error occurred.
    Converting the inner class to a top-level class has no effects.
    # An unexpected error has been detected by Java Runtime Environment:
    # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00a2cd75, pid=1540, tid=2968
    # Java VM: Java HotSpot(TM) Client VM (1.6.0-beta2-b86 mixed mode)
    # Problematic frame:
    # J org.metabrick.xbird.util.collections.Int2LongHash$Int2LongLRUMap$ChainedEntry.recordRemoval(Lorg/metabrick/xbird/util/collections/Int2LongHash;)V
    # If you would like to submit a bug report, please visit:
    # http://java.sun.com/webapps/bugreport/crash.jsp
    --------------- T H R E A D ---------------
    Current thread (0x003f6800): JavaThread "main" [_thread_in_Java, id=2968]
    siginfo: ExceptionCode=0xc0000005, writing address 0xfc2cee54
    Registers:
    EAX=0x42d43500, EBX=0x03d3ee00, ECX=0x03d3ee00, EDX=0x07911838
    ESP=0x0091f760, EBP=0x0091f778, ESI=0x0790f9f8, EDI=0xfc2cee38
    EIP=0x00a2cd75, EFLAGS=0x00010203
    Top of Stack: (sp=0x0091f760)
    0x0091f760: 0790ac30 079220b0 00000200 03d917f8
    0x0091f770: 00000000 6d955aa7 0091f7a8 00a2c9dc
    0x0091f780: 00000200 00000000 0091f7e8 00a12d50
    0x0091f790: 5ab674cf 00000000 07911838 03d3ee00
    0x0091f7a0: 03d8b700 00000010 0091f7f8 00a2c000
    0x0091f7b0: 03d8b700 078e4af4 00000010 00a2ab04
    0x0091f7c0: 078e4af4 03d8b700 00000010 00000001
    0x0091f7d0: 00000000 6d955ae7 5ab674d0 00000000
    Instructions: (pc=0x00a2cd75)
    0x00a2cd65: 20 8b fe c1 ef 09 c6 87 80 b1 5b 48 00 8b 79 20
    0x00a2cd75: 89 77 1c c1 ef 09 c6 87 80 b1 5b 48 00 8b e5 5d
    Stack: [0x008d0000,0x00920000), sp=0x0091f760, free space=317k
    Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
    J org.metabrick.xbird.util.collections.Int2LongHash$Int2LongLRUMap$ChainedEntry.recordRemoval(Lorg/metabrick/xbird/util/collections/Int2LongHash;)V
    J org.metabrick.xbird.util.collections.Int2LongHash.remove(I)J
    J org.metabrick.xbird.util.collections.Int2LongHash$Int2LongLRUMap.addEntry(IIJLorg/metabrick/xbird/util/collections/Int2LongHash$BucketEntry;)V
    J org.metabrick.xbird.util.collections.Int2LongHash.put(IJ)J
    J org.metabrick.xbird.xquery.util.StringChunk.storeCharChunk([CII)J
    J org.metabrick.xbird.xquery.util.StringChunk.store([CII)J
    J org.metabrick.xbird.xquery.dm.dtm.BigDocumentTable.setTextAt(J[CII)J
    J org.metabrick.xbird.xquery.dm.dtm.DocumentTableBuilder.createTextNode()V
    J org.metabrick.xbird.xquery.dm.dtm.DocumentTableBuilder.endElement(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
    J org.apache.xerces.parsers.AbstractSAXParser.endElement(Lorg/apache/xerces/xni/QName;Lorg/apache/xerces/xni/Augmentations;)V
    J org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement()I
    J org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Z)Z
    j org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Z)Z+24
    j org.apache.xerces.parsers.XML11Configuration.parse(Z)Z+132
    j org.apache.xerces.parsers.XML11Configuration.parse(Lorg/apache/xerces/xni/parser/XMLInputSource;)V+29
    j org.apache.xerces.parsers.XMLParser.parse(Lorg/apache/xerces/xni/parser/XMLInputSource;)V+9
    j org.apache.xerces.parsers.AbstractSAXParser.parse(Lorg/xml/sax/InputSource;)V+43
    j org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Lorg/xml/sax/InputSource;)V+43
    j org.metabrick.xbird.xquery.dm.instance.DocumentTableModel.loadDocument(Ljava/io/InputStream;)V+35
    j org.metabrick.xbird.client.tools.command.ImportDocument.process([Ljava/lang/String;)Z+99
    j org.metabrick.xbird.client.tools.CommandInvoker.executeCommand([Ljava/lang/String;)Z+8
    j org.metabrick.xbird.client.tools.CommandInvoker.run([Ljava/lang/String;)V+66
    j org.metabrick.xbird.client.tools.CommandInvoker.main([Ljava/lang/String;)V+19
    v ~StubRoutines::call_stub
    --------------- P R O C E S S ---------------
    Java Threads: ( => current thread )
    0x48aa5000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3636]
    0x48aa0800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=4076]
    0x48a9e400 JavaThread "Attach Listener" daemon [_thread_blocked, id=3144]
    0x48aac400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2248]
    0x48a86c00 JavaThread "Finalizer" daemon [_thread_blocked, id=2664]
    0x48a82800 JavaThread "Reference Handler" daemon [_thread_blocked, id=2700]
    =>0x003f6800 JavaThread "main" [_thread_in_Java, id=2968]
    Other Threads:
    0x48a7f400 VMThread [id=4028]
    0x48aa6800 WatcherThread [id=3704]
    VM state:not at safepoint (normal execution)
    VM Mutex/Monitor currently owned by a thread: None
    Heap
    def new generation total 72576K, used 28616K [0x029d0000, 0x07890000, 0x07890000)
    eden space 64512K, 32% used [0x029d0000, 0x03e6fdd0, 0x068d0000)
    from space 8064K, 92% used [0x068d0000, 0x07022230, 0x070b0000)
    to space 8064K, 0% used [0x070b0000, 0x070b0000, 0x07890000)
    tenured generation total 967936K, used 253073K [0x07890000, 0x429d0000, 0x429d0000)
    the space 967936K, 26% used [0x07890000, 0x16fb4788, 0x16fb4800, 0x429d0000)
    compacting perm gen total 12288K, used 5879K [0x429d0000, 0x435d0000, 0x469d0000)
    the space 12288K, 47% used [0x429d0000, 0x42f8dd08, 0x42f8de00, 0x435d0000)
    No shared spaces configured.
    Dynamic libraries:
    0x00400000 - 0x00423000      C:\Program Files\Java\jdk1.6.0\bin\javaw.exe
    0x7c940000 - 0x7c9dd000      C:\WINDOWS\system32\ntdll.dll
    0x7c800000 - 0x7c931000      C:\WINDOWS\system32\kernel32.dll
    0x77d80000 - 0x77e29000      C:\WINDOWS\system32\ADVAPI32.dll
    0x77e30000 - 0x77ec1000      C:\WINDOWS\system32\RPCRT4.dll
    0x77cf0000 - 0x77d7f000      C:\WINDOWS\system32\USER32.dll
    0x77ed0000 - 0x77f17000      C:\WINDOWS\system32\GDI32.dll
    0x762e0000 - 0x762fd000      C:\WINDOWS\system32\IMM32.DLL
    0x60740000 - 0x60749000      C:\WINDOWS\system32\LPK.DLL
    0x73f80000 - 0x73feb000      C:\WINDOWS\system32\USP10.dll
    0x77bc0000 - 0x77c18000      C:\WINDOWS\system32\msvcrt.dll
    0x7c340000 - 0x7c396000      C:\Program Files\Java\jdk1.6.0\jre\bin\msvcr71.dll
    0x6d7f0000 - 0x6da2f000      C:\Program Files\Java\jdk1.6.0\jre\bin\client\jvm.dll
    0x76af0000 - 0x76b1b000      C:\WINDOWS\system32\WINMM.dll
    0x6d310000 - 0x6d318000      C:\Program Files\Java\jdk1.6.0\jre\bin\hpi.dll
    0x76ba0000 - 0x76bab000      C:\WINDOWS\system32\PSAPI.DLL
    0x6d7a0000 - 0x6d7ac000      C:\Program Files\Java\jdk1.6.0\jre\bin\verify.dll
    0x6d3a0000 - 0x6d3bf000      C:\Program Files\Java\jdk1.6.0\jre\bin\java.dll
    0x6d7e0000 - 0x6d7ef000      C:\Program Files\Java\jdk1.6.0\jre\bin\zip.dll
    0x6d560000 - 0x6d573000      C:\Program Files\Java\jdk1.6.0\jre\bin\net.dll
    0x719e0000 - 0x719f7000      C:\WINDOWS\system32\WS2_32.dll
    0x719d0000 - 0x719d8000      C:\WINDOWS\system32\WS2HELP.dll
    0x6d580000 - 0x6d589000      C:\Program Files\Java\jdk1.6.0\jre\bin\nio.dll
    VM Arguments:
    jvm_args: -Xmx1024m -Xms1024m
    java_command: org.metabrick.xbird.client.tools.CommandInvoker -col /xmark import document C:\Software\xmark\xmark100.xml
    Launcher Type: SUN_STANDARD
    Environment Variables:
    JAVA_HOME=C:\Program Files\Java\jdk1.6.0
    PATH=C:\Program Files\Java\jdk1.6.0\bin;D:\Software\maven-1.0.2\bin;D:\cygwin\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;D:\Software\apache-ant-1.6.5\bin;C:\ghc\ghc-6.4.2\bin;C:\Program Files\QuickTime\QTSystem\
    USERNAME=yui
    OS=Windows_NT
    PROCESSOR_IDENTIFIER=x86 Family 15 Model 4 Stepping 4, GenuineIntel
    --------------- S Y S T E M ---------------
    OS: Windows XP Build 2600 Service Pack 2
    CPU:total 2 family 15, cmov, cx8, fxsr, mmx, sse, sse2, ht
    Memory: 4k page, physical 2096404k(108924k free), swap 3511144k(1471688k free)
    vm_info: Java HotSpot(TM) Client VM (1.6.0-beta2-b86) for windows-x86, built on Jun 2 2006 00:36:31 by "java_re" with unknown MS VC++:1310

    The following is the error that I got with using JDK 1.5.
    # An unexpected error has been detected by HotSpot Virtual Machine:
    # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00b8c9f8, pid=4024, tid=1608
    # Java VM: Java HotSpot(TM) Client VM (1.5.0_06-b05 mixed mode)
    # Problematic frame:
    # J org.metabrick.xbird.util.collections.Int2LongHash$Int2LongLRUMap$ChainedEntry.recordRemoval(Lorg/metabrick/xbird/util/collections/Int2LongHash;)V
    --------------- T H R E A D ---------------
    Current thread (0x00036190): JavaThread "main" [_thread_in_Java, id=1608]
    siginfo: ExceptionCode=0xc0000005, writing address 0xfa424094
    Registers:
    EAX=0x00040e40, EBX=0xfa424078, ECX=0x05bd3fc0, EDX=0x05bd3fc0
    ESP=0x0007f578, EBP=0x0007f590, ESI=0xfa424078, EDI=0x081c8168
    EIP=0x00b8c9f8, EFLAGS=0x00010203
    Top of Stack: (sp=0x0007f578)
    0x0007f578: 081c1fa8 6d7d1061 022dd1c8 00000000
    0x0007f588: 00000200 00000200 0007f5c8 00b8c598
    0x0007f598: 0899f428 05bd3fc0 00000200 00000000
    0x0007f5a8: 0007f5c8 00b41018 00000200 000001cb
    0x0007f5b8: 05c50338 05c19448 05bd3fc0 000001a8
    0x0007f5c8: 0007f648 00b8b880 07dd565c 0899f428
    0x0007f5d8: 022dd1cb 00000000 08976190 00b8054c
    0x0007f5e8: 00001000 0000af89 00001000 6d7d1061
    Instructions: (pc=0x00b8c9f8)
    0x00b8c9e8: 89 5f 20 c1 e8 09 c6 80 00 a9 6c 48 00 8b 72 20
    0x00b8c9f8: 89 7e 1c c1 ee 09 c6 86 00 a9 6c 48 00 8b e5 5d
    Stack: [0x00040000,0x00080000), sp=0x0007f578, free space=253k
    Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
    J org.metabrick.xbird.util.collections.Int2LongHash$Int2LongLRUMap$ChainedEntry.recordRemoval(Lorg/metabrick/xbird/util/collections/Int2LongHash;)V
    J org.metabrick.xbird.util.collections.Int2LongHash.remove(I)J
    J org.metabrick.xbird.util.collections.Int2LongHash$Int2LongLRUMap.addEntry(IIJLorg/metabrick/xbird/util/collections/Int2LongHash$BucketEntry;)V
    J org.metabrick.xbird.util.collections.Int2LongHash.put(IJ)J
    J org.metabrick.xbird.xquery.util.StringChunk.storeCharChunk([CII)J
    J org.metabrick.xbird.xquery.util.StringChunk.store([CII)J
    J org.metabrick.xbird.xquery.dm.dtm.BigDocumentTable.setTextAt(J[CII)J
    J org.metabrick.xbird.xquery.dm.dtm.DocumentTableBuilder.createTextNode()V
    J org.metabrick.xbird.xquery.dm.dtm.DocumentTableBuilder.endElement(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
    J com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Lcom/sun/org/apache/xerces/internal/xni/QName;Lcom/sun/org/apache/xerces/internal/xni/Augmentations;)V
    J com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElement()I
    J com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Z)Z
    v ~OSRAdapter
    j com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Z)Z+24
    j com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Z)Z+118
    j com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Lcom/sun/org/apache/xerces/internal/xni/parser/XMLInputSource;)V+29
    j com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Lcom/sun/org/apache/xerces/internal/xni/parser/XMLInputSource;)V+9
    j com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Lorg/xml/sax/InputSource;)V+43
    j org.metabrick.xbird.xquery.dm.instance.DocumentTableModel.loadDocument(Ljava/io/InputStream;)V+35
    j org.metabrick.xbird.client.tools.command.ImportDocument.process([Ljava/lang/String;)Z+102
    j org.metabrick.xbird.client.tools.CommandInvoker.executeCommand([Ljava/lang/String;)Z+8
    j org.metabrick.xbird.client.tools.CommandInvoker.run([Ljava/lang/String;)V+66
    j org.metabrick.xbird.client.tools.CommandInvoker.main([Ljava/lang/String;)V+19
    v ~StubRoutines::call_stub
    V [jvm.dll+0x845a9]
    V [jvm.dll+0xd9317]
    V [jvm.dll+0x8447a]
    V [jvm.dll+0x8b44a]
    C [java.exe+0x14c5]
    C [java.exe+0x64dd]
    C [kernel32.dll+0x16fd7]
    --------------- P R O C E S S ---------------
    Java Threads: ( => current thread )
    0x00aa7490 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=1780]
    0x00aa60f0 JavaThread "CompilerThread0" daemon [_thread_blocked, id=3456]
    0x00aa53f8 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2544]
    0x00a96c80 JavaThread "Finalizer" daemon [_thread_blocked, id=856]
    0x00a957e8 JavaThread "Reference Handler" daemon [_thread_blocked, id=816]
    =>0x00036190 JavaThread "main" [_thread_in_Java, id=1608]
    Other Threads:
    0x0003fbd0 VMThread [id=3592]
    0x00ab0e20 WatcherThread [id=3108]
    VM state:not at safepoint (normal execution)
    VM Mutex/Monitor currently owned by a thread: None
    Heap
    def new generation total 72576K, used 59965K [0x02ae0000, 0x079a0000, 0x079a0000)
    eden space 64512K, 80% used [0x02ae0000, 0x05d8f7b0, 0x069e0000)
    from space 8064K, 99% used [0x069e0000, 0x071bfff8, 0x071c0000)
    to space 8064K, 0% used [0x071c0000, 0x071c0000, 0x079a0000)
    tenured generation total 967936K, used 451270K [0x079a0000, 0x42ae0000, 0x42ae0000)
    the space 967936K, 46% used [0x079a0000, 0x23251ab0, 0x23251c00, 0x42ae0000)
    compacting perm gen total 8192K, used 5367K [0x42ae0000, 0x432e0000, 0x46ae0000)
    the space 8192K, 65% used [0x42ae0000, 0x4301dfb0, 0x4301e000, 0x432e0000)
    No shared spaces configured.
    Dynamic libraries:
    0x00400000 - 0x0040c000      C:\Program Files\Java\jdk1.5.0_06\bin\java.exe
    0x7c940000 - 0x7c9dd000      C:\WINDOWS\system32\ntdll.dll
    0x7c800000 - 0x7c931000      C:\WINDOWS\system32\kernel32.dll
    0x77d80000 - 0x77e29000      C:\WINDOWS\system32\ADVAPI32.dll
    0x77e30000 - 0x77ec1000      C:\WINDOWS\system32\RPCRT4.dll
    0x77bc0000 - 0x77c18000      C:\WINDOWS\system32\MSVCRT.dll
    0x6d6e0000 - 0x6d874000      C:\Program Files\Java\jdk1.5.0_06\jre\bin\client\jvm.dll
    0x77cf0000 - 0x77d7f000      C:\WINDOWS\system32\USER32.dll
    0x77ed0000 - 0x77f17000      C:\WINDOWS\system32\GDI32.dll
    0x76af0000 - 0x76b1b000      C:\WINDOWS\system32\WINMM.dll
    0x762e0000 - 0x762fd000      C:\WINDOWS\system32\IMM32.DLL
    0x60740000 - 0x60749000      C:\WINDOWS\system32\LPK.DLL
    0x73f80000 - 0x73feb000      C:\WINDOWS\system32\USP10.dll
    0x6d2f0000 - 0x6d2f8000      C:\Program Files\Java\jdk1.5.0_06\jre\bin\hpi.dll
    0x76ba0000 - 0x76bab000      C:\WINDOWS\system32\PSAPI.DLL
    0x6d6b0000 - 0x6d6bc000      C:\Program Files\Java\jdk1.5.0_06\jre\bin\verify.dll
    0x6d370000 - 0x6d38d000      C:\Program Files\Java\jdk1.5.0_06\jre\bin\java.dll
    0x6d6d0000 - 0x6d6df000      C:\Program Files\Java\jdk1.5.0_06\jre\bin\zip.dll
    0x6d530000 - 0x6d543000      C:\Program Files\Java\jdk1.5.0_06\jre\bin\net.dll
    0x719e0000 - 0x719f7000      C:\WINDOWS\system32\WS2_32.dll
    0x719d0000 - 0x719d8000      C:\WINDOWS\system32\WS2HELP.dll
    0x6d550000 - 0x6d559000      C:\Program Files\Java\jdk1.5.0_06\jre\bin\nio.dll
    VM Arguments:
    jvm_args: -Xmx1024m -Xms1024m -ea
    java_command: org.metabrick.xbird.client.tools.CommandInvoker -col /xmark import document C:\Software\xmark\xmark100.xml
    Launcher Type: SUN_STANDARD
    Environment Variables:
    JAVA_HOME=C:\Program Files\Java\jdk1.6.0
    PATH=C:\Program Files\Java\jdk1.6.0\bin;D:\Software\maven-1.0.2\bin;D:\cygwin\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;D:\Software\apache-ant-1.6.5\bin;C:\ghc\ghc-6.4.2\bin;C:\Program Files\QuickTime\QTSystem\
    USERNAME=yui
    OS=Windows_NT
    PROCESSOR_IDENTIFIER=x86 Family 15 Model 4 Stepping 4, GenuineIntel
    --------------- S Y S T E M ---------------
    OS: Windows XP Build 2600 Service Pack 2
    CPU:total 2 family 15, cmov, cx8, fxsr, mmx, sse, sse2, ht
    Memory: 4k page, physical 2096404k(370660k free), swap 3511144k(1545452k free)
    vm_info: Java HotSpot(TM) Client VM (1.5.0_06-b05) for windows-x86, built on Nov 10 2005 11:12:14 by "java_re" with MS VC++ 6.0

  • How to check for a logic bomb in compiled java code ?

    I have couple of security requirements.
    1. How do I check for logic bomb in the compiled java code ?
    2. Is there any way to monitor memory utilized by class when running inside a constructor ?

    1. Let me see if you can define 'logic bomb', then maybe a answer can be supplied. If you simply mean malicious code, then in general you cannot. You can attempt to do the kinds of things that antivirus software does, like check for the existence of known malicious code and code patterns, but that won't work any better on Java than it does on anything else.
    2. Google java profiling. Also, for something relatively simple, read about jconsole.

  • Not Able  to Compile Java code

    Hi Java Gurus
    I am not able to compile this code Pl help
    class For {
    public static void main (String [] args) {
    int I = 0;
    show:
         if (I < 2) {
    System.out.print("I is " + I);
    I++;
    continue show;
    }

    class For {
    public static void main (String [] args) {
          for(int i = 0; i < 2; i++){
                  System.out.print("I is " + i);
    }this does the same as your program: the for loop is the best for this, but i agree with the others read some tutorials on loops in java. As posted before java has no concept of the GoTo syntax, loops or recursion are your only options

  • Help required in compiling Java Code.

    I have java1.6 installed on my PC but I want to compile my code in such a way that
    it will run on PCs with lower versions of java installed.
    I am not using any feature specific to java1.6 in my program.
    I am using Netbeans IDE 6.1
    Thanks in advance.

    calypso wrote:
    Im not 100% sure of this but I would of thought a program will compile on any version of java as long as you dont use classes that are exclusive to higher version of java
    for example i would think if you comiled the helloworld tutorial on v.1.6 it will run on computers with lower versions.
    However a program which uses the scanner class (i think exclusive to 1.6 or 1.5 not sure though) will not run on say 1.2
    CalypsoIve tested to run an complied class(version 1.6) on an computer with jre 1.5 installed(before), and it doesnt work. Dont remember precisly the error but it didnt run atleast.

  • Problem to compile sample code with C++ Parser on Unix

    I just downloaded C++ parser and tried to compile the sample source code, but I got
    the following error:
    g++ -o DOMSample -I../include DOMSample.cpp -L../lib/xml8 -L../lib/core8 -L../lib/nls8 -L../lib/xmlc8 -L../lib/nsl -L../lib/socket
    Undefined first referenced
    symbol in file
    Node::getFirstChild(void) /var/tmp/ccarlA8y.o
    Node::getValue(void) /var/tmp/ccarlA8y.o
    XMLParser::xmlterm(void) /var/tmp/ccarlA8y.o
    XMLParser::getDocumentElement(void) /var/tmp/ccarlA8y.o
    xmlinit__9XMLParserPUcPFPvPCUcUi_vPvP8xmlsaxcbT3T1 /var/tmp/ccarlA8y.o
    Node::hasChildNodes(void) /var/tmp/ccarlA8y.o
    Node::getChildNode(unsigned int) /var/tmp/ccarlA8y.o
    Node::getName(void) /var/tmp/ccarlA8y.o
    Node::numChildNodes(void) /var/tmp/ccarlA8y.o
    XMLParser::xmlparse(unsigned char *, unsigned char *, unsigned int)/var/tmp/ccarlA8y.o
    Node::getType(void) /var/tmp/ccarlA8y.o
    ld: fatal: Symbol referencing errors. No output written to DOMSample
    collect2: ld returned 1 exit status
    make: *** [DOMSample] Error 1
    Please help me out. Thanks,
    null

    I have the similar problem when I tried to compile sample code with C++ parser on WinNT4. I am using Micrsoft Visual Studio V6.0. I added the include file and lib file in the path.
    Here are the error messages:
    Linking...
    FullDOM.obj : error LNK2001: unresolved external symbol "public: void __thiscall XMLParser::xmlterm(void)" (?xmlterm@XMLParser@@QAEXXZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class NamedNodeMap * __thiscall DocumentType::getEntities(void)" (?getEntities@DocumentType@@QAEPAVNamedNodeMap@@XZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Node * __thiscall NamedNodeMap::item(unsigned int)" (?item@NamedNodeMap@@QAEPAVNode@@I@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: unsigned int __thiscall NamedNodeMap::getLength(void)" (?getLength@NamedNodeMap@@QAEIXZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class NamedNodeMap * __thiscall DocumentType::getNotations(void)" (?getNotations@DocumentType@@QAEPAVNamedNodeMap@@XZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class DocumentType * __thiscall XMLParser::getDocType(void)" (?getDocType@XMLParser@@QAEPAVDocumentType@@XZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: unsigned int __thiscall XMLParser::xmlparse(unsigned char *,unsigned char *,unsigned int)" (?xmlparse@XMLParser@@QAEIPAE0I@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: void __thiscall XMLParser::xmlclean(void)" (?xmlclean@XMLParser@@QAEXXZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: void __thiscall CharacterData::replaceData(unsigned long,unsigned long,unsigned char *)" (?replaceData@CharacterData@@QAEXKKPAE@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: void __thiscall CharacterData::deleteData(unsigned long,unsigned long)" (?deleteData@CharacterData@@QAEXKK@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: void __thiscall CharacterData::insertData(unsigned long,unsigned char *)" (?insertData@CharacterData@@QAEXKPAE@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: void __thiscall CharacterData::appendData(unsigned char *)" (?appendData@CharacterData@@QAEXPAE@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: unsigned char * __thiscall CharacterData::substringData(unsigned long,unsigned long)" (?substringData@CharacterData@@QAEPAEKK@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: unsigned int __thiscall CharacterData::getLength(void)" (?getLength@CharacterData@@QAEIXZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: void __thiscall CharacterData::setData(unsigned char *)" (?setData@CharacterData@@QAEXPAE@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: unsigned char * __thiscall CharacterData::getData(void)" (?getData@CharacterData@@QAEPAEXZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Node * __thiscall Text::splitText(unsigned long)" (?splitText@Text@@QAEPAVNode@@K@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Node * __thiscall Node::cloneNode(int)" (?cloneNode@Node@@QAEPAV1@H@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Node * __thiscall NamedNodeMap::removeNamedItem(unsigned char *)" (?removeNamedItem@NamedNodeMap@@QAEPAVNode@@PAE@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: int __thiscall NamedNodeMap::setNamedItem(class Node *,class Node * *)" (?setNamedItem@NamedNodeMap@@QAEHPAVNode@@PAPAV2@@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class NamedNodeMap * __thiscall Node::getAttributes(void)" (?getAttributes@Node@@QAEPAVNamedNodeMap@@XZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Attr * __thiscall Element::removeAttributeNode(class Attr *)" (?removeAttributeNode@Element@@QAEPAVAttr@@PAV2@@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Attr * __thiscall Element::setAttribute(unsigned char *,unsigned char *)" (?setAttribute@Element@@QAEPAVAttr@@PAE0@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: void __thiscall Element::removeAttribute(unsigned char *)" (?removeAttribute@Element@@QAEXPAE@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Attr * __thiscall Element::getAttributeNode(unsigned char *)" (?getAttributeNode@Element@@QAEPAVAttr@@PAE@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: void __thiscall Attr::setValue(unsigned char *)" (?setValue@Attr@@QAEXPAE@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: int __thiscall Element::setAttributeNode(class Attr *,class Attr * *)" (?setAttributeNode@Element@@QAEHPAVAttr@@PAPAV2@@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Attr * __thiscall Document::createAttribute(unsigned char *,unsigned char *)" (?createAttribute@Document@@QAEPAVAttr@@PAE0@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class DocumentFragment * __thiscall Document::createDocumentFragment(void)" (?createDocumentFragment@Document@@QAEPAVDocumentFragment@@XZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: void __thiscall Element::normalize(void)" (?normalize@Element@@QAEXXZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Node * __thiscall Node::removeChild(void)" (?removeChild@Node@@QAEPAV1@XZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Node * __thiscall Node::replaceChild(class Node *)" (?replaceChild@Node@@QAEPAV1@PAV1@@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Document * __thiscall Node::getOwnerDocument(void)" (?getOwnerDocument@Node@@QAEPAVDocument@@XZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Node * __thiscall Node::getParentNode(void)" (?getParentNode@Node@@QAEPAV1@XZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Node * __thiscall NodeList::item(unsigned int)" (?item@NodeList@@QAEPAVNode@@I@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: unsigned int __thiscall NodeList::getLength(void)" (?getLength@NodeList@@QAEIXZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class NodeList * __thiscall Document::getElementsByTagName(class Element *,unsigned char *)" (?getElementsByTagName@Document@@QAEPAVNodeList@@PAVElement@@PAE@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: void __thiscall Node::setValue(unsigned char *)" (?setValue@Node@@QAEXPAE@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Node * __thiscall Node::getPreviousSibling(void)" (?getPreviousSibling@Node@@QAEPAV1@XZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Node * __thiscall Node::getLastChild(void)" (?getLastChild@Node@@QAEPAV1@XZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Node * __thiscall Node::getNextSibling(void)" (?getNextSibling@Node@@QAEPAV1@XZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Node * __thiscall Node::getFirstChild(void)" (?getFirstChild@Node@@QAEPAV1@XZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Node * __thiscall Node::insertBefore(class Node *,class Node *)" (?insertBefore@Node@@QAEPAV1@PAV1@0@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class EntityReference * __thiscall Document::createEntityReference(unsigned char *)" (?createEntityReference@Document@@QAEPAVEntityReference@@PAE@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class CDATASection * __thiscall Document::createCDATASection(unsigned char *)" (?createCDATASection@Document@@QAEPAVCDATASection@@PAE@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class ProcessingInstruction * __thiscall Document::createProcessingInstruction(unsigned char *,unsigned char *)" (?createProcessingInstruction@Document@@QAEPAVProcessingInstruction@@PA
    E0@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Comment * __thiscall Document::createComment(unsigned char *)" (?createComment@Document@@QAEPAVComment@@PAE@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Text * __thiscall Document::createTextNode(unsigned char *)" (?createTextNode@Document@@QAEPAVText@@PAE@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Element * __thiscall XMLParser::getDocumentElement(void)" (?getDocumentElement@XMLParser@@QAEPAVElement@@XZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Node * __thiscall Node::appendChild(class Node *)" (?appendChild@Node@@QAEPAV1@PAV1@@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Element * __thiscall Document::createElement(unsigned char *)" (?createElement@Document@@QAEPAVElement@@PAE@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Document * __thiscall XMLParser::getDocument(void)" (?getDocument@XMLParser@@QAEPAVDocument@@XZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class Document * __thiscall XMLParser::createDocument(void)" (?createDocument@XMLParser@@QAEPAVDocument@@XZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: unsigned int __thiscall XMLParser::xmlinit(unsigned char *,void (__cdecl*)(void *,unsigned char const *,unsigned int),void *,struct xmlsaxcb *,void *,unsigned char *)" (?xmlinit@XMLPar
    ser@@QAEIPAEP6AXPAXPBEI@Z1PAUxmlsaxcb@@10@Z)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: unsigned int __thiscall Node::numChildNodes(void)" (?numChildNodes@Node@@QAEIXZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: class NodeList * __thiscall Node::getChildNodes(void)" (?getChildNodes@Node@@QAEPAVNodeList@@XZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: int __thiscall Node::hasChildNodes(void)" (?hasChildNodes@Node@@QAEHXZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: unsigned char * __thiscall Attr::getValue(void)" (?getValue@Attr@@QAEPAEXZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: int __thiscall Attr::getSpecified(void)" (?getSpecified@Attr@@QAEHXZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: unsigned char * __thiscall Attr::getName(void)" (?getName@Attr@@QAEPAEXZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: unsigned char * __thiscall Node::getValue(void)" (?getValue@Node@@QAEPAEXZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: unsigned char * __thiscall Node::getName(void)" (?getName@Node@@QAEPAEXZ)
    FullDOM.obj : error LNK2001: unresolved external symbol "public: short __thiscall Node::getType(void)" (?getType@Node@@QAEFXZ)
    LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
    Debug/orafulldom.exe : fatal error LNK1120: 64 unresolved externals
    Error executing link.exe.
    orafulldom.exe - 65 error(s), 0 warning(s)
    null

  • Compiling Java code with Japanese characters

    I have a Java code with some Japanese characters. My compiler doesn't recognise these characters and gives me error messages.
    Please help me.

    Obviously it's not the copmiler's fault. You need to fix your code.
    Here is a link to the Java Language Specification.
    The link is to section 3.8 - Identifiers.
    It describes the acceptable naming:
    http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#40625
    Perhaps your editor is not saving the text file in an appropriate format.
    What editor are you using?
    Try vim http://www.vim.org
    or SciTE http://www.scintilla.org/SciTE.html

  • Problems with backing Java Code

    Earlier I manually deleted the processChange event handler method for a textfield from the backing java code. As I had no plans to use that event handler. Now my page abends with a message stating that the process chnage method is not available. I tried to add via the event handler for the textbox using the GUI but it does not add the process change event handler method. Using an another process change method as a model I manually entered the code to handle process change for the text bos. Now I am getting an internal server exception - Null in one of the parameters. PLEASE HELP. What are my options - Delete and re-create the entire page

    Hi,
    Yes I am using the recommeded code: The Text field generating the null exception is addDataSourceTF. Whenever we click on the addDataSourceBTN we get an Internal exception.
    Thanks very much for looking into this problem. Any advice will be greatly appreciated.
    <h:panelGrid binding="#{MainPage.gridPanel1}" cellpadding="3" cellspacing="2" columnClasses="" id="gridPanel1" style="background-color: rgb(204, 255, 204); left: 48px; top: 312px; position: absolute">
    <h:inputText binding="#{MainPage.addDataSourceTF}" id="addDataSourceTF" style="font-family: Arial,Helvetica,sans-serif"
    validator="#{MainPage.addDataSourceTF_validate}" valueChangeListener="#{MainPage.addDataSourceTF_processValueChange}"/>
    <h:commandButton action="#{MainPage.addDataSourceBTN_action}" binding="#{MainPage.addDataSourceBTN}" id="addDataSourceBTN"
    image="resources/button32.jpg" value="Add Data Source"/>
    <h:selectOneMenu binding="#{MainPage.deleteDataSourceDD}" id="deleteDataSourceDD" immediate="true" onchange="this.form.submit();"
    style="height: 23px; width: 164px" valueChangeListener="#{MainPage.deleteDataSourceDD_processValueChange}">
    <f:selectItems binding="#{MainPage.dropdown1SelectItems}" id="dropdown1SelectItems" value="#{MainPage.database_infoRowSet.selectItems['DB_SRC,DB_SRC']}"/>
    </h:selectOneMenu>
    <h:commandButton action="#{MainPage.deleteDataSourceBTN_action}" binding="#{MainPage.deleteDataSourceBTN}" id="deleteDataSourceBTN"
    image="resources/delete.jpg" value="Submit"/>
    </h:panelGrid>
    Backing Java Code:
    * MainPage.java
    * Created on December 15, 2004, 1:45 AM
    * Copyright adear1
    package dissertation;
    import javax.faces.*;
    import com.sun.jsfcl.app.*;
    import javax.faces.component.html.*;
    import com.sun.jsfcl.data.*;
    import javax.faces.component.*;
    import javax.faces.event.*;
    import com.sun.sql.rowset.*;
    import javax.faces.context.FacesContext;
    import javax.faces.application.FacesMessage;
    import javax.faces.convert.*;
    import java.sql.*;
    import javax.naming.*;
    import javax.sql.DataSource;
    import java.lang.*;
    import javax.faces.context.*;
    public class MainPage extends AbstractPageBean {
    // <editor-fold defaultstate="collapsed" desc="Creator-managed Component Definition">
    private int __placeholder;
    private HtmlForm form1 = new HtmlForm();
    public HtmlForm getForm1() {
    return form1;
    public void setForm1(HtmlForm hf) {
    this.form1 = hf;
    private HtmlCommandButton addDataSourceBTN = new HtmlCommandButton();
    public HtmlCommandButton getAddDataSourceBTN() {
    return addDataSourceBTN;
    public void setAddDataSourceBTN(HtmlCommandButton hcb) {
    this.addDataSourceBTN = hcb;
    private HtmlCommandButton searchDataBTN = new HtmlCommandButton();
    public HtmlCommandButton getSearchDataBTN() {
    return searchDataBTN;
    public void setSearchDataBTN(HtmlCommandButton hcb) {
    this.searchDataBTN = hcb;
    private HtmlCommandButton scrubbingRulesBTN = new HtmlCommandButton();
    public HtmlCommandButton getScrubbingRulesBTN() {
    return scrubbingRulesBTN;
    public void setScrubbingRulesBTN(HtmlCommandButton hcb) {
    this.scrubbingRulesBTN = hcb;
    private HtmlCommandButton scrubDataSourceBTN = new HtmlCommandButton();
    public HtmlCommandButton getScrubDataSourceBTN() {
    return scrubDataSourceBTN;
    public void setScrubDataSourceBTN(HtmlCommandButton hcb) {
    this.scrubDataSourceBTN = hcb;
    private HtmlCommandButton uploadDataSourceBTN = new HtmlCommandButton();
    public HtmlCommandButton getUploadDataSourceBTN() {
    return uploadDataSourceBTN;
    public void setUploadDataSourceBTN(HtmlCommandButton hcb) {
    this.uploadDataSourceBTN = hcb;
    private HtmlCommandButton deleteDataSourceBTN = new HtmlCommandButton();
    public HtmlCommandButton getDeleteDataSourceBTN() {
    return deleteDataSourceBTN;
    public void setDeleteDataSourceBTN(HtmlCommandButton hcb) {
    this.deleteDataSourceBTN = hcb;
    private HtmlInputText addDataSourceTF = new HtmlInputText();
    public HtmlInputText getAddDataSourceTF() {
    return addDataSourceTF;
    public void setAddDataSourceTF(HtmlInputText hit) {
    this.addDataSourceTF = hit;
    private HtmlSelectOneMenu deleteDataSourceDD = new HtmlSelectOneMenu();
    public HtmlSelectOneMenu getDeleteDataSourceDD() {
    return deleteDataSourceDD;
    public void setDeleteDataSourceDD(HtmlSelectOneMenu hsom) {
    this.deleteDataSourceDD = hsom;
    private DefaultSelectItemsArray dropdown1DefaultItems = new DefaultSelectItemsArray();
    public DefaultSelectItemsArray getDropdown1DefaultItems() {
    return dropdown1DefaultItems;
    public void setDropdown1DefaultItems(DefaultSelectItemsArray dsia) {
    this.dropdown1DefaultItems = dsia;
    private UISelectItems dropdown1SelectItems = new UISelectItems();
    public UISelectItems getDropdown1SelectItems() {
    return dropdown1SelectItems;
    public void setDropdown1SelectItems(UISelectItems uisi) {
    this.dropdown1SelectItems = uisi;
    private HtmlPanelGrid gridPanel1 = new HtmlPanelGrid();
    public HtmlPanelGrid getGridPanel1() {
    return gridPanel1;
    public void setGridPanel1(HtmlPanelGrid hpg) {
    this.gridPanel1 = hpg;
    private HtmlPanelGrid gridPanel2 = new HtmlPanelGrid();
    public HtmlPanelGrid getGridPanel2() {
    return gridPanel2;
    public void setGridPanel2(HtmlPanelGrid hpg) {
    this.gridPanel2 = hpg;
    private HtmlOutputText welcomeOT = new HtmlOutputText();
    public HtmlOutputText getWelcomeOT() {
    return welcomeOT;
    public void setWelcomeOT(HtmlOutputText hot) {
    this.welcomeOT = hot;
    private JdbcRowSetXImpl database_infoRowSet = new JdbcRowSetXImpl();
    public JdbcRowSetXImpl getDatabase_infoRowSet() {
    return database_infoRowSet;
    public void setDatabase_infoRowSet(JdbcRowSetXImpl jrsxi) {
    this.database_infoRowSet = jrsxi;
    private DefaultSelectItemsArray listbox1DefaultItems1 = new DefaultSelectItemsArray();
    public DefaultSelectItemsArray getListbox1DefaultItems1() {
    return listbox1DefaultItems1;
    public void setListbox1DefaultItems1(DefaultSelectItemsArray dsia) {
    this.listbox1DefaultItems1 = dsia;
    private HtmlSelectOneListbox dataSourceLB = new HtmlSelectOneListbox();
    public HtmlSelectOneListbox getDataSourceLB() {
    return dataSourceLB;
    public void setDataSourceLB(HtmlSelectOneListbox hsol) {
    this.dataSourceLB = hsol;
    private DefaultSelectItemsArray listbox1DefaultItems2 = new DefaultSelectItemsArray();
    public DefaultSelectItemsArray getListbox1DefaultItems2() {
    return listbox1DefaultItems2;
    public void setListbox1DefaultItems2(DefaultSelectItemsArray dsia) {
    this.listbox1DefaultItems2 = dsia;
    private UISelectItems listbox1SelectItems = new UISelectItems();
    public UISelectItems getListbox1SelectItems() {
    return listbox1SelectItems;
    public void setListbox1SelectItems(UISelectItems uisi) {
    this.listbox1SelectItems = uisi;
    private JdbcRowSetXImpl database_infoRowSet1 = new JdbcRowSetXImpl();
    public JdbcRowSetXImpl getDatabase_infoRowSet1() {
    return database_infoRowSet1;
    public void setDatabase_infoRowSet1(JdbcRowSetXImpl jrsxi) {
    this.database_infoRowSet1 = jrsxi;
    private JdbcRowSetXImpl user_tableRowSet = new JdbcRowSetXImpl();
    public JdbcRowSetXImpl getUser_tableRowSet() {
    return user_tableRowSet;
    public void setUser_tableRowSet(JdbcRowSetXImpl jrsxi) {
    this.user_tableRowSet = jrsxi;
    private HtmlMessages messageList1 = new HtmlMessages();
    public HtmlMessages getMessageList1() {
    return messageList1;
    public void setMessageList1(HtmlMessages hm) {
    this.messageList1 = hm;
    private HtmlOutputText welcomeOT1 = new HtmlOutputText();
    public HtmlOutputText getWelcomeOT1() {
    return welcomeOT1;
    public void setWelcomeOT1(HtmlOutputText hot) {
    this.welcomeOT1 = hot;
    // </editor-fold>
    public MainPage() {
    // <editor-fold defaultstate="collapsed" desc="Creator-managed Component Initialization">
    try {
    database_infoRowSet.setDataSourceName("java:comp/env/jdbc/mySQL");
    database_infoRowSet.setCommand("SELECT ALL database_info.DB_SRC, database_info.USER_ID FROM database_info WHERE database_info.USER_ID = ?");
    database_infoRowSet1.setDataSourceName("java:comp/env/jdbc/mySQL");
    database_infoRowSet1.setCommand("SELECT ALL database_info.DB_SRC, database_info.DB_URL, database_info.DB_SCHEMA, database_info.DB_TYPE, database_info.USER_ID FROM database_info WHERE database_info.USER_ID = ?");
    user_tableRowSet.setDataSourceName("java:comp/env/jdbc/mySQL");
    user_tableRowSet.setCommand("SELECT * FROM user_table");
    } catch (Exception e) {
    log("MainPage Initialization Failure", e);
    throw e instanceof javax.faces.FacesException ? (FacesException) e: new FacesException(e);
    // </editor-fold>
    // Additional user provided initialization code
    try{
    database_infoRowSet.setString(1, getSessionBean1().getSbUserID());
    database_infoRowSet1.setString(1, getSessionBean1().getSbUserID());
    database_infoRowSet.execute();
    database_infoRowSet1.execute();
    database_infoRowSet1.first();
    if (database_infoRowSet.next()) {
    // If no row found then make the following button's as readonly
    database_infoRowSet.first();
    else {
    FacesContext fc =
    javax.faces.context.FacesContext.getCurrentInstance();
    fc.addMessage(null, new FacesMessage(
    "Please Add Data Source to Begin Processing", ""));
    searchDataBTN.setDisabled(true);
    scrubbingRulesBTN.setDisabled(true);
    scrubDataSourceBTN.setDisabled(true);
    uploadDataSourceBTN.setDisabled(true);
    catch (Exception ex){
    log("Error in initializing database_info Row Set", ex);
    protected dissertation.ApplicationBean1 getApplicationBean1() {
    return (dissertation.ApplicationBean1)getBean("ApplicationBean1");
    protected dissertation.SessionBean1 getSessionBean1() {
    return (dissertation.SessionBean1)getBean("SessionBean1");
    * Bean cleanup.
    protected void afterRenderResponse() {
    user_tableRowSet.close();
    database_infoRowSet1.close();
    database_infoRowSet.close();
    public String searchDataBTN_action() {
    // TODO Following code was replaced by static navigation
    // TODO Replace with your code
    //if no value selected then we prompt them to select a row
    if (dataSourceLB.getValue().equals("")||dataSourceLB.getValue()== null){
    // return error msg to select a row before continuing
    FacesContext fc =
    javax.faces.context.FacesContext.getCurrentInstance();
    fc.addMessage(null, new FacesMessage("Please select a data source to process", ""));
    return null;
    else {
    // call method to retrieve the db_schema from the
    getDbDetails();
    getDbDriver();
    return "searchcriticaldata";
    public String scrubbingRulesBTN_action() {
    // TODO Replace with your code
    if (dataSourceLB.getValue().equals("")||dataSourceLB.getValue()== null){
    // return error msg to select a row before continuing
    FacesContext fc =
    javax.faces.context.FacesContext.getCurrentInstance();
    fc.addMessage(null, new FacesMessage("Please select a data source to process", ""));
    return null;
    else {
    // call method to retrieve the db_schema from the
    getDbDetails();
    getDbDriver();
    return "definecolumnrules";
    public String scrubDataSourceBTN_action() {
    // TODO Replace with your code
    if (dataSourceLB.getValue().equals("")||dataSourceLB.getValue()== null){
    // return error msg to select a row before continuing
    FacesContext fc =
    javax.faces.context.FacesContext.getCurrentInstance();
    fc.addMessage(null, new FacesMessage("Please select a data source to process", ""));
    return null;
    else {
    // call method to retrieve the db_schema from the
    getDbDetails();
    getDbDriver();
    return "scrubdata";
    public String uploadDataSourceBTN_action() {
    // TODO Replace with your code
    if (dataSourceLB.getValue().equals("")||dataSourceLB.getValue()== null){
    // return error msg to select a row before continuing
    FacesContext fc =
    javax.faces.context.FacesContext.getCurrentInstance();
    fc.addMessage(null, new FacesMessage("Please select a data source to process", ""));
    return null;
    else {
    // call method to retrieve the db_schema from the
    getDbDetails();
    getDbDriver();
    return "uploaddata";
    public String addDataSourceBTN_action() {
    // TODO Following code was replaced by static navigation
    if ( false) {
    // TODO Replace with your code
    if (addDataSourceTF.getValue().equals("")){
    FacesContext fc =
    javax.faces.context.FacesContext.getCurrentInstance();
    fc.addMessage(null, new FacesMessage(
    "Please specify Data Source to Add", ""));
    return null;
    else {
    String woSpaces = ((String)addDataSourceTF.getValue()).replace(' ', '_');
    getSessionBean1().setSbDataSrc(woSpaces);
    return "adddatasrc";
    return "adddatasrc";
    public void getDbDetails(){
    try {
    Context ctx = new InitialContext();
    if (ctx == null) throw new NamingException("No Initial Context");
    DataSource ds = (DataSource) ctx.lookup("java:comp/env/jdbc/mySQL");
    if (ds == null) throw new NamingException("No Data Source mySQL");
    Connection conn = ds.getConnection();
    if (conn == null)
    throw new SQLException("Unable to establish connection");
    String sql = "Select db_src, db_url, db_schema, db_type user_id, src_password from database_info where db_src=?";
    PreparedStatement pstmt = conn.prepareStatement(sql);
    pstmt.setString(1, (String) dataSourceLB.getValue());
    ResultSet rs = pstmt.executeQuery();
    if (rs.next()){
    getSessionBean1().setSbDataSrc(rs.getString("db_src"));
    getSessionBean1().setSbDb_Schema(rs.getString("db_schema"));
    getSessionBean1().setSbDb_Type(rs.getString("db_type"));
    getSessionBean1().setSbDb_Userid(rs.getString("user_id"));
    getSessionBean1().setSbDb_Password(rs.getString("src_password"));
    else
    java.lang.System.out.println("DB_Schema not found for db_src " +
    (String) dataSourceLB.getValue());
    rs.close();
    pstmt.close();
    conn.close();
    catch (SQLException ex) {
    java.lang.System.out.println("\n ----- SQL Exception caught ------\n");
    while (ex !=null){
    java.lang.System.out.println("Message: " + ex.getMessage());
    java.lang.System.out.println("SQLState: " + ex.getSQLState());
    java.lang.System.out.println("ErrorCode: " + ex.getErrorCode());
    ex = ex.getNextException();
    java.lang.System.out.println("");
    catch (NamingException e){
    java.lang.System.out.println("messge unable to establish context in changepassword.jsp");
    public void getDbDriver(){
    try {
    Context ctx = new InitialContext();
    if (ctx == null) throw new NamingException("No Initial Context");
    DataSource ds = (DataSource) ctx.lookup("java:comp/env/jdbc/mySQL");
    if (ds == null) throw new NamingException("No Data Source mySQL");
    Connection conn = ds.getConnection();
    if (conn == null)
    throw new SQLException("Unable to establish connection");
    String sql = "Select db_driver from database_type where db_type=?";
    PreparedStatement pstmt = conn.prepareStatement(sql);
    pstmt.setString(1, getSessionBean1().getSbDb_Type());
    ResultSet rs = pstmt.executeQuery();
    if (rs.next()){
    getSessionBean1().setSbDb_Driver(rs.getString("db_driver"));
    else
    java.lang.System.out.println("DB_Driver not found for db_src " +
    (String) dataSourceLB.getValue());
    rs.close();
    pstmt.close();
    conn.close();
    catch (SQLException ex) {
    java.lang.System.out.println("\n ----- SQL Exception caught ------\n");
    while (ex !=null){
    java.lang.System.out.println("Message: " + ex.getMessage());
    java.lang.System.out.println("SQLState: " + ex.getSQLState());
    java.lang.System.out.println("ErrorCode: " + ex.getErrorCode());
    ex = ex.getNextException();
    java.lang.System.out.println("");
    catch (NamingException e){
    java.lang.System.out.println("messge unable to establish context in changepassword.jsp");
    public String deleteDataSourceBTN_action() {
    // TODO Replace with your code
    try {
    Context ctx = new InitialContext();
    if (ctx == null) throw new NamingException("No Initial Context");
    DataSource ds = (DataSource) ctx.lookup("java:comp/env/jdbc/mySQL");
    if (ds == null) throw new NamingException("No Data Source mySQL");
    Connection conn = ds.getConnection();
    if (conn == null)
    throw new SQLException("Unable to establish connection");
    String sql = "Delete from database_info where db_src=?";
    PreparedStatement pstmt = conn.prepareStatement(sql);
    pstmt.setString(1, (String) deleteDataSourceDD.getValue());
    pstmt.executeUpdate();
    pstmt.close();
    conn.close();
    return "success";
    catch (SQLException ex) {
    java.lang.System.out.println("\n ----- SQL Exception caught ------\n");
    while (ex !=null){
    java.lang.System.out.println("Message: " + ex.getMessage());
    java.lang.System.out.println("SQLState: " + ex.getSQLState());
    java.lang.System.out.println("ErrorCode: " + ex.getErrorCode());
    ex = ex.getNextException();
    java.lang.System.out.println("");
    return "failure";
    catch (NamingException e){
    java.lang.System.out.println("messge unable to establish context in changepassword.jsp");
    return "failure";
    public void addDataSourceTF_processValueChange(ValueChangeEvent vce) {
    // TODO Replace with your code
    public void deleteDataSourceDD_processValueChange(ValueChangeEvent vce) {
    // TODO Replace with your code
    public void addDataSourceTF_validate(FacesContext fc, UIComponent uic, Object o) {
    // TODO Replace with your code
    }

  • Compiling java code from a running java application

    How does compiling of java code from a running java application work?
    I found a class: com.sun.tools.apt.main.JavaCompiler
    but cannot find any documentation of how this class works.

    How does compiling of java code from a running java
    application work?Probably most reliably using Runtime.exec().
    I found a class:
    com.sun.tools.apt.main.JavaCompiler
    but cannot find any documentation of how this class
    works.For a purpose. You are not supposed to use this class. With the next JRE release or implementation, it might not exist anymore - it's not part of the standard API.

  • First time compiling java codes

    Sirs,
    I am able to compile my codes but when I try to execute them
    the message below is shown....
    java.lang.NoSuchMethodError
    How do I fix it ? Thank you all

    The complete error was
    java.lang.NoSuchMethodError: main
    Exception in thread "main" Exit code: 1
    There were errors
    Then the class you are trying to run:
    java [-cp [i]classpath] ThisClass
    (let's assume it is named ThisClass)
    does not have the required:
    public static void main(String[] args)
    method implemented, as already pointed out earlier.

  • Still having problems compiling java code

    I still dont know what is wrong, it works just fine in JCreator but, when I try to use the command prompt it still gives me the same error message. Also I have made sure that the code is in the same directory with the command.

    Thanks for the advice Kitty, that was the command I
    was using javac <FileName.java>. I did, however,
    update my classpath and the path variables like you
    mentioned, but I am still recieving the same error
    message. I just cannot figure out where the error in
    the code is. =(Okay... apparently you need a little help...
    So to help you clarify thing a bit...
    Let's start here...
    This error below...
    C:\myfolder\test>javac VariableDemo.java
    'javac' is not recognized as an internal or external command,
    operable program or batch file.... is what you get if the OS does not know the path to javac.exe...
    if you type path at the command prompt you will see what your "System" path is, which would include an entry that would point to you sdk, something like "C:\YourJavaSDKFolder\bin";C:\someotherprogramfolder;
    This path has nothing to do with the classpath. Your system uses this path to find executables to run you programs ( although many are locations are actually in your registry an therefore no path entry is needed... i.e. MS Word )...
    This error...
    C:\myfolder\test>javac VariableDemo.java
    error: cannot read: VariableDemo.java
    1 errormeans that your compiler was not able to locate your *.java file. I was able to replicate because VariableDemo.java does not exist on my machine, so javac.exe naturally could not find the *.java file...
    javac.exe does not check the "System" path to find class files, so even though you saved you file in your "bin" folder of the SDK, javac would not know it there...
    the way that javac.exe is able to find you class files is either by the default "." as stated before which is your current working directory
    ( noted by your command prompt ... C:\myfolder\test> )
    or if you had specified your classpath either as an argument...
    C:\>javac -classpath c:\myfolder\test VariableDemo.javaor by setting the "classpath" environment variable either temporarily in you command prompt by typing
    set classpath=c:\myfolder\testor setting as you "System" environment variable by ( assuming Win XP though it similar for NT and 2000 ) via System Properties|Advance Tab|Environment Variable... Read your OS documentation for details involving setting your Environment Variable...
    as for why JCreator or what ever IDE you are using is able to do it, is because, part of what it does is temporarily pass the classpath information to the compiler automatically... so that you won't need to do it... and which is why IDE are generally not recommended to beginners to learn Java... It does to much stuff you... hence you classpath issue...
    anyway, check out the links provided for you for further and more detail information on setting the "classpath" on other Java basic...
    - MaxxDmg...
    - ' He who never sleeps... '

  • Problem with ajax/java code

    hi,
    this is the code that i've written
    <html>
    <head>
    <style type="text/css">
    A {bgcolor: "#0000ff";font-style: bold,underline}
    </style>
    <script language="javascript" src="C:\Documents and Settings\harishn\Desktop\ajax\code\javacode.js">
    </script>
    <title>
    User Login
    </title>
    </head>
    <body bgcolor="#ddeeff" onLoad="message('Complete')">
    <center>
    <h1>Welcome to the mailing system</h1><hr/>
    <h3>Please enter your user name and password : </h3>
    <form name="form1" action="C:\Documents and Settings\harishn\Desktop\ajax\code\mail1.html" method="post">
    Username <input type="text" name="username" onMouseOver="message('Enter your username')" onMouseOut="message('')"/>
    its working fine but the java script file is not being included
    the java file is this
    <script language="javascript" type="text/javascript">
    function message(text)
    window.status=text;
    return(true);
    </script>
    what am i doing wrong?

    oh whatever!
    i located the problem anyway.
    the .js file isn't supposed to contain the <script> </script> tags

  • Problem to compile .java class

    hi,
    i'm using/creating a package of classes....and as per my knowledge there is no need to write explicit import if u r importing/using an instance of class1 in other class2 in the same package.....
    I'm doing the same.....
    but the problem arrises here that....while compiling class2 the error occures..........
    D:\tomcat\webapps\Books\WEB-INF\classes\BookForm.java:6: cannot resolve symbol
    symbol : class Book
    location: class BookForm
         private Book book =new Book();
    why so????? as i have included the package in CLASSPATH also..........
    PLZ reply....
    .....Amita

    You don't need to import classes that are in the same package but they do need to be in the classpath. My guess is that you are compiling BookForm.java from the D:\tomcat\webapps\Books\WEB-INF\classes directory. Either add "D:\tomcat\webapps\Books\WEB-INF\classes" explicitly to your classpath or add a dot (".") to your classpath.

  • Problem in compiling JAVA SWING

    Dear frens,
    I'm new in java swing. I have some knowledge in developing java in DOS, but dont have any knowledge in developing java in gui. I have write a program but it is unable to compile.
    I compile like this ----> javac HelloWorldSwing.java
    please help me to provide a guide.
    thank you
    regards
    Singaravelan

    import javax.swing.*;
    import java.lang.*;
    public class HelloWorldSwing {
         * Create the GUI and show it. For thread safety,
         * this method should be invoked from the
         * event-dispatching thread
         private static void createAndShowGUI() {
              //Make sure we have nice window decorations.
              JFrame.setDefaultLookAndFeelDecorated(true);
              //Create and set up the window.
              JFrame frame = new JFrame("HelloWorldSwing");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              //Add the ubiquitous "Hello World" label
              JLabel label = new JLabel("Hello World");
              frame.getContentPane().add(label);
         public static void main(String[] args) {
              //Schedule a job for the event-dispatching thread:
              //creating and showing this application's GUI.
              javax.swing.SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        createAndShowGUI();
    This is my program, i can compile but cannot run the program

Maybe you are looking for