[solved] Problem compiling ConTeXt code
I'd like to start learning ConTeXt and I've just tried to compile a simple hello world:
\starttext
Hello world.
\stoptext
when compiling with texexec I get this output:
mtxrun | kpse fallback with progname 'context' initialized in 0.02 seconds/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require': /usr/share/texmf-dist/scripts/context/ruby/base/switch.rb:501: invalid multibyte escape: /\xFF/ (SyntaxError)
from /usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from /usr/share/texmf-dist/scripts/context/ruby/texexec.rb:11:in `<main>'
I have ruby and all texlive packags installed except texlive-lang*. Searching for an answer I found an old discussion on the forum (2008) where it was suggested to run
luatools --generate
before using texexec, but this lead me to another error:
mtxrun | unknown script 'base.lua' or 'mtx-base.lua'
Am I missing some package-stuff necessary to compile ConTeXt code?
edit: looks like I was reading an obsolete guide. It is now reccomended to compile code with "context <filename>", which works fine.
Last edited by Box0 (2013-04-15 09:18:52)
Hi there,
I tried
g++ mclient.cpp -llibboost_filesystem -llibboost_program_options -llibboost_system -llibboost_thread -o tutorial
and received
/usr/bin/ld: cannot find -llibboost_filesystem
/usr/bin/ld: cannot find -llibboost_program_options
/usr/bin/ld: cannot find -llibboost_system
/usr/bin/ld: cannot find -llibboost_thread
collect2: error: ld returned 1 exit status
Similar Messages
-
Hi guys, hope this is the right section to post this problem. I'm trying to compile (and install) Suitesparse but everytime i obtain this strange error i have never seen before...any idea to solve it?Thanks
cholmod_super_numeric.c:(.text+0x117d): undefined reference to `dsyrk_'
cholmod_super_numeric.c:(.text+0x125c): undefined reference to `dgemm_'
cholmod_super_numeric.c:(.text+0x184d): undefined reference to `dtrsm_'
cholmod_super_numeric.c:(.text+0x2401): undefined reference to `zherk_'
cholmod_super_numeric.c:(.text+0x24e5): undefined reference to `zgemm_'
cholmod_super_numeric.c:(.text+0x2a08): undefined reference to `ztrsm_'
cholmod_super_numeric.c:(.text+0x35c1): undefined reference to `zherk_'
cholmod_super_numeric.c:(.text+0x36a5): undefined reference to `zgemm_'
cholmod_super_numeric.c:(.text+0x3c17): undefined reference to `ztrsm_'
../Lib/libcholmod.a(cholmod_super_solve.o): In function `cholmod_super_ltsolve':
cholmod_super_solve.c:(.text+0x715): undefined reference to `zgemm_'
cholmod_super_solve.c:(.text+0x7b2): undefined reference to `ztrsm_'
cholmod_super_solve.c:(.text+0xa37): undefined reference to `zgemv_'
cholmod_super_solve.c:(.text+0xaa1): undefined reference to `ztrsv_'
cholmod_super_solve.c:(.text+0xde7): undefined reference to `dgemm_'
cholmod_super_solve.c:(.text+0xe7b): undefined reference to `dtrsm_'
cholmod_super_solve.c:(.text+0x10c8): undefined reference to `dgemv_'
cholmod_super_solve.c:(.text+0x112c): undefined reference to `dtrsv_'
../Lib/libcholmod.a(cholmod_super_solve.o): In function `cholmod_super_lsolve':
cholmod_super_solve.c:(.text+0x182c): undefined reference to `ztrsm_'
cholmod_super_solve.c:(.text+0x18fc): undefined reference to `zgemm_'
cholmod_super_solve.c:(.text+0x1a46): undefined reference to `ztrsm_'
cholmod_super_solve.c:(.text+0x1bea): undefined reference to `ztrsv_'
cholmod_super_solve.c:(.text+0x1c94): undefined reference to `zgemv_'
cholmod_super_solve.c:(.text+0x1fb5): undefined reference to `dtrsm_'
cholmod_super_solve.c:(.text+0x2080): undefined reference to `dgemm_'
cholmod_super_solve.c:(.text+0x219b): undefined reference to `dtrsm_'
cholmod_super_solve.c:(.text+0x231f): undefined reference to `dtrsv_'
cholmod_super_solve.c:(.text+0x23c6): undefined reference to `dgemv_'
/usr/bin/ld: cholmod_demo: hidden symbol `__powidf2' in /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.2/libgcc.a(_powidf2.o) is referenced by DSO
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status
make[1]: *** [cholmod_demo] Error 1
Last edited by Demind (2008-09-15 11:09:07)Garns wrote:Does your atlas package contain libblas.a or does the blas library have another name? I scanned the atlas makefile and I couldn't find a reference to libblas.a, only libf77blas.a and libcblas.a. Are the libs installed to /usr/libs/ or to some subdir? If one of this is the case you might have to edit UFconfig/UFconfig.mk accordingly.
Sorry this problem is so frustrating that i have pasted the wrong error...actually i had a UFconfig/UFconfig.mk edited and that gave me the same problem, I don't have libblas.a on my system but the reason is that this is substitued by libatlas.a!
I paste here the "final" result:
make[2]: Leaving directory `/home/marco/Desktop/SuiteSparse/CCOLAMD'
gcc -O3 -fexceptions -m64 -o cholmod_demo -I../Include -I../../UFconfig cholmod_demo.c ../Lib/libcholmod.a ../../AMD/Lib/libamd.a ../../COLAMD/Lib/libcolamd.a ../../CCOLAMD/Lib/libccolamd.a ../../CAMD/Lib/libcamd.a ../../metis-4.0/libmetis.a -llapack -lgfortran -lgfortran -lpthread -Lusr/lib -lf77blas -latlas -lm
/usr/bin/ld: cholmod_demo: hidden symbol `__powidf2' in /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.2/libgcc.a(_powidf2.o) is referenced by DSO
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status
make[1]: *** [cholmod_demo] Error 1
Obviously the "undefined reference" statements are gone but the main problem, the hidden symbol, is always there...and now i'm sure this is the error i hope to solve, the first one (and i apologize for that) was a build with wrong flag...
And when i wrote about a possible gcc version problem was because this line says:
/usr/bin/ld: cholmod_demo: hidden symbol `__powidf2' in /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.2/libgcc.a(_powidf2.o) is referenced by DSO
what do you think about it?
p.s. i can compile UMFPACK without problems...the whole Suite on the contrary gives me this -
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... ' -
[Solved] Problems compiling a kernel on Archlinux
Hi all, some days ago I wanted to compile a kernel on my system, and everything was fine but I have a simple problem.
Compile the kernel in the traditional manner, but no logo create the ramdisk image.
https://wiki.archlinux.org/index.php/Ke … raditional
Example:
cp -v arch/x86/boot/bzImage /boot/vmlinuz-NewKernel
And:
mkinitcpio -k NewKernel -g /boot/initramfs-NewKernel.img
But I get this error:
Error: unable to locate module directory for NewKernel.
What am I doing wrong?
PD:Sorry for my English
Last edited by Linpandro (2012-10-03 13:50:43)This:
mkinitcpio -k NewKernel -g /boot/initramfs-NewKernel.img
Should be this:
mkinitcpio -k 3.x.x-RCn-NewKernel -g /boot/initramfs-NewKernel.img
To clarify, the wiki tells you to run this:
# mkinitcpio -k FullKernelName -g /boot/initramfs-YourKernelName.img
If you need any modules loaded in order to mount the root filesystem, build a ramdisk (most users need this). The -k parameter accepts the kernel version and appended string you set in menuconfig and is used to locate the corresponding modules directory in '/usr/lib/modules':
If you used the sources for, say, 3.5.4, "FullKernelName" would be 3.5.4-NewKernel.
If you're not sure about what the "FullKernelName" should be, simply check which directory was created after running modules_install
ls -l /lib/modules
This should show you something like this:
[stefan@archsteef scrub]$ ls -l /lib/modules/
total 8
drwxr-xr-x 3 root root 4096 Sep 30 01:30 3.5.4-1-ARCH
drwxr-xr-x 2 root root 4096 Sep 30 01:30 extramodules-3.5-ARCH
drwxr-xr-x 2 root root 4096 Oct 1 03:25 3.5.4-NewKernel
The directory name is the full name of your kernel and can be used after the -k flag.
p.s. this is all assuming that you used make menuconfig to set the local version name to "NewKernel"
Last edited by stefanwilkens (2012-10-03 08:15:26) -
[solved]Problem compiling alsa from source
I'm trying to install alsa-driver-1.0.18a from source because I need to compile it with snd-virtuoso. So I run "./configure --with-cards=virtuoso --with-sequencer=yes" then when I run "make" I get this at the end of it.
make -C /lib/modules/2.6.27-ARCH/build SUBDIRS=/usr/src/alsa/alsa-driver-1.0.18a CPP="gcc -E" CC="gcc" modules
make[1]: Entering directory `/usr/src/linux-2.6.27-ARCH'
CC [M] /usr/src/alsa/alsa-driver-1.0.18a/acore/memory_wrapper.o
In file included from /usr/src/alsa/alsa-driver-1.0.18a/acore/memory_wrapper.c:25:
/usr/src/alsa/alsa-driver-1.0.18a/include/adriver.h:282:1: warning: "GFP_DMA32" redefined
In file included from include/linux/kmod.h:22,
from include/linux/module.h:13,
from /usr/src/alsa/alsa-driver-1.0.18a/include/adriver.h:57,
from /usr/src/alsa/alsa-driver-1.0.18a/acore/memory_wrapper.c:25:
include/linux/gfp.h:105:1: warning: this is the location of the previous definition
In file included from /usr/src/alsa/alsa-driver-1.0.18a/acore/memory_wrapper.c:25:
/usr/src/alsa/alsa-driver-1.0.18a/include/adriver.h:831: error: static declaration of 'jiffies_to_msecs' follows non-static declaration
include/linux/jiffies.h:286: error: previous declaration of 'jiffies_to_msecs' was here
/usr/src/alsa/alsa-driver-1.0.18a/include/adriver.h:850: error: static declaration of 'msecs_to_jiffies' follows non-static declaration
include/linux/jiffies.h:288: error: previous declaration of 'msecs_to_jiffies' was here
In file included from /usr/src/alsa/alsa-driver-1.0.18a/include/adriver.h:948,
from /usr/src/alsa/alsa-driver-1.0.18a/acore/memory_wrapper.c:25:
include/linux/pci.h:627: error: expected identifier or '(' before numeric constant
In file included from include/asm/pci.h:4,
from include/linux/pci.h:989,
from /usr/src/alsa/alsa-driver-1.0.18a/include/adriver.h:948,
from /usr/src/alsa/alsa-driver-1.0.18a/acore/memory_wrapper.c:25:
include/linux/mm.h:261: error: conflicting types for 'snd_compat_vmalloc_to_page'
/usr/src/alsa/alsa-driver-1.0.18a/include/adriver.h:752: error: previous declaration of 'snd_compat_vmalloc_to_page' was here
In file included from /usr/src/alsa/alsa-driver-1.0.18a/acore/memory_wrapper.c:25:
/usr/src/alsa/alsa-driver-1.0.18a/include/adriver.h: In function 'snd_pci_orig_save_state':
/usr/src/alsa/alsa-driver-1.0.18a/include/adriver.h:1197: error: too many arguments to function 'pci_save_state'
/usr/src/alsa/alsa-driver-1.0.18a/include/adriver.h: In function 'snd_pci_orig_restore_state':
/usr/src/alsa/alsa-driver-1.0.18a/include/adriver.h:1201: error: too many arguments to function 'pci_restore_state'
In file included from /usr/src/alsa/alsa-driver-1.0.18a/acore/memory_wrapper.c:25:
/usr/src/alsa/alsa-driver-1.0.18a/include/adriver.h:1598:1: warning: "page_to_pfn" redefined
In file included from include/asm/page.h:196,
from include/asm/pda.h:8,
from include/asm/current.h:19,
from include/asm/processor.h:15,
from include/linux/prefetch.h:14,
from include/linux/list.h:6,
from include/linux/module.h:9,
from /usr/src/alsa/alsa-driver-1.0.18a/include/adriver.h:57,
from /usr/src/alsa/alsa-driver-1.0.18a/acore/memory_wrapper.c:25:
include/asm-generic/memory_model.h:78:1: warning: this is the location of the previous definition
/usr/src/alsa/alsa-driver-1.0.18a/acore/memory_wrapper.c: In function 'snd_compat_vmalloc_to_page':
/usr/src/alsa/alsa-driver-1.0.18a/acore/memory_wrapper.c:44: error: implicit declaration of function 'VMALLOC_VMADDR'
/usr/src/alsa/alsa-driver-1.0.18a/acore/memory_wrapper.c:49: error: incompatible type for argument 1 of 'pud_val'
/usr/src/alsa/alsa-driver-1.0.18a/acore/memory_wrapper.c:50: error: implicit declaration of function 'pte_offset'
/usr/src/alsa/alsa-driver-1.0.18a/acore/memory_wrapper.c:50: warning: assignment makes pointer from integer without a cast
make[3]: *** [/usr/src/alsa/alsa-driver-1.0.18a/acore/memory_wrapper.o] Error 1
make[2]: *** [/usr/src/alsa/alsa-driver-1.0.18a/acore] Error 2
make[1]: *** [_module_/usr/src/alsa/alsa-driver-1.0.18a] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.27-ARCH'
make: *** [compile] Error 2
edit: I tried compiling it on another computer and it was able too...not sure why mine wont. Although I do seem to remember possibly forgetting to uninstall it before making it again (after kernel upgrade)...I've tried multiple times to compile so far. Is there someway I can get a list of things to delete to manually remove all remnants of a previous install of alsa-driver?
Last edited by Gauvenator (2008-12-13 19:48:11)Ok I ended up compiling the kernel from source for something else, so I tried compiling the alsa driver from source and it worked...maybe something was leftover in the previous kernel source directory that was causing problems.
-
[solved] Problems compiling hydrogen
I'm trying to compile hydrogen version 0.9.4, so I can use Qt4. I made a PKGBUILD by editing the PKGBUILD of ABS and following the instructions of this page
It compiles everything ok, but the problem is when running 'make install', I guess. I'm compiling it using makepkg, so I don't know why I'm having problems with permissions denied. These are the relevant error messages:
cd gui/ && make -f Makefile install
make[1]: Entering directory `/home/andre/tmp/hydrogen/src/hydrogen-build/gui'
install -m 755 -p "../hydrogen" "/usr/bin/hydrogen"
install: cannot create regular file `/usr/bin/hydrogen': Permission denied
make[1]: [install_target] Error 1 (ignored)
strip "/usr/bin/hydrogen"
strip: '/usr/bin/hydrogen': No such file
make[1]: [install_target] Error 1 (ignored)
mkdir: cannot create directory `/usr//share/hydrogen': Permission denied
make[1]: *** [install_documentation] Error 1
make[1]: Leaving directory `/home/andre/tmp/hydrogen/src/hydrogen-build/gui'
make: *** [sub-gui-install_subtargets] Error 2
Even with the two errors, it finishes making the package, but it only has the /usr/share dir in it, there's no /usr/lib or /usr/bin.
Here's the PKGBUILD:
pkgname=hydrogen-qt4
pkgver=248
pkgrel=1
pkgdesc="An advanced drum machine/pattern editor with midi support for GNU/Linux"
url="http://www.hydrogen-music.org/"
arch=(i686 x86_64)
license=('GPL')
depends=('qt' 'liblrdf' 'jack-audio-connection-kit>=0.102.20-2')
makedepends=('subversion' 'lash' 'libtar')
provides=('hydrogen')
conflicts=('hydrogen')
install=hydrogen.install
source=(hydrogen.desktop)
md5sums=('8d6eacef58aa22cdba97485f9bdbb4b3')
options=('!makeflags')
_svntrunk=http://hydrogen-music.org/svn/trunk
_svnmod=hydrogen
build() {
cd ${startdir}/src
msg "Connecting to $_svnmod SVN server...."
svn co $_svntrunk $_svnmod
[ -d ./$_svnmod-build ] && rm -fr ./$_svnmod-build
cp -r ./$_svnmod ./$_svnmod-build
cd ./$_svnmod-build
msg "SVN checkout done or server timeout"
msg "Starting make..."
prefix=/usr/ ./configure || return 1
make || return 1
make DESTDIR=${startdir}/pkg install
install -D -m644 ${startdir}/src/hydrogen.desktop \
${startdir}/pkg/usr/share/applications/hydrogen.desktop
mkdir ${startdir}/pkg/usr/share/pixmaps
cd ${startdir}/pkg/usr/share/pixmaps
ln -s ../hydrogen/data/img/gray/icon.svg ./hydrogen.svg
ln -s ../hydrogen/data/img/gray/icon64.png ./hydrogen.png
The line "prefix=/usr/ ./configure" is correct, if you use --prefix=/usr/ after ./configure, configure will ignore it.
What is wrong with it?
Thanks
Last edited by andre.ramaciotti (2008-07-17 00:31:10)you should keep:
prefix=/usr/ ./configure
because path given to the configure script can be hard-coded in the apps.
instead use:
make prefix=${startdir}/usr/pkg install
It's strange that the usual ./configure --prefix=/usr doesn't work. I haven't checked the sources BTW. -
[SOLVED] Problem compiling kernel for an Arch install on USB pendrive
I've installed Arch linux to a USB pendrive and I'm building a kernel for my specific hardware (Acer Aspire One) so as there is no kernel26.img file needed.
I've used gothicknight's custom kernel but it doesn't work for me as it doesn't recognise my USB stick (/dev/sdb). Instead, it just recognises the SSD (/dev/sda). I believe the standard Arch kernel uses a "hook" called "usb" in order to work from a USB stick - at least that's how I've got the current (default) Archlinux kernel working.
I'm not that skilled at linux and am still quite new to kernel compilation (I've done it once or twice before and, yes, I've read the ArchWiki articles - both of them). Can anyone tell me what I should do to get things working on a USB stick install?
Kind regards
Last edited by Shagbag (2008-09-30 20:27:49)Solved it. I didn't need to recompile. I just needed to add 'rootdelay=5' as a kernel boot parameter.
-
Hi all:-
I know this question seems very basic, but i am really pissed out, so please help me out
package somepackage;
public class aClass {
public static void method(){
System.out.println("Inside the aClass and method");
}I have saved this file in aClass.java and its compiling and placed the class file in the somepackage directory.
import somepackage.*;
public class pTest {
public static void main(String args[]){
System.out.println("Inside the main method");
aClass.method();
}this class is saved in the pTest.java file and saved in the parent directory of somepackage. But when i compile this its giving me error such as:-
pTest.java:7: cannot access aClass
bad class file: ./aClass.java
file does not contain class aClass
Please remove or make sure it appears in the correct subdirectory of the classpath.
aClass.method();
^
1 error
When i replace the import statement with this one this one import somepackage.aClass; its compiling and running.
Am i missing out something ???
Thanks in advance.
Rajesh sCross-post
http://forum.java.sun.com/thread.jspa?threadID=618703 -
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,
nullI 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 -
Problem compiling PL/SQL code
I am having problmes compiling the following piece of pl/sql
code:
declare
v_servicekey services.servicekey%type;
v_tmodelkey tmodels.tmodelkey%type;
l_bindingid bindingtemplates.bindingid%type;
i_rowlimit number(28);
begin
select bindingid
into l_bindingid
from
(select b.bindingid as bindingid,
b.bindingkey,
nvl(b.accesspointurltype,''),
nvl(b.accesspointurl,''),
nvl(b.hostingredirector,''),
b.updated
from bindingtemplates b, services s
where s.serviceid=b.serviceid
and s.servicekey=v_servicekey
and (b.bindingid in (select i.bindingid
from instances
i,tmodels t
where
t.tmodelid=i.tmodelid
and
t.tmodelkey=v_tmodelkey)
or (b.hostingredirector is not
null
and b.hostingredirector in
(select bindingkey
from bindingtemplates
where bindingid in (select i.bindingid
from instances i,tmodels t
where t.tmodelid = i.tmodelid
and t.tmodelkey = v_tmodelkey))))
order by b.updated)
where rownum <= i_rowlimit;
end;
I get the compilation error
ERROR at line 30:
ORA-06550: line 30, column 27:
PLS-00103: Encountered the symbol "ORDER" when expecting one of
the following:
) * & = - + < / > in mod not rem with an exponent (**)
<> or != or ~= >= <= <> and or like between group having
intersect minus start union where connect is null is not ||
is dangling year DAY_
The symbol ")" was substituted for "ORDER" to continue.
ORA-06550: line 30, column 45:
PLS-00103: Encountered the symbol ")" when expecting one of the
following:
. ( , * @ % & - + ; / for mod rem an exponent (**) asc desc
||
Obviously there is only one SQL and it is complaining about the
ORDER BY clause. Please ignore the values for the host variables.
The same SQL when run from the SQL prompt with values
substituted for the host variables runs perfectly well. Am I
missing something or is there a catch with Oracle PL/SQL.
Please enlighten.
Thankssee
http://forums.oracle.com/forums/message.jsp?id=500260
I want to know that if there is any PL/SQL commad for compiling the code?
My problem is, I am working in an environment where we are using a Database tool named TOAD of QUEST Software. Every body can look into the code. I just want to hide this code from others. A Quick reply in this regard will be really very helpful. -
Problem with .c code generated from proc compiler.
I am having a problem compiling the c code generated from the proc pre-compiler.
First some info on my system.
[root@dell-xps-420-22 ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Client release 5.4 (Tikanga)
[root@dell-xps-420-22 ~]# cat /proc/version
Linux version 2.6.18-164.11.1.el5 ([email protected]) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-46)) #1 SMP Wed Jan 6 13:26:04 EST 2010
[root@dell-xps-420-22 ~]# uname -a
Linux dell-xps-420-22.drew.com 2.6.18-164.11.1.el5 #1 SMP Wed Jan 6 13:26:04 EST 2010 x86_64 x86_64 x86_64 GNU/Linux
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
I have written a simple PRO*C program to test the compile.
[oracle@dell-xps-420-22 etl]$ cat Test.pc
#include <stdio.h>
main(int argc,char **argv)
printf("Testing ........\n");
[oracle@dell-xps-420-22 admin]$ cat pcscfg.cfg
sys_include=(/usr/include,/usr/include/linux,/build/s630/precomp/public,/usr/lib/gcc/x86_64-redhat-linux/4.1.1/include)
include=$(ORACLE_HOME)/precomp/public
include=$(ORACLE_HOME)/precomp/hdrs
include=$(ORACLE_HOME)/precomp/include
CODE=cpp
TYPE_CODE=ORACLE
DEF_SQLCODE=YES
VARCHAR=YES
LTYPE=short
define=__x86_64__
When compiling the Test.pc program with the pcscfg.cfg file above.
[oracle@dell-xps-420-22 etl]$ proc Test.pc
Pro*C/C++: Release 10.2.0.1.0 - Production on Sun Feb 21 19:51:15 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
System default option values taken from: /u01/app/oracle/product/10.2.0/db_1/precomp/admin/pcscfg.cfg
[oracle@dell-xps-420-22 etl]$ gcc -c ./Test.c -I . -I$ORACLE_HOME/precomp/public
./Test.c:117: error: expected identifier or '(' before string constant
./Test.c:131: error: expected identifier or '(' before string constant
The code generated by the proc compiler that has problems is below.
//File Test.c
// Prototypes
Line 117: extern "C" {
void sqlcxt (void **, unsigned int *,
struct sqlexd *, const struct sqlcxp *);
void sqlcx2t(void **, unsigned int *,
struct sqlexd *, const struct sqlcxp *);
void sqlbuft(void **, char *);
void sqlgs2t(void **, char *);
void sqlorat(void **, unsigned int *, void *);
// Forms Interface
Line 131: extern "C" { void sqliem(char *, int *); }
It seems like the compiler is generating c++ code but the gcc compiler is only compiling in cc mode. I've tried a number of options in the pcscfg.cfg file to no avail. I have tried the different options for the CODE=cpp in the pcscfg.cfg file but still get the same error and/or multiple errors. I have also tried to compile the oracle demo programs using the demo_proc.mk file and also get the same error.
The install of Oracle is fine. I can start the database and have created a needed user and tables but cannot successfully compile the pro*C code.My proc is also compiling for cpp code but in the pcscfg.cfg file there is no "CODE=cpp"
-
Can anybody tell me the problem with this code when compiled in jdk1.4
Can anybody help me find out the error in this code.
Try to drag a file from your desktop and drop it on the first textpane on my GUI. Then try to drag another file. This time the dragdrop event handler throws a null pointer exception. This happened when I compiled the code with jdk1.4. With jdk1.3 it is working fine. Actually, I need jdk1.4 to get the systemicons for the files I drop on my desktop.
/* Client.java*/
import java.util.Vector;
import java.util.Enumeration;
import java.util.Arrays;
import java.awt.*;
import java.awt.event.*;
import java.rmi.*;
import java.rmi.server.*;
import javax.swing.*;
import javax.swing.tree.*;
import javax.swing.filechooser.*;
import java.io.*;
import java.awt.dnd.*;
import java.awt.datatransfer.*;
import java.util.Iterator;
import javax.swing.plaf.*;
import javax.swing.plaf.basic.*;
import java.util.Hashtable;
import javax.swing.text.*;
import javax.swing.event.*;
public class Client extends JFrame{
static String newline = System.getProperty("line.separator");
static Client client;
//ServerInterface server;
//ClientProperties clp;
Vector v1=new Vector();
ByteArrayOutputStream out;
Runtime r1;
//file objects,together with array of bytes
Hashtable files=new Hashtable(); //files sent
Hashtable rfiles=new Hashtable(); //files received
//file objects,together with button handlers
Hashtable hfiles=new Hashtable(); //files sent,files received
JButton button1=new JButton();
JButton button2=new JButton();
JButton button3=new JButton();
JLabel label1=new JLabel();
JLabel label2=new JLabel();
JLabel label3=new JLabel();
JLabel label4=new JLabel();
JLabel label5=new JLabel();
JLabel label6=new JLabel();
JLabel label7=new JLabel();
JLabel label8=new JLabel();
JOptionPane dialog=new JOptionPane();
JFileChooser chooser = new JFileChooser();
JPanel panel1;
JPanel panel2;
DropTarget dtarget;
DragSource dsource;
JTextPane textArea1=new JTextPane();
TextArea textArea2=new TextArea();
JTextPane textpanel=new JTextPane();
Style defstyle,style;
StyledDocument doc,doc1;
JPopupMenu popup;
JTree tree;
JScrollPane jsppane;
JScrollPane jsp,jsp2;
DefaultMutableTreeNode top;
Container cp;
private String toalias;
private String togroup;
private String fromalias;
private String fromgroup;
private boolean CONNECT;
public Client()
cp=getContentPane();
cp.setLayout(null);
setForeground(java.awt.Color.red);
setFont(new Font("Dialog", Font.PLAIN, 14));
setVisible(false);
label1.setText(" CHAT APPLICATION");
cp.add(label1);
label1.setFont(new Font("Dialog", Font.BOLD, 16));
label1.setBounds(72,20,319,30);
label2.setText("List of Users Connected.");
cp.add(label2);
label2.setForeground(java.awt.Color.blue);
label2.setFont(new Font("Dialog", Font.BOLD, 12));
label2.setBounds(24,60,192,26);
label8.setBounds(280,60,100,26);
cp.add(label8);
cp.add(textArea2);
textArea2.setBounds(204,120,268,90);
jsppane=new JScrollPane(textArea1);
doc1=textArea1.getStyledDocument();
jsppane.setBounds(12,264,456,109);
cp.add(jsppane);
label3.setText("TO::");
cp.add(label3);
label3.setFont(new Font("Dialog", Font.BOLD, 12));
label3.setBounds(12,228,36,20);
cp.add(label4);
label4.setBackground(java.awt.Color.lightGray);
label4.setBounds(60,228,172,19);
label5.setText("SERVER RESPONSE");
cp.add(label5);
label5.setFont(new Font("Dialog", Font.BOLD, 12));
label5.setBounds(204,96,204,21);
label7.setText("MESSAGE FOR YOU.");
cp.add(label7);
label7.setFont(new Font("Dialog", Font.BOLD, 14));
label7.setBounds(12,371,288,25);
jsp2=new JScrollPane(textpanel);
setTextPaneStyle();
jsp2.setBounds(12,401,456,109);
cp.add(jsp2);
button1.setLabel("Send");
button1.setEnabled(false);
cp.add(button1);
button1.setBackground(java.awt.Color.lightGray);
button1.setForeground(java.awt.Color.black);
button1.setFont(new Font("Dialog", Font.BOLD|Font.ITALIC, 10));
button1.setBounds(60,520,78,36);
button2.setLabel("Attach");
//button2.setEnabled(false);
cp.add(button2);
button2.setBackground(java.awt.Color.lightGray);
button2.setForeground(java.awt.Color.black);
button2.setFont(new Font("Dialog", Font.BOLD|Font.ITALIC, 10));
button2.setBounds(180,520,72,36);
button3.setLabel("Connect");
cp.add(button3);
button3.setBackground(java.awt.Color.lightGray);
button3.setForeground(java.awt.Color.black);
button3.setFont(new Font("Dialog", Font.BOLD|Font.ITALIC, 10));
button3.setBounds(288,520,72,33);
setSize(500,620);
show();
addWindowListener(new WindowEventHandler());
button1.addActionListener(new ButtonHandler());
button2.addActionListener(new ButtonHandler());
button3.addActionListener(new ButtonHandler());
textArea1.addContainerListener(new ComponentHandler());
dtarget=new DropTarget(textArea1,new DragDropHandler());
textArea2.setEnabled(false);
textpanel.setEnabled(false);
r1=Runtime.getRuntime();
r1.addShutdownHook(new onshutdown());
addMenu();
cp.repaint();
//adds attachments to the textArea1
synchronized private void addAttach(java.util.List fileList)
Iterator iterator=fileList.iterator();
JButton bw;
while(iterator.hasNext())
File file=(File)iterator.next();
Icon icon=chooser.getIcon(file);
bw=new JButton(icon);
bw.setBackground(java.awt.Color.gray);
bw.setToolTipText(file.getAbsolutePath());
bw.addMouseListener(new AttachmentHandler());
Dimension d1=new Dimension(icon.getIconWidth(),icon.getIconHeight());
bw.setMaximumSize(d1);
hfiles.put(bw,file);
textArea1.insertComponent(bw);
textArea1.setCaretPosition(doc1.getLength());
bw.setSize(icon.getIconWidth(),icon.getIconHeight());
//only one file at a time
break;
cp.repaint();
public void setAudioStream(ByteArrayOutputStream out)
this.out=out;
private void addMenu()
JMenuBar mbar=new JMenuBar();
mbar.setVisible(true);
mbar.setBounds(0,0,500,20);
mbar.setBackground(java.awt.Color.gray);
//first menu
JMenu m1=new JMenu("Connection");
m1.setBounds(0,0,80,20);
m1.setBackground(java.awt.Color.gray);
JMenuItem mitem1=new JMenuItem("Connect");
JMenuItem mitem2=new JMenuItem("Disconnect");
m1.add(mitem1);
m1.add(mitem2);
mitem1.addActionListener(new ButtonHandler());
mitem2.addActionListener(new ButtonHandler());
mbar.add(m1);
//second menu
JMenu m2=new JMenu("Send...");
m2.setBounds(90,0,80,20);
m2.setBackground(java.awt.Color.gray);
JMenuItem mitem3=new JMenuItem("Send");
JMenuItem mitem4=new JMenuItem("Send with Audio...");
mitem3.addActionListener(new ButtonHandler());
mitem4.addActionListener(new ButtonHandler());
m2.add(mitem3);
m2.add(mitem4);
mbar.add(m2);
cp.add(mbar);
private void setTextPaneStyle()
StyleContext stylecontext =StyleContext.getDefaultStyleContext();
defstyle=stylecontext.getStyle(StyleContext.DEFAULT_STYLE);
doc= textpanel.getStyledDocument();
//style 1
style= textpanel.addStyle("bold",defstyle);
StyleConstants.setBackground(style,Color.white);
StyleConstants.setForeground(style,Color.blue);
StyleConstants.setItalic(style, false);
StyleConstants.setBold(style, true);
StyleConstants.setFontSize(style,16);
//style 2
style= textpanel.addStyle("normal",defstyle);
StyleConstants.setBackground(style,Color.white);
StyleConstants.setForeground(style,Color.black);
StyleConstants.setItalic(style, false);
StyleConstants.setBold(style, false);
StyleConstants.setFontSize(style,14);
//style3
style= textpanel.addStyle("attach",defstyle);
StyleConstants.setBackground(style,Color.white);
StyleConstants.setForeground(style,Color.red);
StyleConstants.setItalic(style, true);
StyleConstants.setBold(style, false);
StyleConstants.setFontSize(style,12);
//remote method called by server
public void addClient(String alias,String group,JTree tree)
//if old client remove old tree
if(!alias.equals(""))
cp.remove(this.jsp);
//add new tree
this.tree=tree;
setTreeModel();
getSound(2);
if(!alias.equals(""))
textArea2.append("\nNew Client:" + alias + "has joined");
else
textArea2.append("\nYou have been connected to the Server.");
jsp=new JScrollPane(this.tree);
jsp.setBounds(12,96,168,120);
jsp.setBackground(java.awt.Color.lightGray);
cp.add(jsp);
this.tree.addMouseListener(new MouseHandler());
//remote method called by server
public void sendMessage(String str,Hashtable rfiles,String alias,String group) throws RemoteException
receiveMessage(str,rfiles,alias,group);
//remote method called by server
public void removeClient(JTree tree,String alias,String group) throws RemoteException
cp.remove(this.jsp);
this.tree=tree;
setTreeModel();
getSound(3);
jsp=new JScrollPane(this.tree);
jsp.setBounds(12,96,168,120);
jsp.setBackground(java.awt.Color.lightGray);
cp.add(jsp);
this.tree.addMouseListener(new MouseHandler());
textArea2.append("\nClient:" + alias + "has disconnected");
private void receiveMessage(String str,Hashtable rfiles,String alias,String group)
boolean flag=true;
UIManager.put("JFrame.activeTitleBackground", new Color(64,128,255));
UIManager.put("JFrame.activeTitleForeground", Color.white);
UIManager.put("JFrame.inactiveTitleBackground", new Color(128,128,128));
UIManager.put("JFrame.inactiveTitleForeground", Color.black);
SwingUtilities.updateComponentTreeUI(this);
try{
if(alias.equals(""))
doc.insertString(doc.getLength(),"CHATMASTER>>",textpanel.getStyle("bold"));
doc.insertString(doc.getLength(),str+ newline,textpanel.getStyle("normal"));
else
doc.insertString(doc.getLength(),alias + "@" + group + ">>",textpanel.getStyle("bold"));
doc.insertString(doc.getLength(),str,textpanel.getStyle("normal"));
//add files to textpanel
if(rfiles!=null && rfiles.size()>0)
doc.insertString(doc.getLength(),newline+"Attachments>>",textpanel.getStyle("attach"));
showattach(rfiles);
addtoList(rfiles);
doc.insertString(doc.getLength(),newline,textpanel.getStyle("normal"));
catch(Exception e)
e.printStackTrace();
dialog.showMessageDialog(client,e.toString(),"Error:ChatApplication",JOptionPane.ERROR_MESSAGE);
cp.repaint();
protected boolean ContactServer(String alias,String servername,String group)
try{
//UnicastRemoteObject.exportObject(this);
//server=(ServerInterface)Naming.lookup("//gpt02d05:5500/" + servername);
// server.notifyMe(this,alias,group);
//change the settings of buttons
button1.setEnabled(true);
button2.setEnabled(true);
button3.setLabel("Disconnect");
label8.setVisible(true);
label8.setText(" Welcome::" + alias);
//putting values of alias and group for sending messages
fromalias=alias;
fromgroup=group;
CONNECT=true;
return true;
catch(UnsupportedOperationException e)
dialog.showMessageDialog(client,"Client with the Same Alias in " + group + " already exists","Error:ChatApplication",JOptionPane.ERROR_MESSAGE);
try{
// UnicastRemoteObject.unexportObject(client,true);
catch(Exception ev){System.out.println(ev.toString());}
catch(Exception e)
dialog.showMessageDialog(client,"Unable to connect to Server","Error:ChatApplication",JOptionPane.ERROR_MESSAGE);
try{
// UnicastRemoteObject.unexportObject(client,true);
catch(Exception ev){System.out.println(ev.toString());}
return false;
public static void main(String args[]) throws RemoteException{
client=new Client();
}//main ends
public void getSound(int count)
Toolkit t1=getToolkit();
for(int i=0;i<count;i++)
t1.beep();
try{
Thread.sleep(500);
catch(Exception e){}
public void setTreeModel()
ImageIcon i1=new ImageIcon("Lock.gif","No Users");
ImageIcon i2=new ImageIcon("Connec.gif","Users in Group");
ImageIcon i3=new ImageIcon("authorbn.gif","An User");
DefaultTreeCellRenderer dr1= new DefaultTreeCellRenderer();
dr1.setClosedIcon(i1);
dr1.setOpenIcon(i2);
dr1.setLeafIcon(i3);
dr1.setTextSelectionColor(java.awt.Color.red);
tree.setCellRenderer(dr1);
//add received files to the list
private void addtoList(Hashtable rfiles)
Enumeration filelist=rfiles.keys();
while(filelist.hasMoreElements())
File file=(File)filelist.nextElement();
this.rfiles.put(file,rfiles.get(file));
//show the attachments received
private void showattach(Hashtable rfiles)
Enumeration filelist=rfiles.keys();
dsource=DragSource.getDefaultDragSource();
JButton b1=null;
while(filelist.hasMoreElements())
File file=(File)filelist.nextElement();
Icon icon=chooser.getIcon(file);
b1=new JButton(icon);
b1.setBackground(java.awt.Color.gray);
b1.setToolTipText(file.getName());
b1.addMouseListener(new AttachmentHandler());
Dimension d1=new Dimension(icon.getIconWidth(),icon.getIconHeight());
b1.setMaximumSize(d1);
hfiles.put(b1,file);
textpanel.setCaretPosition(doc.getLength());
textpanel.insertComponent(b1);
b1.setSize(icon.getIconWidth(),icon.getIconHeight());
dsource.createDefaultDragGestureRecognizer(b1, DnDConstants.ACTION_COPY_OR_MOVE,new DragGestureHandler());
cp.repaint();
private void savefile(File file,Object parent)
//ExtensionFileFilter filter = new ExtensionFileFilter(false);
//filter.addExtension("txt",true);
//chooser.setFileFilter(filter);
int returnVal = chooser.showSaveDialog(client);
if(returnVal ==JFileChooser.APPROVE_OPTION)
try{
FileOutputStream fstream=new FileOutputStream(chooser.getSelectedFile());
//decide whether the file received or sent is to be saved
if(((Container)parent).equals(textArea1))
fstream.write((byte[])files.get(file));
else
fstream.write((byte[])rfiles.get(file));
fstream.close();
System.out.println(file.getName());
catch(Exception e)
{System.out.println(e.toString()); }
private void openfile(File file,Object parent)
File tempfile=null;
try{
String fname=file.getName();
tempfile=File.createTempFile("temp",fname.substring(fname.lastIndexOf(".")));
FileOutputStream fstream=new FileOutputStream(tempfile);
System.out.println(tempfile.getAbsolutePath());
//decide whether the file received or sent is to be saved
if(((Container)parent).equals(textArea1))
fstream.write((byte[])files.get(file));
else
fstream.write((byte[])rfiles.get(file));
fstream.close();
catch(Exception e){System.out.println(e.toString());}
try{
Process p1=r1.exec("cmd /c start " + tempfile.getAbsolutePath());
p1.waitFor();
catch(Exception e){System.out.println(e.toString());}
//inner classes
class ComponentHandler implements ContainerListener{
public void componentRemoved(ContainerEvent ev)
Container cont=(Container)ev.getChild();
if(cont.getComponentCount()>0)
JButton but=(JButton)cont.getComponent(0);
files.remove((File)hfiles.get(but));
hfiles.remove(but);
public void componentAdded(ContainerEvent ev){}
class AttachmentHandler extends MouseAdapter{
public void mouseClicked(MouseEvent ev){
if(ev.getModifiers()==4)
Component comp=(Component)ev.getSource();
File file=(File)hfiles.get(comp);
popup=new JPopupMenu();
JMenuItem popopen=new JMenuItem("Open");
JMenuItem popsave=new JMenuItem("Save As..");
popup.add(popopen);
System.out.println(comp.getParent().getParent().getClass().toString());
popopen.addActionListener(new ButtonHandler(file,comp.getParent().getParent()));
popup.add(popsave);
popsave.addActionListener(new ButtonHandler(file,comp.getParent().getParent()));
popup.show(comp,12,12);
class DragGestureHandler extends Vector implements DragGestureListener,DragSourceListener,Transferable{
final static int FILE = 0;
final static int STRING = 1;
final static int PLAIN = 2;
DataFlavor flavors[] = {DataFlavor.javaFileListFlavor,DataFlavor.stringFlavor,DataFlavor.plainTextFlavor};
public void dragDropEnd(DragSourceDropEvent ev){}
public void dragEnter(DragSourceDragEvent ev){}
public void dragExit(DragSourceEvent ev){}
public void dragOver(DragSourceDragEvent ev){}
public void dropActionChanged(DragSourceDragEvent ev){}
public void dragGestureRecognized(DragGestureEvent ev)
System.out.println("recognized");
File file=(File)hfiles.get(ev.getComponent());
addElement(file);
ev.startDrag(DragSource.DefaultCopyDrop,this,this);
/* Returns the array of flavors in which it can provide the data. */
public synchronized DataFlavor[] getTransferDataFlavors() {
return flavors;
/* Returns whether the requested flavor is supported by this object. */
public boolean isDataFlavorSupported(DataFlavor flavor) {
boolean b = false;
b |=flavor.equals(flavors[FILE]);
b |= flavor.equals(flavors[STRING]);
b |= flavor.equals(flavors[PLAIN]);
return (b);
public synchronized Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException,IOException
if(flavor.equals(flavors[FILE])){return this;}
else if (flavor.equals(flavors[PLAIN])) {
return new StringReader(((File)elementAt(0)).getAbsolutePath());
} else if (flavor.equals(flavors[STRING])) {
return((File)elementAt(0)).getAbsolutePath();
} else {
throw new UnsupportedFlavorException(flavor);
//inner class for draging in the files on java frame
class DragDropHandler implements DropTargetListener{
public void dragEnter(DropTargetDragEvent ev){
public void dragExit(DropTargetEvent ev){
public void dragOver(DropTargetDragEvent ev){
public void drop(DropTargetDropEvent ev){
Transferable tf1=ev.getTransferable();
DataFlavor fl[]=ev.getCurrentDataFlavors();
if(ev.isDataFlavorSupported(DataFlavor.javaFileListFlavor))
ev.acceptDrop (DnDConstants.ACTION_COPY_OR_MOVE);
try{
java.util.List fileList = (java.util.List)tf1.getTransferData(DataFlavor.javaFileListFlavor);
Iterator iterator = fileList.iterator();
while (iterator.hasNext())
File file = (File)iterator.next();
if(file.isFile())
Icon icon=chooser.getIcon(file);
FileInputStream fstream=new FileInputStream(file);
int filedata=(new Double(file.length())).intValue();
byte bytes[]=new byte[filedata];
fstream.read(bytes);
files.put(file,bytes);
ev.getDropTargetContext().dropComplete(true);
addAttach(fileList);
catch(Exception e)
{System.out.println(e.toString() + "here");}
public void dropActionChanged(DropTargetDragEvent ev){
class MouseHandler extends MouseAdapter{
public void mouseClicked(MouseEvent me)
TreePath tp=tree.getPathForLocation(me.getX(),me.getY());
if(tp!=null)
if(tp.getPathCount()==3)
toalias=tp.getPathComponent(2).toString();
togroup=tp.getPathComponent(1).toString();
System.out.println(toalias);
if (!(toalias.equals(fromalias) && togroup.equals(fromgroup)))
System.out.println("hh " + toalias);
label4.setText(tp.getPathComponent(2).toString() + "_@" + tp.getPathComponent(1).toString());
class ButtonHandler implements ActionListener{
private File file;
private Object parent;
//constructors
public ButtonHandler()
public ButtonHandler(File file,Object parent)
this.file=file;
this.parent=parent;
//other functions
public void actionPerformed(ActionEvent ev){
String s=ev.getActionCommand();
System.out.println(s);
if(s.equals("Send with Audio..."))
//Audio audio=new Audio(client,false,"CAPTURE");
if(s.equals("Disconnect"))
try{
// server.disconnect(client);
client.getSound(3);
cp.remove(jsp);
label6.setVisible(false);
//UnicastRemoteObject.unexportObject(client,true);
button3.setLabel("Connect");
textArea2.append("\nYou have been disconnected to Server");
client.repaint();
catch(Exception e)
System.out.println(e.toString());
if(s.equals("Connect"))
// clp=new ClientProperties(client,false);
if(s.equals("Save As.."))
savefile(file,parent);
if(s.equals("Open"))
openfile(file,parent);
if(s.equals("Attach"))
//ExtensionFileFilter filter = new ExtensionFileFilter(false);
//filter.addExtension(".txt",true);
//filter.setDescription("Text Files(.txt)");
// chooser.setFileFilter(filter);
chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
//chooser.setMultiSelectionEnabled(true);
int returnVal = chooser.showOpenDialog(client);
if(returnVal ==JFileChooser.APPROVE_OPTION)
//File fp[]=chooser.getSelectedFiles();
File fp[]=new File[1];
fp[0]=chooser.getSelectedFile();
int i=0;
while(i<fp.length)
try{
File file=fp;
Icon icon=chooser.getIcon(file);
FileInputStream fstream=new FileInputStream(file);
int filedata=(new Double(file.length())).intValue();
byte bytes[]=new byte[filedata];
fstream.read(bytes);
files.put(file,bytes);
catch(Exception e){dialog.showMessageDialog(client,e.toString(),"Error:ChatApplication",JOptionPane.ERROR_MESSAGE);
return; }
i++;
java.util.List fileList=Arrays.asList(fp);
addAttach(fileList);
if(s.equals("Send"))
try{
if(toalias==null)
dialog.showMessageDialog(client,"Select the Recepient First!!","Error:ChatApplication",JOptionPane.ERROR_MESSAGE);
return;
if(toalias!=null && togroup!=null && (!toalias.equals(fromalias)))
// server.sendMessage(textArea1.getText(),files,toalias,togroup,fromalias,fromgroup);
textArea1.setText("");
catch(Exception e)
e.printStackTrace();
}//if ends
class WindowEventHandler extends WindowAdapter{
public void windowClosing(WindowEvent ev){
try{
//server.disconnect(client);
client.getSound(3);
// UnicastRemoteObject.unexportObject(client,true);
catch(Exception e){System.out.println(e.toString());}
dispose();
private class onshutdown extends Thread{
public void run(){
try{
//server.disconnect(client);
//UnicastRemoteObject.unexportObject(client,true);
catch(Exception e){}
}//run endsHere is the working code :
There was an error line 724
File file=fp; -> File file=fp[0];
Several method were deprecated and try to replace the deprecated static field : DataFlavor.plainTextFlavor which was deprecated since 1.4.
/* Client.java*/
import java.util.*;
import java.awt.*;
import java.awt.event.*;
import java.rmi.*;
import java.rmi.server.*;
import javax.swing.*;
import javax.swing.tree.*;
import javax.swing.filechooser.*;
import java.io.*;
import java.awt.dnd.*;
import java.awt.datatransfer.*;
import javax.swing.plaf.*;
import javax.swing.plaf.basic.*;
import javax.swing.text.*;
import javax.swing.event.*;
public class Client extends JFrame{
static String newline = System.getProperty("line.separator");
static Client client;
//ServerInterface server;
//ClientProperties clp;
Vector v1=new Vector();
ByteArrayOutputStream out;
Runtime r1;
//file objects,together with array of bytes
Hashtable files=new Hashtable(); //files sent
Hashtable rfiles=new Hashtable(); //files received
//file objects,together with button handlers
Hashtable hfiles=new Hashtable(); //files sent,files received
JButton button1=new JButton();
JButton button2=new JButton();
JButton button3=new JButton();
JLabel label1=new JLabel();
JLabel label2=new JLabel();
JLabel label3=new JLabel();
JLabel label4=new JLabel();
JLabel label5=new JLabel();
JLabel label6=new JLabel();
JLabel label7=new JLabel();
JLabel label8=new JLabel();
JOptionPane dialog=new JOptionPane();
JFileChooser chooser = new JFileChooser();
JPanel panel1;
JPanel panel2;
DropTarget dtarget;
DragSource dsource;
JTextPane textArea1=new JTextPane();
TextArea textArea2=new TextArea();
JTextPane textpanel=new JTextPane();
Style defstyle,style;
StyledDocument doc,doc1;
JPopupMenu popup;
JTree tree;
JScrollPane jsppane;
JScrollPane jsp,jsp2;
DefaultMutableTreeNode top;
Container cp;
private String toalias;
private String togroup;
private String fromalias;
private String fromgroup;
private boolean CONNECT;
public Client()
cp=getContentPane();
cp.setLayout(null);
setForeground(java.awt.Color.red);
setFont(new Font("Dialog", Font.PLAIN, 14));
setVisible(false);
label1.setText(" CHAT APPLICATION");
cp.add(label1);
label1.setFont(new Font("Dialog", Font.BOLD, 16));
label1.setBounds(72,20,319,30);
label2.setText("List of Users Connected.");
cp.add(label2);
label2.setForeground(java.awt.Color.blue);
label2.setFont(new Font("Dialog", Font.BOLD, 12));
label2.setBounds(24,60,192,26);
label8.setBounds(280,60,100,26);
cp.add(label8);
cp.add(textArea2);
textArea2.setBounds(204,120,268,90);
jsppane=new JScrollPane(textArea1);
doc1=textArea1.getStyledDocument();
jsppane.setBounds(12,264,456,109);
cp.add(jsppane);
label3.setText("TO::");
cp.add(label3);
label3.setFont(new Font("Dialog", Font.BOLD, 12));
label3.setBounds(12,228,36,20);
cp.add(label4);
label4.setBackground(java.awt.Color.lightGray);
label4.setBounds(60,228,172,19);
label5.setText("SERVER RESPONSE");
cp.add(label5);
label5.setFont(new Font("Dialog", Font.BOLD, 12));
label5.setBounds(204,96,204,21);
label7.setText("MESSAGE FOR YOU.");
cp.add(label7);
label7.setFont(new Font("Dialog", Font.BOLD, 14));
label7.setBounds(12,371,288,25);
jsp2=new JScrollPane(textpanel);
setTextPaneStyle();
jsp2.setBounds(12,401,456,109);
cp.add(jsp2);
button1.setText("Send");
button1.setEnabled(false);
cp.add(button1);
button1.setBackground(java.awt.Color.lightGray);
button1.setForeground(java.awt.Color.black);
button1.setFont(new Font("Dialog", Font.BOLD|Font.ITALIC, 10));
button1.setBounds(60,520,78,36);
button2.setText("Attach");
//button2.setEnabled(false);
cp.add(button2);
button2.setBackground(java.awt.Color.lightGray);
button2.setForeground(java.awt.Color.black);
button2.setFont(new Font("Dialog", Font.BOLD|Font.ITALIC, 10));
button2.setBounds(180,520,72,36);
button3.setText("Connect");
cp.add(button3);
button3.setBackground(java.awt.Color.lightGray);
button3.setForeground(java.awt.Color.black);
button3.setFont(new Font("Dialog", Font.BOLD|Font.ITALIC, 10));
button3.setBounds(288,520,72,33);
setSize(500,620);
show();
addWindowListener(new WindowEventHandler());
button1.addActionListener(new ButtonHandler());
button2.addActionListener(new ButtonHandler());
button3.addActionListener(new ButtonHandler());
textArea1.addContainerListener(new ComponentHandler());
dtarget=new DropTarget(textArea1,new DragDropHandler());
textArea2.setEnabled(false);
textpanel.setEnabled(false);
r1=Runtime.getRuntime();
r1.addShutdownHook(new onshutdown());
addMenu();
cp.repaint();
//adds attachments to the textArea1
synchronized private void addAttach(java.util.List fileList)
Iterator iterator=fileList.iterator();
JButton bw;
while(iterator.hasNext())
File file=(File)iterator.next();
Icon icon=chooser.getIcon(file);
bw=new JButton(icon);
bw.setBackground(java.awt.Color.gray);
bw.setToolTipText(file.getAbsolutePath());
bw.addMouseListener(new AttachmentHandler());
Dimension d1=new Dimension(icon.getIconWidth(),icon.getIconHeight());
bw.setMaximumSize(d1);
hfiles.put(bw,file);
textArea1.insertComponent(bw);
textArea1.setCaretPosition(doc1.getLength());
bw.setSize(icon.getIconWidth(),icon.getIconHeight());
//only one file at a time
break;
cp.repaint();
public void setAudioStream(ByteArrayOutputStream out)
this.out=out;
private void addMenu()
JMenuBar mbar=new JMenuBar();
mbar.setVisible(true);
mbar.setBounds(0,0,500,20);
mbar.setBackground(java.awt.Color.gray);
//first menu
JMenu m1=new JMenu("Connection");
m1.setBounds(0,0,80,20);
m1.setBackground(java.awt.Color.gray);
JMenuItem mitem1=new JMenuItem("Connect");
JMenuItem mitem2=new JMenuItem("Disconnect");
m1.add(mitem1);
m1.add(mitem2);
mitem1.addActionListener(new ButtonHandler());
mitem2.addActionListener(new ButtonHandler());
mbar.add(m1);
//second menu
JMenu m2=new JMenu("Send...");
m2.setBounds(90,0,80,20);
m2.setBackground(java.awt.Color.gray);
JMenuItem mitem3=new JMenuItem("Send");
JMenuItem mitem4=new JMenuItem("Send with Audio...");
mitem3.addActionListener(new ButtonHandler());
mitem4.addActionListener(new ButtonHandler());
m2.add(mitem3);
m2.add(mitem4);
mbar.add(m2);
cp.add(mbar);
private void setTextPaneStyle()
StyleContext stylecontext =StyleContext.getDefaultStyleContext();
defstyle=stylecontext.getStyle(StyleContext.DEFAULT_STYLE);
doc= textpanel.getStyledDocument();
//style 1
style= textpanel.addStyle("bold",defstyle);
StyleConstants.setBackground(style,Color.white);
StyleConstants.setForeground(style,Color.blue);
StyleConstants.setItalic(style, false);
StyleConstants.setBold(style, true);
StyleConstants.setFontSize(style,16);
//style 2
style= textpanel.addStyle("normal",defstyle);
StyleConstants.setBackground(style,Color.white);
StyleConstants.setForeground(style,Color.black);
StyleConstants.setItalic(style, false);
StyleConstants.setBold(style, false);
StyleConstants.setFontSize(style,14);
//style3
style= textpanel.addStyle("attach",defstyle);
StyleConstants.setBackground(style,Color.white);
StyleConstants.setForeground(style,Color.red);
StyleConstants.setItalic(style, true);
StyleConstants.setBold(style, false);
StyleConstants.setFontSize(style,12);
//remote method called by server
public void addClient(String alias,String group,JTree tree)
//if old client remove old tree
if(!alias.equals(""))
cp.remove(this.jsp);
//add new tree
this.tree=tree;
setTreeModel();
getSound(2);
if(!alias.equals(""))
textArea2.append("\nNew Client:" + alias + "has joined");
else
textArea2.append("\nYou have been connected to the Server.");
jsp=new JScrollPane(this.tree);
jsp.setBounds(12,96,168,120);
jsp.setBackground(java.awt.Color.lightGray);
cp.add(jsp);
this.tree.addMouseListener(new MouseHandler());
//remote method called by server
public void sendMessage(String str,Hashtable rfiles,String alias,String group) throws RemoteException
receiveMessage(str,rfiles,alias,group);
//remote method called by server
public void removeClient(JTree tree,String alias,String group) throws RemoteException
cp.remove(this.jsp);
this.tree=tree;
setTreeModel();
getSound(3);
jsp=new JScrollPane(this.tree);
jsp.setBounds(12,96,168,120);
jsp.setBackground(java.awt.Color.lightGray);
cp.add(jsp);
this.tree.addMouseListener(new MouseHandler());
textArea2.append("\nClient:" + alias + "has disconnected");
private void receiveMessage(String str,Hashtable rfiles,String alias,String group)
boolean flag=true;
UIManager.put("JFrame.activeTitleBackground", new Color(64,128,255));
UIManager.put("JFrame.activeTitleForeground", Color.white);
UIManager.put("JFrame.inactiveTitleBackground", new Color(128,128,128));
UIManager.put("JFrame.inactiveTitleForeground", Color.black);
SwingUtilities.updateComponentTreeUI(this);
try{
if(alias.equals(""))
doc.insertString(doc.getLength(),"CHATMASTER>>",textpanel.getStyle("bold"));
doc.insertString(doc.getLength(),str+ newline,textpanel.getStyle("normal"));
else
doc.insertString(doc.getLength(),alias + "@" + group + ">>",textpanel.getStyle("bold"));
doc.insertString(doc.getLength(),str,textpanel.getStyle("normal"));
//add files to textpanel
if(rfiles!=null && rfiles.size()>0)
doc.insertString(doc.getLength(),newline+"Attachments>>",textpanel.getStyle("attach"));
showattach(rfiles);
addtoList(rfiles);
doc.insertString(doc.getLength(),newline,textpanel.getStyle("normal"));
catch(Exception e)
e.printStackTrace();
dialog.showMessageDialog(client,e.toString(),"Error:ChatApplication",JOptionPane.ERROR_MESSAGE);
cp.repaint();
protected boolean ContactServer(String alias,String servername,String group)
try{
//UnicastRemoteObject.exportObject(this);
//server=(ServerInterface)Naming.lookup("//gpt02d05:5500/" + servername);
// server.notifyMe(this,alias,group);
//change the settings of buttons
button1.setEnabled(true);
button2.setEnabled(true);
button3.setText("Disconnect");
label8.setVisible(true);
label8.setText(" Welcome::" + alias);
//putting values of alias and group for sending messages
fromalias=alias;
fromgroup=group;
CONNECT=true;
return true;
catch(UnsupportedOperationException e)
dialog.showMessageDialog(client,"Client with the Same Alias in " + group + " already exists","Error:ChatApplication",JOptionPane.ERROR_MESSAGE);
try{
// UnicastRemoteObject.unexportObject(client,true);
catch(Exception ev){System.out.println(ev.toString());}
catch(Exception e)
dialog.showMessageDialog(client,"Unable to connect to Server","Error:ChatApplication",JOptionPane.ERROR_MESSAGE);
try{
// UnicastRemoteObject.unexportObject(client,true);
catch(Exception ev){System.out.println(ev.toString());}
return false;
public static void main(String args[]) throws RemoteException{
client=new Client();
}//main ends
public void getSound(int count)
Toolkit t1=getToolkit();
for(int i=0;i<count;i++)
t1.beep();
try{
Thread.sleep(500);
catch(Exception e){}
public void setTreeModel()
ImageIcon i1=new ImageIcon("Lock.gif","No Users");
ImageIcon i2=new ImageIcon("Connec.gif","Users in Group");
ImageIcon i3=new ImageIcon("authorbn.gif","An User");
DefaultTreeCellRenderer dr1= new DefaultTreeCellRenderer();
dr1.setClosedIcon(i1);
dr1.setOpenIcon(i2);
dr1.setLeafIcon(i3);
dr1.setTextSelectionColor(java.awt.Color.red);
tree.setCellRenderer(dr1);
//add received files to the list
private void addtoList(Hashtable rfiles)
Enumeration filelist=rfiles.keys();
while(filelist.hasMoreElements())
File file=(File)filelist.nextElement();
this.rfiles.put(file,rfiles.get(file));
//show the attachments received
private void showattach(Hashtable rfiles)
Enumeration filelist=rfiles.keys();
dsource=DragSource.getDefaultDragSource();
JButton b1=null;
while(filelist.hasMoreElements())
File file=(File)filelist.nextElement();
Icon icon=chooser.getIcon(file);
b1=new JButton(icon);
b1.setBackground(java.awt.Color.gray);
b1.setToolTipText(file.getName());
b1.addMouseListener(new AttachmentHandler());
Dimension d1=new Dimension(icon.getIconWidth(),icon.getIconHeight());
b1.setMaximumSize(d1);
hfiles.put(b1,file);
textpanel.setCaretPosition(doc.getLength());
textpanel.insertComponent(b1);
b1.setSize(icon.getIconWidth(),icon.getIconHeight());
dsource.createDefaultDragGestureRecognizer(b1, DnDConstants.ACTION_COPY_OR_MOVE,new DragGestureHandler());
cp.repaint();
private void savefile(File file,Object parent)
//ExtensionFileFilter filter = new ExtensionFileFilter(false);
//filter.addExtension("txt",true);
//chooser.setFileFilter(filter);
int returnVal = chooser.showSaveDialog(client);
if(returnVal ==JFileChooser.APPROVE_OPTION)
try{
FileOutputStream fstream=new FileOutputStream(chooser.getSelectedFile());
//decide whether the file received or sent is to be saved
if(((Container)parent).equals(textArea1))
fstream.write((byte[])files.get(file));
else
fstream.write((byte[])rfiles.get(file));
fstream.close();
System.out.println(file.getName());
catch(Exception e)
{System.out.println(e.toString()); }
private void openfile(File file,Object parent)
File tempfile=null;
try{
String fname=file.getName();
tempfile=File.createTempFile("temp",fname.substring(fname.lastIndexOf(".")));
FileOutputStream fstream=new FileOutputStream(tempfile);
System.out.println(tempfile.getAbsolutePath());
//decide whether the file received or sent is to be saved
if(((Container)parent).equals(textArea1))
fstream.write((byte[])files.get(file));
else
fstream.write((byte[])rfiles.get(file));
fstream.close();
catch(Exception e){System.out.println(e.toString());}
try{
Process p1=r1.exec("cmd /c start " + tempfile.getAbsolutePath());
p1.waitFor();
catch(Exception e){System.out.println(e.toString());}
//inner classes
class ComponentHandler implements ContainerListener{
public void componentRemoved(ContainerEvent ev)
Container cont=(Container)ev.getChild();
if(cont.getComponentCount()>0)
JButton but=(JButton)cont.getComponent(0);
files.remove((File)hfiles.get(but));
hfiles.remove(but);
public void componentAdded(ContainerEvent ev){}
class AttachmentHandler extends MouseAdapter{
public void mouseClicked(MouseEvent ev){
if(ev.getModifiers()==4)
Component comp=(Component)ev.getSource();
File file=(File)hfiles.get(comp);
popup=new JPopupMenu();
JMenuItem popopen=new JMenuItem("Open");
JMenuItem popsave=new JMenuItem("Save As..");
popup.add(popopen);
System.out.println(comp.getParent().getParent().getClass().toString());
popopen.addActionListener(new ButtonHandler(file,comp.getParent().getParent()));
popup.add(popsave);
popsave.addActionListener(new ButtonHandler(file,comp.getParent().getParent()));
popup.show(comp,12,12);
class DragGestureHandler extends Vector implements DragGestureListener,DragSourceListener,Transferable{
final static int FILE = 0;
final static int STRING = 1;
final static int PLAIN = 2;
DataFlavor flavors[] = {DataFlavor.javaFileListFlavor,DataFlavor.stringFlavor,DataFlavor.plainTextFlavor};
public void dragDropEnd(DragSourceDropEvent ev){}
public void dragEnter(DragSourceDragEvent ev){}
public void dragExit(DragSourceEvent ev){}
public void dragOver(DragSourceDragEvent ev){}
public void dropActionChanged(DragSourceDragEvent ev){}
public void dragGestureRecognized(DragGestureEvent ev)
System.out.println("recognized");
File file=(File)hfiles.get(ev.getComponent());
addElement(file);
ev.startDrag(DragSource.DefaultCopyDrop,this,this);
/* Returns the array of flavors in which it can provide the data. */
public synchronized DataFlavor[] getTransferDataFlavors() {
return flavors;
/* Returns whether the requested flavor is supported by this object. */
public boolean isDataFlavorSupported(DataFlavor flavor) {
boolean b = false;
b |=flavor.equals(flavors[FILE]);
b |= flavor.equals(flavors[STRING]);
b |= flavor.equals(flavors[PLAIN]);
return (b);
public synchronized Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException,IOException
if(flavor.equals(flavors[FILE])){return this;}
else if (flavor.equals(flavors[PLAIN])) {
return new StringReader(((File)elementAt(0)).getAbsolutePath());
} else if (flavor.equals(flavors[STRING])) {
return((File)elementAt(0)).getAbsolutePath();
} else {
throw new UnsupportedFlavorException(flavor);
//inner class for draging in the files on java frame
class DragDropHandler implements DropTargetListener{
public void dragEnter(DropTargetDragEvent ev){
public void dragExit(DropTargetEvent ev){
public void dragOver(DropTargetDragEvent ev){
public void drop(DropTargetDropEvent ev){
Transferable tf1=ev.getTransferable();
DataFlavor fl[]=ev.getCurrentDataFlavors();
if(ev.isDataFlavorSupported(DataFlavor.javaFileListFlavor))
ev.acceptDrop (DnDConstants.ACTION_COPY_OR_MOVE);
try{
java.util.List fileList = (java.util.List)tf1.getTransferData(DataFlavor.javaFileListFlavor);
Iterator iterator = fileList.iterator();
while (iterator.hasNext())
File file = (File)iterator.next();
if(file.isFile())
Icon icon=chooser.getIcon(file);
FileInputStream fstream=new FileInputStream(file);
int filedata=(new Double(file.length())).intValue();
byte bytes[]=new byte[filedata];
fstream.read(bytes);
files.put(file,bytes);
ev.getDropTargetContext().dropComplete(true);
addAttach(fileList);
catch(Exception e)
{System.out.println(e.toString() + "here");}
public void dropActionChanged(DropTargetDragEvent ev){
class MouseHandler extends MouseAdapter{
public void mouseClicked(MouseEvent me)
TreePath tp=tree.getPathForLocation(me.getX(),me.getY());
if(tp!=null)
if(tp.getPathCount()==3)
toalias=tp.getPathComponent(2).toString();
togroup=tp.getPathComponent(1).toString();
System.out.println(toalias);
if (!(toalias.equals(fromalias) && togroup.equals(fromgroup)))
System.out.println("hh " + toalias);
label4.setText(tp.getPathComponent(2).toString() + "_@" + tp.getPathComponent(1).toString());
class ButtonHandler implements ActionListener{
private File file;
private Object parent;
//constructors
public ButtonHandler()
public ButtonHandler(File file,Object parent)
this.file=file;
this.parent=parent;
//other functions
public void actionPerformed(ActionEvent ev){
String s=ev.getActionCommand();
System.out.println(s);
if(s.equals("Send with Audio..."))
//Audio audio=new Audio(client,false,"CAPTURE");
if(s.equals("Disconnect"))
try{
// server.disconnect(client);
client.getSound(3);
cp.remove(jsp);
label6.setVisible(false);
//UnicastRemoteObject.unexportObject(client,true);
button3.setText("Connect");
textArea2.append("\nYou have been disconnected to Server");
client.repaint();
catch(Exception e)
System.out.println(e.toString());
if(s.equals("Connect"))
// clp=new ClientProperties(client,false);
if(s.equals("Save As.."))
savefile(file,parent);
if(s.equals("Open"))
openfile(file,parent);
if(s.equals("Attach"))
//ExtensionFileFilter filter = new ExtensionFileFilter(false);
//filter.addExtension(".txt",true);
//filter.setDescription("Text Files(.txt)");
// chooser.setFileFilter(filter);
chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
//chooser.setMultiSelectionEnabled(true);
int returnVal = chooser.showOpenDialog(client);
if(returnVal ==JFileChooser.APPROVE_OPTION)
//File fp[]=chooser.getSelectedFiles();
File fp[]=new File[1];
fp[0]=chooser.getSelectedFile();
int i=0;
while(i<fp.length)
try{
File file=fp[0];
Icon icon=chooser.getIcon(file);
FileInputStream fstream=new FileInputStream(file);
int filedata=(new Double(file.length())).intValue();
byte bytes[]=new byte[filedata];
fstream.read(bytes);
files.put(file,bytes);
catch(Exception e){dialog.showMessageDialog(client,e.toString(),"Error:ChatApplication",JOptionPane.ERROR_MESSAGE);
return; }
i++;
java.util.List fileList=Arrays.asList(fp);
addAttach(fileList);
if(s.equals("Send"))
try{
if(toalias==null)
dialog.showMessageDialog(client,"Select the Recepient First!!","Error:ChatApplication",JOptionPane.ERROR_MESSAGE);
return;
if(toalias!=null && togroup!=null && (!toalias.equals(fromalias)))
// server.sendMessage(textArea1.getText(),files,toalias,togroup,fromalias,fromgroup);
textArea1.setText("");
catch(Exception e)
e.printStackTrace();
}//if ends
class WindowEventHandler extends WindowAdapter{
public void windowClosing(WindowEvent ev){
try{
//server.disconnect(client);
client.getSound(3);
// UnicastRemoteObject.unexportObject(client,true);
catch(Exception e){System.out.println(e.toString());}
dispose();
private class onshutdown extends Thread{
public void run(){
try{
//server.disconnect(client);
//UnicastRemoteObject.unexportObject(client,true);
catch(Exception e){}
}//run ends
I hope this helps,
Denis -
Problems compiling Zaptel package [SOLVED-ISH]
Hey guys, I'm on an Arch64 system and I'm having problems compiling Zaptel (a dependancy for Asterisk).
Here's the pastebin of the errors I get from the Zaptel makefile: http://pastebin.com/776475
Here's my analysis so far:
There's a line in the Makefile for the zaptel driver that goes like this:
make -C /lib/modules/2.6.17-ARCH/build/ SUBDIRS=/home/woogie/zaptel/src/zaptel-1.2.8 modules
This line activates the kernel's makefile in order to build modules, but specifies that the source directory for zaptel should be included in the make process.
Then things go down the proverbial drain - linux/err_kernel_only.h gets included in the build process, which is designed to do one thing only - stop the build process. So I'm not entirely too sure what's going on here. Is there something misconfigured on my system, or is the Zaptel build system flawed somehow, such that I need to compensate for it?Further information:
I've manually run the problematic make command from /lib/modules/2.6.17-ARCH/build on my own. After reading the kernel makefile documentation, I've learned of the V=1 flag to show me exactly what's going on. The failing command is this one:
gcc -Wp,-MD,/home/cestus/zaptel/src/zaptel-1.2.8/.zaptel.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-unknown-linux-gnu/4.1.1/include -D__
KERNEL__ -Iinclude -include include/linux/autoconf.h -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -O2
-fomit-frame-pointer -m64 -mno-red-zone -mcmodel=kernel -pipe -fno-reorder-blocks -Wno-sign-compare -fno-asynchronous-unwind-tables -fun
it-at-a-time -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -Wdeclaration-after-statement -Wno-pointer-sign -I. -Iinclude -O4 -g -Wall -DBUILDING_T
ONEZONE -m64 -DSTANDALONE_ZAPATA -DZAPTEL_CONFIG="/etc/zaptel.conf" -DHOTPLUG_FIRMWARE -I/home/cestus/zaptel/src/zaptel-1.2.8//include
-I/home/cestus/zaptel/src/zaptel-1.2.8//include/oct6100api -DMODULE -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(zaptel)" -D"KBUIL
D_MODNAME=KBUILD_STR(zaptel)" -c -o /home/cestus/zaptel/src/zaptel-1.2.8/zaptel.o /home/cestus/zaptel/src/zaptel-1.2.8/zaptel.c
I've figured out that the bit which causes the failure is "-include include/linux/autoconf.h", because autoconf.h just includes the "err_kernel_only" header automatically, which then slays the build process. And I've also discovered that the Zaptel devs are uber-leet. They've found the magical -O4 level in gcc. You know, the one above 3, where the supported optimization levels in gcc are -O, -Os, -O2 and -O3 -
Whenever I try to compile any code the following messagem appears: "greeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo."
I'm using CodeBlocks v. 13.12. Its file (codeblocks-2.app) is inside the App folder.I suggest you ask whomever makes CodeBlocks.
They would be the most knowledgeable. -
Java application crashes due to some problem in native code
Hi All
I have a Java application that calls APIs in a 3rd party DLL(I don't have access to its source code or logs) through my VC++ DLL(Win32) that acts as the wrapper DLL.
The Application has many functionalities and is based on multithreading (both on Java layer as well as C++ layer). Most of the functionalities are working , but when I try to close the application, it crashes.
Moreover the crashing occurs inconstently, sometimes it does not crash. Instead of showing any debug information , it simply creates a error file with disassembly code that I am not able to understand.
Though the error seems like an java error, but actually it seems to be due to native code. I have try catch blocks in my code and also implemented settranslator functionality to get hold of structured/C exceptions. But still I am not able to catch any exceptions.
I am pasting the the contents of the file here:
# An unexpected error has been detected by HotSpot Virtual Machine:
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x7c9111de, pid=488, tid=1848
# Java VM: Java HotSpot(TM) Client VM (1.4.2_14-b05 mixed mode)
# Problematic frame:
# C [ntdll.dll+0x111de]
--------------- T H R E A D ---------------
Current thread (0x009d1790): JavaThread "CompilerThread0" daemon [_thread_in_native, id=1848]
siginfo: ExceptionCode=0xc0000005, reading address 0x00000001
Registers:
EAX=0x00000001, EBX=0x00030000, ECX=0x02d17a18, EDX=0x00030278
ESP=0x02c2f8e8, EBP=0x02c2fb08, ESI=0x02d17a10, EDI=0x00000001
EIP=0x7c9111de, EFLAGS=0x00010202
Top of Stack: (sp=0x02c2f8e8)
0x02c2f8e8: 009fa9a0 000000c0 00000008 0811d3d8
0x02c2f8f8: 0000000c 00a2c0e0 00000003 00000004
0x02c2f908: 08018216 00000001 02c2fcc4 08018385
0x02c2f918: 00000002 00000001 02c2f93c 02d06d0c
0x02c2f928: 0802a50a 00000000 00000001 02c2f93c
0x02c2f938: 04a3cb4c 02d01008 02c2f964 0802a850
0x02c2f948: 02c2f96e 00000000 00000007 00000000
0x02c2f958: 04a3cb38 00000004 08018216 00000001
Instructions: (pc=0x7c9111de)
0x7c9111ce: 39 89 bd 0c ff ff ff 8b 46 0c 89 85 68 ff ff ff
0x7c9111de: 8b 10 3b 57 04 0f 85 8c 31 02 00 3b d1 0f 85 84
Stack: [0x02bf0000,0x02c30000), sp=0x02c2f8e8, free space=254k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [ntdll.dll+0x111de]
C [MSVCRT.dll+0x1c3c9]
C [MSVCRT.dll+0x1c3e7]
C [MSVCRT.dll+0x1c42e]
V [jvm.dll+0xacda9]
V [jvm.dll+0x17102]
V [jvm.dll+0x16c8d]
V [jvm.dll+0x16dca]
V [jvm.dll+0x170a7]
V [jvm.dll+0x172e8]
V [jvm.dll+0x4dc65]
V [jvm.dll+0x4d894]
V [jvm.dll+0xd3a36]
V [jvm.dll+0xd3a04]
C [MSVCRT.dll+0x2a3b0]
C [kernel32.dll+0xb683]
Current CompileTask:
HotSpot Client Compiler:423 b sun.awt.AWTAutoShutdown.isReadyToShutdown()Z (33 bytes)
--------------- P R O C E S S ---------------
Java Threads: ( => current thread )
0x049d6328 JavaThread "Thread-19" [_thread_blocked, id=1440]
0x049d24d0 JavaThread "Thread-18" [_thread_blocked, id=3620]
0x049d40c8 JavaThread "Thread-17" [_thread_blocked, id=2476]
0x02df0538 JavaThread "TimerQueue" daemon [_thread_blocked, id=3876]
0x00036a78 JavaThread "DestroyJavaVM" [_thread_blocked, id=2448]
0x02e43768 JavaThread "Thread-6" [_thread_blocked, id=3664]
0x02e23130 JavaThread "Thread-4" [_thread_blocked, id=2816]
0x02e21d08 JavaThread "Thread-2" [_thread_blocked, id=3344]
0x02da3f78 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=2528]
0x02da3268 JavaThread "AWT-EventQueue-0" [_thread_in_native, id=4008]
0x02d91f90 JavaThread "AWT-Windows" daemon [_thread_blocked, id=648]
0x02d3a478 JavaThread "AWT-Shutdown" [_thread_blocked, id=2988]
=>0x009d1790 JavaThread "CompilerThread0" daemon [_thread_in_native, id=1848]
0x009d0a90 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=3568]
0x009ce128 JavaThread "Finalizer" daemon [_thread_blocked, id=1824]
0x009ccda0 JavaThread "Reference Handler" daemon [_thread_blocked, id=3280]
Other Threads:
0x00a0b6e8 VMThread [id=608]
0x00a0d620 WatcherThread [id=3012]
VM state:not at safepoint (normal execution)
VM Mutex/Monitor currently owned by a thread: None
Heap
def new generation total 640K, used 583K [0x10010000, 0x100c0000, 0x104f0000)
eden space 576K, 90% used [0x10010000, 0x10091e40, 0x100a0000)
from space 64K, 99% used [0x100b0000, 0x100bfff8, 0x100c0000)
to space 64K, 0% used [0x100a0000, 0x100a0000, 0x100b0000)
tenured generation total 7772K, used 5451K [0x104f0000, 0x10c87000, 0x14010000)
the space 7772K, 70% used [0x104f0000, 0x10a42d80, 0x10a42e00, 0x10c87000)
compacting perm gen total 8192K, used 8137K [0x14010000, 0x14810000, 0x18010000)
the space 8192K, 99% used [0x14010000, 0x148024e8, 0x14802600, 0x14810000)
Dynamic libraries:
0x00400000 - 0x0040b000 c:\dcsthick\jre\bin\java.exe
0x7c900000 - 0x7c9b0000 C:\WINDOWS\system32\ntdll.dll
0x7c800000 - 0x7c8f5000 C:\WINDOWS\system32\kernel32.dll
0x77dd0000 - 0x77e6b000 C:\WINDOWS\system32\ADVAPI32.dll
0x77e70000 - 0x77f01000 C:\WINDOWS\system32\RPCRT4.dll
0x77c10000 - 0x77c68000 C:\WINDOWS\system32\MSVCRT.dll
0x08000000 - 0x08143000 c:\dcsthick\jre\bin\client\jvm.dll
0x7e410000 - 0x7e4a1000 C:\WINDOWS\system32\USER32.dll
0x77f10000 - 0x77f57000 C:\WINDOWS\system32\GDI32.dll
0x76b40000 - 0x76b6d000 C:\WINDOWS\system32\WINMM.dll
0x76390000 - 0x763ad000 C:\WINDOWS\system32\IMM32.DLL
0x10000000 - 0x10007000 c:\dcsthick\jre\bin\hpi.dll
0x76bf0000 - 0x76bfb000 C:\WINDOWS\system32\PSAPI.DLL
0x00390000 - 0x0039e000 c:\dcsthick\jre\bin\verify.dll
0x003b0000 - 0x003c9000 c:\dcsthick\jre\bin\java.dll
0x003d0000 - 0x003de000 c:\dcsthick\jre\bin\zip.dll
0x02e70000 - 0x02f84000 C:\dcsthick\jre\bin\awt.dll
0x73000000 - 0x73026000 C:\WINDOWS\system32\WINSPOOL.DRV
0x774e0000 - 0x7761d000 C:\WINDOWS\system32\ole32.dll
0x5ad70000 - 0x5ada8000 C:\WINDOWS\SYSTEM32\uxtheme.dll
0x02fe0000 - 0x03031000 C:\dcsthick\jre\bin\fontmanager.dll
0x73760000 - 0x737a9000 C:\WINDOWS\system32\ddraw.dll
0x73bc0000 - 0x73bc6000 C:\WINDOWS\system32\DCIMAN32.dll
0x73940000 - 0x73a10000 C:\WINDOWS\system32\D3DIM700.DLL
0x74720000 - 0x7476b000 C:\WINDOWS\system32\MSCTF.dll
0x755c0000 - 0x755ee000 C:\WINDOWS\system32\msctfime.ime
0x03320000 - 0x0333c000 C:\dcsthick\lib\CrewsDmApiJniNt.dll
0x031b0000 - 0x031bb000 c:\dcsthick\lib\CRWNT_DM.dll
0x03240000 - 0x03249000 c:\dcsthick\lib\BAT_API.dll
0x03340000 - 0x03352000 c:\dcsthick\lib\DC_DSM32.dll
0x03360000 - 0x03369000 c:\dcsthick\lib\CRWTOOLS.dll
0x77c00000 - 0x77c08000 C:\WINDOWS\system32\VERSION.dll
0x03370000 - 0x0337a000 c:\dcsthick\lib\PMAPI.dll
0x5d090000 - 0x5d12a000 C:\WINDOWS\system32\COMCTL32.dll
0x03790000 - 0x037b2000 c:\dcsthick\ResaDLL\DC_DSMNB.dll
0x5b860000 - 0x5b8b4000 C:\WINDOWS\system32\NETAPI32.dll
0x038d0000 - 0x038f2000 c:\dcsthick\ResaDLL\DC_DSMIP.dll
0x71ad0000 - 0x71ad9000 C:\WINDOWS\system32\WSOCK32.dll
0x71ab0000 - 0x71ac7000 C:\WINDOWS\system32\WS2_32.dll
0x71aa0000 - 0x71aa8000 C:\WINDOWS\system32\WS2HELP.dll
0x71a50000 - 0x71a8f000 C:\WINDOWS\system32\mswsock.dll
0x662b0000 - 0x66308000 C:\WINDOWS\system32\hnetcfg.dll
0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll
0x76f20000 - 0x76f47000 C:\WINDOWS\system32\DNSAPI.dll
0x76fb0000 - 0x76fb8000 C:\WINDOWS\System32\winrnr.dll
0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll
0x66580000 - 0x6658f000 C:\WINDOWS\system32\pnrpnsp.dll
0x76fc0000 - 0x76fc6000 C:\WINDOWS\system32\rasadhlp.dll
0x032e0000 - 0x0330a000 C:\dcsthick\lib\ResaHostConnection.dll
0x03250000 - 0x03257000 c:\dcsthick\lib\CRWNT_GWALC.dll
0x03310000 - 0x03319000 c:\dcsthick\lib\ALCAPI.dll
0x763b0000 - 0x763f9000 C:\WINDOWS\system32\comdlg32.dll
0x77f60000 - 0x77fd6000 C:\WINDOWS\system32\SHLWAPI.dll
0x7c9c0000 - 0x7d1d7000 C:\WINDOWS\system32\SHELL32.dll
0x773d0000 - 0x774d3000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2982_x-ww_ac3f9c03\comctl32.dll
VM Arguments:
jvm_args: -Dcfdynaproppath=c:\dcsthick/config/ -Dcfdynapropxml=RESA_KCOdynamicproperties.xml -DConfigPath=c:\dcsthick/config/RESA_KCOConfig.xml -DResolution=High -DWorkstationID=GWGTE -DMode=GateBoarding -DlogPath=c:\temp\kcologs -DlogInformation=0 -DGateway=ALCSQ1 -DNetBiosPort=A
java_command: com.singaporeair.dcs.standalone.application.model.ApplicationModel SQ/IGATEADXX
Launcher Type: SUN_STANDARD
Environment Variables:
JAVA_HOME=c:\dcsthick\jre\bin
PATH=c:\dcsthick\jre\bin;c:\dcsthick/lib;c:\dcsthick/ResaDLL
USERNAME=USER
OS=Windows_NT
PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 13, GenuineIntel
--------------- S Y S T E M ---------------
OS: Windows XP Build 2600 Service Pack 2
CPU:total 2 family 6, cmov, cx8, fxsr, mmx, sse, sse2
Memory: 4k page, physical 1039600k(565656k free), swap 2501208k(2091128k free)
vm_info: Java HotSpot(TM) Client VM (1.4.2_14-b05) for windows-x86, built on Mar 14 2007 16:46:11 by "java_re" with MS VC++ 6.0
The JAVA Application during initialisation establishes a connection with the host server for various devices. For each of the device it establishes a separate connection and keeps listening on these connections using multithreading.
During App close, we need to close each of these connections one by one for each device.
The opening /closing of connection is done by 3rd party DLL and call to there APIs is done through a C++ Wrapper DLL that I have built between the Java layer and their DLL.
When we close the Application, I am always able to close the connections on the first 2 devices. Then all of a sudden it crashes either for the 3rd device conn. close or for the 4th one. The code is the same for all the devices . That too sometimes it just goes fine without crashing. If its a null pointer exception, why is it that it crashes on some occassions and not in other times. More importantly, why is it that it does not fail for the first 2 devices , but fails for the 3rd or 4th device connection close?
Can please anyone help me. Please suggest me as to how I can determine the cause of the error.
And is this error really coming in ntdll.dll or is it getting caused of my dll?The opening /closing of connection is done by 3rd party DLL and call to there APIs is done through a C++ Wrapper DLL that I have built between the Java layer and their DLL.The specific error indicates a pointer/memory problem.
The first place that is likely is in your code.
The second most likely place for the cause is because you are using the third party library incorrectly. For example before exiting you are supposed to clean up resources and you are not doing so.
As a remote possibility, much less likely that either of the above, there is a bug in jnative or in the 3rd party library.
Maybe you are looking for
-
Image upload in Form with Report
Hello I have created a table FA_CUST_DTL Column Name Data Type Nullable Default Primary Key CUST_ID NUMBER No 1 CUST_NAME VARCHAR2(1000) Yes CUST_ADD VARCHAR2(4000) Yes MOBILE NUMBER(
-
Library is gone today -- Help!!
I started iTunes this afternoon and the library was blank. I found in preferences that my music was pointing to an invalid directory and changed that. Still nothing. Selectetd Import Folder, found music and imported album files. When finished, al
-
when i open itunes an error report box pops ups and itunes doesnt open! what can i do?
-
How to add a sound on some slides?
How to add a sound on some slides? Not only one slide and not all the slideshow? Is it possible? It must be!
-
Live Corner and Subtraction Shape Issue
Having problem in Live Corner with Subtraction shape. Not sure if there is any setting to work on this. Please refer to my image attached. When using Pathfinder to subtract round corner shape made from Live Corner it come out with unexpected shape. B