Question about Operating Systems

Open Question

FileConnection error in j2me

I m getting problem
this is j2me program
i m getting this error while exe.
"java.lang.IllegalArgumentException: Root is not accessible"


the program is:
i m getting error in the first line of function "startConn()"


import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import java.io.*;
import javax.microedition.io.*;
import javax.microedition.io.file.FileConnection;
import javax.microedition.pim.*;


public class FileC extends MIDlet implements CommandListener
{
private Command exit, start;
private Display display;
private Form form;

public FileC ()
{
display = Display.getDisplay(this);
exit = new Command("Exit", Command.EXIT, 1);
start = new Command("Start", Command.EXIT, 1);
form = new Form("Write To File");
form.addCommand(exit);
form.addCommand(start);
form.setCommandListener(this);
}

public void startApp() <------------------ error
{
display.setCurrent(form);
System.out.println("File1111111111111");
startConn();
}

public void pauseApp()
{
}
public void destroyApp(boolean unconditional)
{
}

public void commandAction(Command c,Displayable d)
{
if(c==exit)
{
destroyApp(false);
notifyDestroyed();
}

}
public void startConn()
{
try
{


FileConnection connection = (FileConnection)Connector.open("file:///C:/myfile.txt" );
InputStream out = connection.openInputStream();
System.out.println(out);
InputStreamReader output = new InputStreamReader( out );
out.println(output );
//output.flush();
out.close();
connection.close();
Alert a=new Alert("hello","I m fine",null,null);
a.setTimeout(5000);
display.setCurrent(a);
}
catch(Exception e)
{
System.out.println("Hello "+e);
}
}
}






HEPL ME

Posted by on

  • vrusha_App Jan 16, 2009

    Hi,
    I have same problem I have written same code, only difference is I used following code fir connection.
    FileConnection fc = (FileConnection)
    Connector.open("file:///CFCard/");



×

5 Suggested Answers

SOURCE: c++

good

Posted on Feb 23, 2008


SOURCE: AWT PROBLEM IN JAVA.

its runing the program.it didnt has any problem

Posted on Aug 12, 2008

  • 2 Answers

SOURCE: please explain the working of this code

It's a Java http server (webserver) that serves random "prices" if they match a search string.

Well here is an explaination:

private static String[] symbols = {"DELL", "INTC", "MSFT", "ORCL", "SUNW"};
These are search strings

private static Random rnd = new Random();
This generates a random number

private static Charset cs = Charset.forName("UTF-8");
This is the charset that the http server uses

ServerSocketChannel server = ServerSocketChannel.open();
Create a new server

server.socket().bind(new InetSocketAddress(8055));
Bind the http server to port 8055

The rest is handling the request and processing it

But here:
if(Arrays.binarySearch(symbols, symbol) >= 0)
response = "Price is " + (1000 + rnd.nextInt(9000)) / 100.0;
else
response = "Price not available";
channel.write(cs.encode("HTTP/1.0 200 OK "));
channel.write(cs.encode("Content-type: text/plain "));
channel.write(cs.encode(response));
channel.close();
}
It sees if the string input matchs: DELL INTC MSFT ORCL SUNW.

(private static String[] symbols = {"DELL", "INTC", "MSFT", "ORCL", "SUNW"};)
If so, it gives a price based on a random number.
(
response = "Price is " + (1000 + rnd.nextInt(9000)) / 100.0;)
Or else
It says "price not available"
then it gives a html header to end the error message.

Hope I helped you :)
Gook luck

Posted on Nov 26, 2008

wesleyisaiah
  • 32 Answers

SOURCE: I am an MCA student.To read the file from PC to handheld device

you might need to run a anti-virus through your computer. it might have a bug. :) hope this helps!!

Posted on May 20, 2009

  • 323 Answers

SOURCE: jnlp code for the java program

From command prompt: You can also launch an application from a command prompt by typing javaws jnlp_url where jnlp_url is a url to the jnlp file of the application. Go to Start > Run > type "cmd". A command prompt window will appear. Type "javaws url_of_jnlp"

Posted on Jun 12, 2009

Add Your Answer

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

1 Answer

When i install scan cm1312 on my PC ruuning win 7 i get an Error saying Extanal Error


Are you installing the driver from the CD?

Try downloadingg the driver from their site.
http://h20000.www2.hp.com/bizsupport/TechSupport/SoftwareDescription.jsp?lang=en&cc=us&prodTypeId=18972&prodSeriesId=3558902&prodNameId=3562006&swEnvOID=2100&swLang=8&mode=2&taskId=135&swItem=ma-61238-3

1. Download the file: 1312series_full_solution_v5.0_AM-EMEA.exe (306 MB)
2 Use the full download from the website and it self extracts to your root directory.To run the self extracting file, first set the compatibility mode to Vista sp2 and run as admin.
3) The files remain and you can find them here:
C:\HP_CM1312_series_full_solution_v5.0_AM-EMEA\
4) Set the compatibility mode to Vista sp2 and run as admin on the Setup.exe.
5) Run the full install. Works for both usb or network.

Regards,

Mar 18, 2011 | Operating Systems

1 Answer

Internet explorer eill not open with ssagent.exe


Is it ssagent or ssvagant? Ssagent is System Scanner Agent Module for System Scanner for Windows by Internet Security Systems.
If it was ssvagent, that is a component of Java Platform. That error comes with ssvagent as I know. If so, this procedure will help to get rid of the error. Its a bug of a component wit Java Runtime.
  • Run IE as the Administrator.
  • Click on Tools -> Manage Add-ons -> Enable or Disable Add-ons.
  • Click on SSVHelper Class and select Disable under Settings.

Description of the Bug.
If you are having a problem with Ssagent instead, please check the settings to make sure that you haven't blocked any program. Scan your machine for Viruses and Malware.
If the solution works for you please rate the answer as well.
Feel free to contact if you still have the problem.
Thanks for using Fixya!

Jul 12, 2010 | Microsoft Windows Vista Home Premium...

1 Answer

Give me topic of java based miniproject for third year


Hello, I suggest you to develop one mobile application in java using J2ME,
We you want to do more then build one small application in googles android plateform. It will really makes your good impression.
But you must have to do hard work on that project.
But i know it is not difficult . So start it dear okay................

Jul 07, 2010 | Microsoft Windows XP Professional

1 Answer

WinExec Failed: return = 216


Hi, Hope you would understand English :-)The program is either not compatible or exe file corrupted. Try to run in the compatibility mode. (Right click on the exe and get properties and click on Compatibility and adjust). If you have a 64bit windows please download the appropriate software or use the emulators for 32 bit applications.
Thanks for contacting Fixya (Please rate the answer if it worked for you)

Jun 02, 2010 | Dell Operating Systems

2 Answers

Hi tryed to download javameantime, error code 25099 connot unzipp core files, how do i corect the problem,


WORKAROUND

Step 1 : Completely delete content of the following directory: C:\Program Files\Java\jre6\ (or alternate directory if you chose a non-default install location)

Step 2 : If Step 1 has permission issues due to files being locked or in use, restart your system

Step 3 : Now, completely delete content of the following directory: C:\Program Files\Java\jre6\

Step 4 : Download and install Java.
  1. Go to Java.com
  2. Click on the Free Java Download button, and start the installation process.

Sep 17, 2009 | Microsoft Windows XP Professional With...

2 Answers

Suggest the project names based on java


I would suggest you to develop an Instant Messaging or Web Chatting utility. It should be pretty easy in Java.

All the best.

Jul 22, 2009 | Microsoft Windows XP Professional

1 Answer

Help to developing java program code in a require format


Java is an "interpreted" language.
You need to use a "compiled" language, such as C++ or Fortran, in order to make an '.exe' file.

Find a "UNIX FOR DUMMIES" book -- it will describe "make" files.

Jul 28, 2008 | Operating Systems

1 Answer

Using WINDOWS VISTA. how to fix it


When are you getting this error?

are you getting the error when you log on or when opening any particular software..

Moreever the error seems to be thrown by Java.. Better reinstall java on your computer

To uninstall Java ->Start -> Type" Programs and features" on the start search and open it -> remove Java from there

Then open Internet Explorer -> Tools -> Internet Options -> click settings on Browsing history -> view objects

remove java from there. Reboot the computer once.

NOw logon to http://www.java.com to install java on your computer..

Jun 19, 2008 | Microsoft Windows XP Professional for PC

1 Answer

Java programming


There are 2000 jpeg libraries in Java out there, easily searchable on search engines, sourceforge, maybe versiontracker, and secondly, you're asking for (what should be application-specific -output-; why would you hobble input) crop/resize without hinting at your algorithm? First, get a real programmer....

Java project for college applications? Gee, how about one to take a personality inventory (the INTJ type; only padded out) including areas of interest and make people little public/private spot codes (2D barcodes, like the ones in Japanese magazines) to indicate their type. The camera in a cellphone with J2ME can read the codes, maybe.... The cool part is that they're coupled with either P3P in wikis or java applets that help communicate with that person if you're an type that would otherwise take bothersome human care and preface to communicate.
There are all kinds of little systems you can build to thwart the draggy bits of Alzheimers' etc. with various little expert systems, that come up when you read a science journal (Nature, Science, Dr. Dobb's Journal, JAMA, JVNA....
You could invent something other than big-headed anime characters to add a personal visual reference to GUIs; emobots were cool, but maybe you can have a **** Cheney's Hands IM environment if it doesn't already exist (see also: Galludet University (for deaf students) stuff.)

Mar 20, 2008 | Operating Systems

Not finding what you are looking for?
Operating Systems Logo

Related Topics:

283 people viewed this question

Ask a Question

Usually answered in minutes!

Top Operating Systems Experts

Les Dickinson
Les Dickinson

Level 3 Expert

18304 Answers

Brian Sullivan
Brian Sullivan

Level 3 Expert

27725 Answers

Prashant  Sharma
Prashant Sharma

Level 3 Expert

1127 Answers

Are you an Operating System Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...