PortInUseException

Anybody help me please.When I run apdutool there is exception like this...--Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException--I use java card development kit 2.1.2 on win2000
[263 byte] By [zobis] at [2007-9-26 2:13:44]
# 1
You need the Java comm api also. It's not included in the JC
DurangoVa at 2007-6-29 9:08:43 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 2

CAUTION:

You must also make sure that no other program accesses your smart card reader -- some type of driver program perhaps.

Another problem is the CommAPI itself which can cause a lot of trouble on some platforms (does not recognize ports, hangs,...).

Regards,

Jacek.

jacek79 at 2007-6-29 9:08:43 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 3
Hello ! just see If you have set a correct class path .Which example are you Running?If You Need More Help do mail me .Neelesh .dalvins@vsnl.com
NeeleshD at 2007-6-29 9:08:43 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 4
Everything's right now, thank you for every helps.The exception occur because I copy comm.jar to the wrong directory.
zobis at 2007-6-29 9:08:43 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 5
hey zobis! tell me wht u did i too have the same problemcheers-naga
naga_sri at 2007-6-29 9:08:43 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 6
make sure the comm dll is in your PATH environment setting and your commapi.jar in your CLASSPATH.
DurangoVa at 2007-6-29 9:08:43 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 7
everything is correct.but inspite of that its giving me the same errorException in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException- naga
naga_sri at 2007-6-29 9:08:43 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 8
Then I suggest you detail the steps you are performing. Also what OS are you using ?
DurangoVa at 2007-6-29 9:08:43 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 9

hi durangoVa!

i've solved the problem for jcwde and apdutool.all these things run correctly and i c the hexa digits running in my screen.i've got a silly querry to ask u ............ does it indicates that the file works when its loaded on to the card?

above things works when i perform the action with the examples.

now i got myself into a strange situation.i compiled the java card program and when i try to convert the class file, all i get is the options and other attributes running.i tried all sorts of options - yet there is no change in the result.

suggest me how to solve it.

cheers mate

- naga

naga_sri at 2007-6-29 9:08:43 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 10
the converter is one of the tediouis things to set up. If you are getting the "options dump" when you run it, that means there is an error.Look at the first line and you should see the error message. if still having problems, dump it here for me too peek at
DurangoVa at 2007-6-29 9:08:43 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 11

hi durangoVa!

i have attached the result of file i ran

I:\JAVA_C~1\BIN>converter -config studentrecord.opt

Usage: converter <options> package_name package_aid major_version.minor_version

OR

converter -config <filename>

use file for all options and parameters to converter

Where options include:

-classdir <the root directory of the class hierarchy>

set the root directory where the Converter

will look for classes

-isupport the 32-bit integer type

-exportpath <list of directories>

list the root directories where the Converter

will look for export files

-exportmapuse the token mapping from the pre-defined export

file of the package being converted. The converter

will look for the export file in the exportpath

-applet <AID class_name>

set the applet AID and the class that defines the

install method for the applet

-d <the root directory for output>

-out [CAP] [EXP] [JCA]

tell the Converter to output the CAP file,

and/or the JCA file, and/or the export file

-V, -version print the Converter version string

-v, -verbose enable verbose output

-help print out this message

-nowarninstruct the Converter to not report warning messages

-mask indicate this package is for mask, so restrictions on

native methods are relaxed

-debugenable generation of debugging information

-nobannersuppress all standard output messages

-noverifyturn off verification. Verification is default

the .opt file has the following

-exportpath I:\java_card_kit-2_2\samples\classes\com\sun\javacard\samples\StudentRecord\javacard;

-out EXP JCA CAP

-applet 0xa0:0x00:0x0:0x0:0x62:0x3:0x1:0xc:0x07:0x01 com.sun.javacard.samples.studentrecord.StudentRecord

com.sun.javacard.samples.studentrecord

0xa0:0x00:0x0:0x0:0x62:0x3:0x1:0xc:0x07:0x01

i am using the javacard directory to have all the exp,jca,cap files

help me durangoVa

thx

- naga

naga_sri at 2007-6-29 9:08:44 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 12
try changing opt export flag-exportpath I:\java_card_kit-2_2\samples\classes\
DurangoVa at 2007-6-29 9:08:44 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 13
still the same durango. shud i change any other thing?
naga_sri at 2007-6-29 9:08:44 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 14
Why are you using the com.sun package ? Also use a different RID for you package ( don't use 0xa0:0x00:0x0:0x0:0x62, that belongs to com.sun ) I'm not saying those are your problems but those are a no-no.
DurangoVa at 2007-6-29 9:08:44 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 15
Also your export path isn't pointing to the path of the javacard exports. That should be <installed JC directory>\api_export_files
DurangoVa at 2007-7-1 1:39:03 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 16
i've changed as what u said ......... but still the same problem durangoVa.- naga
naga_sri at 2007-7-1 1:39:03 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 17
Whenever I come across a problem when using the -config option, I separate the flags and put them individually on the command line. That way I can see which one failed. Give that a try.
DurangoVa at 2007-7-1 1:39:03 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 18
no matter what menu i use after converter .......... it just scrolls and lists the useage. only the -nobanner option works and other fail- naga
naga_sri at 2007-7-1 1:39:03 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 19
Take this offline and send me your opt file
DurangoVa at 2007-7-1 1:39:03 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 20
where's your major_version.minor_version ?
DurangoVa at 2007-7-1 1:39:03 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 21

herez my opt file ........

-exportpath I:\java_card_kit-2_2\samples\classes\com\sun\javacard\samples\StudentRecord\javacard;I:\java_card_kit-2_2\api_export_files

-out EXP JCA CAP

-applet 0xB0:0x00:0x01:0x0:0x52:0x3:0x1:0xc:0x07:0x01 com.sun.javacard.samples.studentrecord.StudentRecord

com.sun.javacard.samples.studentrecord

0xB0:0x00:0x01:0x0:0x52:0x3:0x1:0xc:0x07:0x01

by the way is major and minor necessary coz i am using a configuration file? if so, tell me how to assign it

cheers

- naga

naga_sri at 2007-7-1 1:39:03 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 22

Look at the sample opt files that are provided in the samples directory

--

Usage: converter <options> package_name package_aid major_version.minor_version

should read:

-exportpath I:\java_card_kit-2_2\samples\classes\com\sun\javacard\samples\StudentRecord\javacard;I:\java_card_kit-2_2\api_export_files

-out EXP JCA CAP

-applet 0xB0:0x00:0x01:0x0:0x52:0x3:0x1:0xc:0x07:0x01 com.sun.javacard.samples.studentrecord.StudentRecord <-- should change this to own package

com.sun.javacard.samples.studentrecord<-- should change to own package

0xB0:0x00:0x01:0x0:0x52:0x3:0x1:0xc:0x07:0x01 1.0 <-- major.minor

DurangoVa at 2007-7-1 1:39:03 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 23

hi!

still i couldnt resolve the problem durangoVa.

i have a suggestion, the only option left out.

i will mail u the concerned files and if u dont mind would u convert it and send it to me?

i have no other way to than to ask for this

awaiting ur reply

thx

- naga

naga_sri at 2007-7-1 1:39:03 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 24
Ok, send it to me but zip the class files as well. Follow the samples and the instructions outlined in the documentation. Converter works fine.
DurangoVa at 2007-7-1 1:39:03 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 25
hi durangova!may i have ur email id so that i can forward the files to u?i've followed all the instructions of the converter command.yet no use.thx- naga
naga_sri at 2007-7-1 1:39:03 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 26
my email addy is in profile. java_card@hotmail.comI'm assuming you've attempted to run the build_samples.bat to build the samples that came with the Sun JCDK. It does everything but starts the JCWDE or reference implementation.
DurangoVa at 2007-7-1 1:39:03 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 27
hi durango!i was tryin to do the conversion. but dunno what i happened, i couldnt do it. so, i've mailed the files to ur id. plz do the needful.thx- naga
naga_sri at 2007-7-1 1:39:03 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 28
You didn't answer my previous question. Can you use the build_samples.bat that came with the kit ?
DurangoVa at 2007-7-1 1:39:03 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 29
yup durangoVa, i ran the file. but still i couldnt get the clear resultcheers-naga
naga_sri at 2007-7-1 1:39:03 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 30

I got your code and you didn't follow my previous post.

DON'T USE THE COM.SUN PACKAGE.

That means in your CODE as well as in the OPT file.

Put things in a Student package. Also, based on what I could see, the only setting required for your exportpath is the I:\java_card_kit-2_2\api_export_files, remove the other one.

What do you mean "you couldn't get a clear result ?" Either the build_samples works or it doesn't.

DurangoVa at 2007-7-1 1:39:05 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 31
hi durangoVa! i've run the file as per as ur instructions. yet the problem with the converter is not changed. (i.e) when i run the converter command it just scrolls giving the usage of the command.cheers- naga
naga_sri at 2007-7-1 1:39:05 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 32

Compare the sample opt files provided with the Sun JC kit to your opt file. Remove all references to com.sun in your code. Put it in a package called Student. Change your -exportpath to reflect your package. I don't believe you understand what a package is because when you sent me your code it was zipped in a Student sub directory, but you had com.sun....in your code. Doesn't match.

You never tell me if the build_samples.bat works. Therefore I get the feeling you aren't investigating this to the fullest before you post. READ the developers guide, it lays it out fine, as well as the samples. STUDY the samples.

DurangoVa at 2007-7-1 1:39:05 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 33
hi! got everythin workingmade couple os very very silly mistakesthx for ur vital time DurangoVathx for the help u gave mecheers- naga
naga_sri at 2007-7-1 1:39:05 > top of Java-index,Java Mobility Forums,Consumer and Commerce...