Ritesh Chopade

Greenhorn
+ Follow
since Oct 22, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ritesh Chopade

Multiple versions because I have not removed the old one and just added the new jars as per my need.
Also most of the time it works fine, but at certain situation it throws exception. So I want to confirm that the problem due to multiple versions or there may be another reason?
I have multiple versions(4 versions) of the same jar in my web application lib directory, here I am getting the class cast exception for the class in this jar. Is it due to the multiple version of the jar? But when I restart my jboss server, it works fine(means doesn't throw the exception).

Thanks in advance.
Hi HaoZhe,
I use different thread for bluetooth connection & file creation.
And I am talking about local file via JSR 75 File Connection API.
I never get any error/exception.

The following is the code fragment of my application. The code works fine event the exists method of File Connection class return true
(i.e:- file created), but I am unable to find it at file system.

The code fragment as,

final byte[] data = "It is my just a test data".getBytes(); //It is the data which is comes from another bluetooth device
final String fName = "file:///root1/test.txt"; //The file I want to create at my file system(i.e:- root1 folder in my file system)
new Thread(new Runnable() {

public void run() {
try{
FileConnection fc = (FileConnection) Connector.open(fName, Connector.WRITE);
System.out.println("fc.exists()(Before) : " + fc.exists() ); //It prints "fc.exists()(Before) : false"
if( !fc.exists() ){
fc.create();
System.out.println("fc.exists()(After) : " + fc.exists() ); //It prints "fc.exists()(After) : true"
OutputStream fout = fc.openOutputStream();
fout.write(data);
fout.close();
}
fc.close();
}catch(IOException ex){
ex.printStackTrace();
}
}
}).start()


And for more information you check my yesterday's post Unable to create file
14 years ago
In my application, I have to establish the connection to server mobile(slave) through bluetooth. but once I establish connection to server mobile, I am unable to create new file.
But the file is created before connection establishment. I have set all API permissions also.
If anyone have solution, please help me its too urgent.
14 years ago
Hello,
I have to download file from server mobile(through bluetooth), I receive data properly from server to client mobile. But once I get data, I have to create a file(in write mode)
at my client mobile to stored the data from server. But I am unable to create file at my client, code doesn't give me error/exception(it works fine) but I can't find the file at file system
(i.e:- root folder(in filesystem folder) at my J2ME wireless toolkit 2.5). I have specified the code below to create file.


final byte[] data = "It is my just a test data".getBytes(); //It is the data which is comes from another bluetooth device
final String fName = "file:///root1/test.txt"; //The file I want to create at my file system(i.e:- root1 folder in my file system)
new Thread(new Runnable() {

public void run() {
try{
FileConnection fc = (FileConnection) Connector.open(fName, Connector.WRITE);
System.out.println("fc.exists()(Before) : " + fc.exists() ); //It prints "fc.exists()(Before) : false"
if( !fc.exists() ){
fc.create();
System.out.println("fc.exists()(After) : " + fc.exists() ); //It prints "fc.exists()(After) : true"
OutputStream fout = fc.openOutputStream();
fout.write(data);
fout.close();
}
fc.close();
}catch(IOException ex){
ex.printStackTrace();
}
}
}).start();


I observe one thing here that the above code works fine if I use it outside of my bluetooth interaction & data access code(i.e:- input/output streams & server connections).
Any help will be appreciated
14 years ago
Hello,
I have J2Me code for obex but it is not working properly, so I need the sample J2ME code for obex demo(i.e:- file transfer through bluetooth). So I can review the code & make changes in my code as per the sample. I have seen the sample code at sun site but it just for image transfer. I have to transfer any file.
If any one have such code, please help me.

Thanks in advance
14 years ago
Hello,
I am new to J2ME. I am developing application to download file from one mobile to another through bluetooth connection. I am working using J2ME wireless toolkit.
I receive data through bluetooth connection(from slave to master). At master device I have to create new file(if not exists) & write the data(from slave) to file.
My code works fine(without exception), but once code execute fine I am not able to see the file at root location in j2me wireless toolkit(emulator) using default color phone.
My root folder is root1. My code is as follows,


final byte[] data = "It is my just a test data".getBytes(); //Data which is comes from another blutooth device
final String fName = "file:///root1/test.txt";
new Thread(new Runnable() {

public void run() {
try{
FileConnection fc = (FileConnection) Connector.open(fName, Connector.WRITE);
System.out.println("fc.exists()(Before) : " + fc.exists() ); //It prints fc.exists()(Before) : false
if( !fc.exists() ){
fc.create();
System.out.println("fc.exists()(After) : " + fc.exists() ); //It prints fc.exists()(After) : true
OutputStream fout = fc.openOutputStream();
fout.write(data);
fout.close();
}
fc.close();
}catch(IOException ex){
ex.printStackTrace();
}
}
}).start();


Please help me.
Thanks in advance.....
14 years ago
Hi,
I can't access(read) the local files & folder in my web application.Means I want to access files & folder from a machine when I use my web application that machine. And I have deployed my application at two different location for testing & development. I access the folders & files from the development server & can't access from the test server & folders & files on a single machine. I am accessing the files as //comp31/test_project/script/script_j.doc
the //comp31 is the domain name (or my computer name) & test_project is the folder name in which files needs to read.

Please help me.....
[ October 22, 2008: Message edited by: Ritesh Chopade ]
15 years ago