Error when importing java.util.Scanner
Agh! I'm in an introduction to computer science course, and I am writing a program as an assignment that's due tomorrow.
I have imported java.util.Scanner before, but I've only run it on the Windows PCs in the lab, whereas I am currently on a Mac. I've updated to the latest version of Java (through the software update), and I'm running Tiger (also fully updated).
I'm using Dr. Java to write the programs, but I tried using the very same thing in Eclipse and it didn't work. Here's my program:
import java.util.Random;
import java.util.Scanner;
public class Password {
public static void main(String[] args) {
//create a Scanner object to read from the keyboard:
String password;
Scanner scanner = new Scanner(System.in);
Random randomizer = new Random();
System.out.println("Please enter a string containing candidate characters.");
String input = scanner.next();
int charLength = length(input);
System.out.print("Random password: ");
System.out.print(input.substring(randomizer.nextInt(charLength)));
System.out.print(input.substring(randomizer.nextInt(charLength)));
System.out.print(input.substring(randomizer.nextInt(charLength)));
System.out.println(input.substring(randomizer.nextInt(charLength)));
And, here's my errors:
4 errors found:
File: /Users/brianmoore/Desktop/Password.java [line: 11]
Error: cannot resolve symbol
symbol : class Scanner
location: package util
File: /Users/brianmoore/Desktop/Password.java [line: 18]
Error: cannot resolve symbol
symbol : class Scanner
location: class Password
File: /Users/brianmoore/Desktop/Password.java [line: 18]
Error: cannot resolve symbol
symbol : class Scanner
location: class Password
File: /Users/brianmoore/Desktop/Password.java [line: 22]
Error: cannot resolve symbol
symbol : method length (java.lang.String)
location: class Password
Any ideas?
Ok. I figured it out. On the Dr. Java page, this is what helped me:
Please verify the following:
- Open "/Applications/Utilities/Java/J2SE 5.0/Java
Preferences";
make sure "J2SE 5.0" is at the top of the list under
"Java
Application Runtime"
- Open DrJava; go to Edit->Preferences; make sure
"Tools.jar
Location", "JSR-14 Location", and "JSR-14
Collections Path"
are all blank
- Open the Help->About dialog box; make sure the "DrJava
Version" listed is 20050601-0007 or later (that is, later
than
June 1, 2005)
- Go to the "System Properties" tab in the
"About" box; make
sure "java.version" is 1.4.2.
Let us know what you find out if you're still having
trouble.
Thanks for your help!
Similar Messages
-
The import "java.util.scanner" is not vaild
I am experiment with the java.util.scanner API after compiling the code below I received the following error:
The import "java.util.Scanner" is not valid, since it does not name a type in a package.
I declared a string variable should that suffice?
import java.util.Scanner;
public class Echo {
public static void main (String[] args)
String message;
Scanner scan = new Scanner (System.in);
System.out.println ("enter something:");
message = scan.nextLine();
System.out.println ("hey you entered: \"" + message + "\"");
}Most IDEs let you select and installed JDK for them to use. Check out that IDE's preferences.
Otherwise, start here and learn to do it with a simple text editor or programmer's editor, and the command line.
http://java.sun.com/docs/books/tutorial/getStarted/cupojava/ -
Model generation error when using java.util.List in JavaBeans
hi there,
when I try to generate model classes from JavaBeans classes,
packed into a JAR the generation process always stops with erros when the Bean class uses a property of type
java.util.List. See my example:
class MyJavaBean{
private java.util.List someMembers;
The error is:
Inspecting relation "MyJavaBean.SomeMembers" for source class "MyJavaBean"
[Warning]:This relation cannot be added as the TargetModelClass is not specified
[Error]: There are one or more relations unresolved. Importing the model without resolvoing the relations might result in erratic output.
Must I use a workaround or does anybody know something about this problem ? Installed: NW SP12
thx,
sabineHi Bhavik,
Can you please explain the error which you are getting while importing the model.
Please have a look at this tutorial.
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/tutorial on using ejbs in web dynpro - 20.html
Hope it helps.
Regards,
Naresh -
Hi,
In my program I hava inported the java package like
import java.util.*;
import java.sql.*;
import java.text.*;
then for using some classes like Gregorial calender,Date etc,I have to again import
import java.util.Date;
import java.sql.PreparedStatement;
import java.util.GregorianCalendar;
As far as I know if I have import the above like
import java.util.*; then it means I can use any classes in java.util ,but if I am not importing
import java.util.GregorianCalendar;
import java.util.Date;
my program is giving error.Can somebody tell me,where my concept is wrong.
Thanksimport java.sql.*;
import java.util.*;
//import java.util.Date; // <-- needed to avoid "the type Date is ambiguous"
public class PackageEg {
public static void main(String[] args) {
Date test = new Date();
}This code gives an error when I compile it, but if I include the
java.util.Date import it is good. The reason is that there are two
possible Date classes - one in java.util and one in java.sql. The
compiler cannot figure out which one I mean.
If I include a specific class like java.util.Date, then this one will be used
in preference to any .* imports. (These are called "imports on demand")
This explains why you need java.util.Date, but the other two are a
mystery. As far as I know PreparedStatement and GregorianCalander
are unique names within the packages you mention. Could you post
some code that will not compile unless the specific import statements
are there? -
Compile error import java.util.map$entry
Hi,
I am trying to compile code which imports the following package
import java.util.Map$Entry.
The error thrown up is : cant resolve symbol Map$Entry. Why is there a $ in the package import path and is there some configuration required to compile the file.
I am not allowed to change the code. Does anyone have an idea on how this problem can be solved.
Thanks and regards
Kumar VellalBtw java docs for the interface are available at:
http://java.sun.com/j2se/1.4.2/docs/api/java/util/Map.Entry.html
Changing the import should probably help compile the code, but without changing the import .. need to check. This is just from what i remember now. Lets see if anyone else comments on this. -
How come program wont accept import java.util ?
I get cannot resole symbol ?? i looked in up in my java book and its spelled right . what gives ?there is no class named java.util .
import java.util.ArrayList;
import java.util.EventObject;
or
import java.util.*; -
PI 7.1 Enhancement pack 8: still error when referencing java class in xslt
Hi
I am getting an error in PI 7.1 EP 8 Repository when I try to use an xslt in which I make a reference to a java class. The error is:
Transformer Configuration Exception occurred when loading XSLT XCBL_invoice_stylesheet.xsl; details: Could not compile stylesheet
I use this xslt:
<xsl:template match="/" xmlns:util="dk.dongenergy.pi.mapping.Utilities_datetime">
<html>
<B><xsl:text>Received: </xsl:text><xsl:value-of select="util:getCurrentDateTimeFormatted()"/>
I have imported the java archive successfully and it is working in XI 3.0 and it is working if I comment out the reference to the java class in the xslt.
the java class looks like this:
package dk.dongenergy.pi.mapping;
import java.text.SimpleDateFormat;
import java.util.Date;
public class Utilities_datetime {
* public static String getCurrentDateTimeFormatted() {*
* Date now = new Date();*
* SimpleDateFormat formatter = new SimpleDateFormat("dd MMM yyyy HH:mm:ss");*
* return formatter.format(now);*
We have applied enhancement pack 8 on PI 7.1 as suggewsted in this note, but that has not done the trick:
http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes/sdn_oss_bc_xi/~form/handler%7b5f4150503d3030323030363832353030303030303031393732265f4556454e543d444953504c4159265f4e4e554d3d31333235363833%7d
Any suggestions?
BR
MikaelHi Raj
That gives me this error log:
<br/>
<br/>
javax.ejb.EJBException: nested exception is: java.lang.RuntimeException: java.lang.UnsupportedClassVersionError: Bad version number in .class file java.lang.RuntimeException: java.lang.UnsupportedClassVersionError: Bad version number in .class file at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceedFinal(RequestInvocationContext.java:100) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:166) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatesTransition.invoke(Interceptors_StatesTransition.java:19) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Resource.invoke(Interceptors_Resource.java:71) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.doWorkWithAttribute(Interceptors_Transaction.java:38) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.invoke(Interceptors_Transaction.java:22) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:189) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatelessInstanceGetter.invoke(Interceptors_StatelessInstanceGetter.java:16) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_SecurityCheck.invoke(Interceptors_SecurityCheck.java:21) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_ExceptionTracer.invoke(Interceptors_ExceptionTracer.java:16) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.DefaultInvocationChainsManager.startChain(DefaultInvocationChainsManager.java:133) at com.sap.engine.services.ejb3.runtime.impl.DefaultEJBProxyInvocationHandler.invoke(DefaultEJBProxyInvocationHandler.java:164) at $Proxy1104.execute(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.sap.engine.services.rmi_p4.P4DynamicSkeleton.dispatch(P4DynamicSkeleton.java:234) at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:355) at com.sap.engine.services.rmi_p4.server.ServerDispatchImpl.run(ServerDispatchImpl.java:69) at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:67) at com.sap.engine.services.rmi_p4.P4Message.execute(P4Message.java:41) at com.sap.engine.services.cross.fca.FCAConnectorImpl.executeRequest(FCAConnectorImpl.java:977) at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:57) at com.sap.engine.services.cross.fca.MessageReader.run(MessageReader.java:55) at com.sap.engine.core.thread.execution.Executable.run(Executable.java:109) at com.sap.engine.core.thread.execution.CentralExecutor$SingleThread.run(CentralExecutor.java:314) Caused by: java.lang.UnsupportedClassVersionError: Bad version number in .class file at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:664) at java.lang.ClassLoader.defineClass(ClassLoader.java:509) at com.sap.aii.ib.server.mapping.execution.MappingLoader.findClass(MappingLoader.java:184) at java.lang.ClassLoader.loadClass(ClassLoader.java:350) at java.lang.ClassLoader.loadClass(ClassLoader.java:295) at com.sap.engine.lib.xsl.xpath.JLBLibrary.<init>(JLBLibrary.java:33) at com.sap.engine.lib.xsl.xpath.LibraryManager.getFunction(LibraryManager.java:63) at com.sap.engine.lib.xsl.xpath.ETFunction.evaluate(ETFunction.java:99) at com.sap.engine.lib.xsl.xpath.XPathProcessor.innerProcess(XPathProcessor.java:56) at com.sap.engine.lib.xsl.xpath.XPathProcessor.process(XPathProcessor.java:43) at com.sap.engine.lib.xsl.xpath.XPathProcessor.process(XPathProcessor.java:51) at com.sap.engine.lib.xsl.xslt.XSLValueOf.process(XSLValueOf.java:77) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296) at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:249) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296) at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:249) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296) at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:249) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296) at com.sap.engine.lib.xsl.xslt.XSLTemplate.process(XSLTemplate.java:273) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:470) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:438) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:395) at com.sap.engine.lib.jaxp.TransformerImpl.transformWithStylesheet(TransformerImpl.java:397) at com.sap.engine.lib.jaxp.TransformerImpl.transform(TransformerImpl.java:239) at com.sap.aii.ib.server.mapping.execution.AbstractMappingTransformer.transform(AbstractMappingTransformer.java:174) at com.sap.aii.ib.server.mapping.execution.XSLTMapping.executeStep(XSLTMapping.java:79) at com.sap.aii.ib.server.mapping.execution.Mapping.execute(Mapping.java:60) at com.sap.aii.ib.server.mapping.execution.MappingHandler.map(MappingHandler.java:87) at com.sap.aii.ib.server.mapping.execution.MappingHandler.map(MappingHandler.java:54) at com.sap.aii.ibrep.server.mapping.rt.MappingHandlerAdapter.run(MappingHandlerAdapter.java:139) at com.sap.aii.ibrep.server.mapping.exec.ExecuteIfMapCommand.execute(ExecuteIfMapCommand.java:33) at com.sap.aii.ib.server.mapping.exec.CommandManager.execute(CommandManager.java:43) at com.sap.aii.ibrep.server.mapping.ServerMapService.execute(ServerMapService.java:40) at com.sap.aii.ibrep.server.mapping.MapServiceBean.execute(MapServiceBean.java:40) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceedFinal(RequestInvocationContext.java:46) ... 32 more javax.ejb.EJBException: nested exception is: java.lang.RuntimeException: java.lang.UnsupportedClassVersionError: Bad version number in .class file at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceedFinal(RequestInvocationContext.java:100) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:166) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatesTransition.invoke(Interceptors_StatesTransition.java:19) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Resource.invoke(Interceptors_Resource.java:71) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.doWorkWithAttribute(Interceptors_Transaction.java:38) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.invoke(Interceptors_Transaction.java:22) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:189) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatelessInstanceGetter.invoke(Interceptors_StatelessInstanceGetter.java:16) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_SecurityCheck.invoke(Interceptors_SecurityCheck.java:21) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_ExceptionTracer.invoke(Interceptors_ExceptionTracer.java:16) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.DefaultInvocationChainsManager.startChain(DefaultInvocationChainsManager.java:133) at com.sap.engine.services.ejb3.runtime.impl.DefaultEJBProxyInvocationHandler.invoke(DefaultEJBProxyInvocationHandler.java:164) at $Proxy1104.execute(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.sap.engine.services.rmi_p4.P4DynamicSkeleton.dispatch(P4DynamicSkeleton.java:234) at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:355) at com.sap.engine.services.rmi_p4.server.ServerDispatchImpl.run(ServerDispatchImpl.java:69) at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:67) at com.sap.engine.services.rmi_p4.P4Message.execute(P4Message.java:41) at com.sap.engine.services.cross.fca.FCAConnectorImpl.executeRequest(FCAConnectorImpl.java:977) at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:57) at com.sap.engine.services.cross.fca.MessageReader.run(MessageReader.java:55) at com.sap.engine.core.thread.execution.Executable.run(Executable.java:109) at com.sap.engine.core.thread.execution.CentralExecutor$SingleThread.run(CentralExecutor.java:314) Caused by: java.lang.RuntimeException: java.lang.UnsupportedClassVersionError: Bad version number in .class file ... 33 more Caused by: java.lang.UnsupportedClassVersionError: Bad version number in .class file at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:664) at java.lang.ClassLoader.defineClass(ClassLoader.java:509) at com.sap.aii.ib.server.mapping.execution.MappingLoader.findClass(MappingLoader.java:184) at java.lang.ClassLoader.loadClass(ClassLoader.java:350) at java.lang.ClassLoader.loadClass(ClassLoader.java:295) at com.sap.engine.lib.xsl.xpath.JLBLibrary.<init>(JLBLibrary.java:33) at com.sap.engine.lib.xsl.xpath.LibraryManager.getFunction(LibraryManager.java:63) at com.sap.engine.lib.xsl.xpath.ETFunction.evaluate(ETFunction.java:99) at com.sap.engine.lib.xsl.xpath.XPathProcessor.innerProcess(XPathProcessor.java:56) at com.sap.engine.lib.xsl.xpath.XPathProcessor.process(XPathProcessor.java:43) at com.sap.engine.lib.xsl.xpath.XPathProcessor.process(XPathProcessor.java:51) at com.sap.engine.lib.xsl.xslt.XSLValueOf.process(XSLValueOf.java:77) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296) at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:249) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296) at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:249) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296) at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:249) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296) at com.sap.engine.lib.xsl.xslt.XSLTemplate.process(XSLTemplate.java:273) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:470) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:438) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:395) at com.sap.engine.lib.jaxp.TransformerImpl.transformWithStylesheet(TransformerImpl.java:397) at com.sap.engine.lib.jaxp.TransformerImpl.transform(TransformerImpl.java:239) at com.sap.aii.ib.server.mapping.execution.AbstractMappingTransformer.transform(AbstractMappingTransformer.java:174) at com.sap.aii.ib.server.mapping.execution.XSLTMapping.executeStep(XSLTMapping.java:79) at com.sap.aii.ib.server.mapping.execution.Mapping.execute(Mapping.java:60) at com.sap.aii.ib.server.mapping.execution.MappingHandler.map(MappingHandler.java:87) at com.sap.aii.ib.server.mapping.execution.MappingHandler.map(MappingHandler.java:54) at com.sap.aii.ibrep.server.mapping.rt.MappingHandlerAdapter.run(MappingHandlerAdapter.java:139) at com.sap.aii.ibrep.server.mapping.exec.ExecuteIfMapCommand.execute(ExecuteIfMapCommand.java:33) at com.sap.aii.ib.server.mapping.exec.CommandManager.execute(CommandManager.java:43) at com.sap.aii.ibrep.server.mapping.ServerMapService.execute(ServerMapService.java:40) at com.sap.aii.ibrep.server.mapping.MapServiceBean.execute(MapServiceBean.java:40) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceedFinal(RequestInvocationContext.java:46) ... 32 more
Edited by: mikael lund on Oct 26, 2009 10:51 AM -
'Cannot Resolve Symbol' error when importing custom class
I get this error...
c:\mydocu~1\n307\auto.java:14: cannot resolve symbol
symbol: class Box
import Box;
^
when I try to compile auto.java, the applet that's supposed to import the class Box, which I built to be like a message box in VB. Here is the code for Box...
import java.awt.*;
import java.awt.event.*;
public class Box extends Window{
Label lblMsg = new Label();
Button cmdOk = new Button("OK");
Panel pnlSouth = new Panel();
EventHandler ehdlr=new EventHandler(this);
public Box(Frame parent){
super(parent);
setLayout(new BorderLayout());
add(lblMsg, BorderLayout.NORTH);
add(pnlSouth, BorderLayout.SOUTH);
pnlSouth.setLayout(new FlowLayout());
pnlSouth.add(cmdOk);
cmdOk.addActionListener(ehdlr);
this.addWindowListener(ehdlr);
public void speak(String msg){
lblMsg.setText(msg);
this.setLocation(200,200);
this.setSize(200,200);
this.setVisible(true);
private class EventHandler extends WindowAdapter
implements ActionListener{
Window theWindow;
public EventHandler(Window a){
theWindow=a;
public void actionPerformed(ActionEvent e){
theWindow.setVisible(false);
AND HERE IS THE CODE FOR AUTO...
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.net.*;
import java.util.*;
import Box;
public class auto extends Applet implements ActionListener{
Panel pnlCenter=new Panel();
Panel pnlSouth=new Panel();
Panel pnlNorth=new Panel();
Panel pnlCenterleft=new Panel();
Panel pnlCenterright=new Panel();
Button cmdSubmit=new Button("Submit");
Button cmdNext=new Button("Next");
Button cmdPrev=new Button("Previous");
Label lblLoc=new Label("LOCATION:");
Label lblDate=new Label("DATE:");
Label lblMile=new Label("MILEAGE:");
Label lblCost=new Label("COST:");
Label lblDesc=new Label("DESCRIPTION:");
Label lblFind=new Label("FIND LOCATION:");
Label lblDisp=new Label();
TextField txtLoc=new TextField();
TextField txtDate=new TextField();
TextField txtMile=new TextField();
TextField txtCost=new TextField();
TextArea txtDesc=new TextArea();
TextField txtFind=new TextField();
Box bxOne = new Box((Frame(this).getParent()));
/*by declaring these four variables here, they are instance level, meaning they are
available to the whole applet*/
String textFile="auto.txt";
String list[] = new String[100];
String sort[] = new String[100];
int counter=0;
int count=0;
String currentLine="";
int i;
int sortcount;
public void init(){
this.setLayout(new BorderLayout());
this.add(pnlNorth, BorderLayout.NORTH);
this.add(pnlCenter, BorderLayout.CENTER);
this.add(pnlSouth, BorderLayout.SOUTH);
pnlNorth.setLayout(new FlowLayout());
pnlNorth.add(new Label("VIEW RECORDS"));
pnlCenter.setLayout(new GridLayout(1,2));
pnlCenter.add(pnlCenterleft);
pnlCenter.add(pnlCenterright);
pnlCenterleft.setLayout(new GridLayout(0,1));
pnlCenterleft.add(lblLoc);
pnlCenterleft.add(lblDate);
pnlCenterleft.add(lblMile);
pnlCenterleft.add(lblCost);
pnlCenterleft.add(lblDesc);
pnlCenterleft.add(lblFind);
pnlCenterright.setLayout(new GridLayout(0,1));
pnlCenterright.add(txtLoc);
pnlCenterright.add(txtDate);
pnlCenterright.add(txtMile);
pnlCenterright.add(txtCost);
pnlCenterright.add(txtDesc);
pnlCenterright.add(txtFind);
pnlSouth.setLayout(new FlowLayout());
pnlSouth.add(cmdPrev);
pnlSouth.add(lblDisp);
pnlSouth.add(cmdSubmit);
pnlSouth.add(cmdNext);
lblDisp.setText("0 of 0");
cmdPrev.addActionListener(this);
cmdNext.addActionListener(this);
cmdSubmit.addActionListener(this);
public void actionPerformed(ActionEvent e){
String command=e.getActionCommand();
if (command.equals("Next")){
if(txtLoc.getText().equals("")){
reader();
transfer();
writer();
bxOne.speak("Viewing all records");
}else{
if(counter<count-2){
counter++;
writer();
}else{
//don't move
} else if (command.equals("Previous")){
if(txtLoc.getText().equals("")){
//do nothing
}else{
if(counter>0){
counter--;
writer();
}else{
//don't move
} else {
txtLoc.setText("");
txtDate.setText("");
txtMile.setText("");
txtCost.setText("");
txtDesc.setText("");
reader();
sorter();
writer();
private void writer(){
StringTokenizer stCurrent=new StringTokenizer(sort[counter], "\t");
txtLoc.setText(stCurrent.nextToken());
txtDate.setText(stCurrent.nextToken());
txtMile.setText(stCurrent.nextToken());
txtCost.setText(stCurrent.nextToken());
txtDesc.setText(stCurrent.nextToken());
lblDisp.setText(String.valueOf(counter+1) + " of " + String.valueOf(count-1));
private void reader(){
try{
URL textURL=new URL(getDocumentBase(), textFile);
InputStream issIn=textURL.openStream();
InputStreamReader isrIn=new InputStreamReader(issIn);
BufferedReader brIn=new BufferedReader(isrIn);
while(currentLine!=null){
currentLine=brIn.readLine();
list[count]=currentLine;
count++;
}catch(MalformedURLException exc){
System.out.println("MalformedURLException Error");
}catch(IOException exc){
System.out.println("IOException Error");
}catch(NullPointerException exc){
System.out.println("NullPointerException Error");
private void transfer(){
for(i=0;i<count;i++){
sort=list[i];
private void sorter(){
sortcount=0;
String find=txtFind.getText();
System.out.println(String.valueOf(count));
for(i=0;i<count-1;i++){
StringTokenizer st=new StringTokenizer(list[i], "\t");
String next=st.nextToken();
if (find.equals(next)){
sort[sortcount]=list[i];
sortcount++;
count=sortcount+1;
Any help is greatly appreciated.
2Willis4Hi agian,
I looked closer at your code, I think if you play around with directories and paths, you'll get it, and I think also when you import, you have to have put the class in a package...? Maybe? Blind leading the blind here! So at the top of your box class you have to say something like
package org.blah.lala
and you have to have that directory structure for the class files org/blah/lala/Box.class
Does that make sense?
And then when you import you say:
import org.blah.lala.Box
(I think)
I cna only imagine that this 'help' I am giving you would be hilarious to a more experienced programmer!
Anyway, best of luck. -
Error when starting Java(TM) ME Platform SDK 3.0
hey guys, I get this error when starting Java(TM) ME Platform SDK 3.0. When I installed it it installed 'successfully' and then I double clicked the file on the desktop (I'm using Windows Vista 32bit Home premium) and it gave me the following error when saying 'Starting Modules':-------------------------------------------------------------------------------
Log Session: Sunday, February 13, 2011 1:52:25 PM GMT
System Info: Product Version = Java(TM) ME Platform SDK 3.0
Operating System = Windows Vista version 6.0 running on x86
Java; VM; Vendor = 1.6.0_23; Java HotSpot(TM) Client VM 19.0-b09; Sun Microsystems Inc.
Runtime = Java(TM) SE Runtime Environment 1.6.0_23-b05
Java Home = C:\Program Files\Java\jdk1.6.0_23\jre
System Locale; Encoding = en_GB (cdctoolbar); Cp1252
Home Directory = C:\Users\Molten Ice
Current Directory = C:\Program Files\Java\Java_ME_platform_SDK_3.0\bin
User Directory = C:\Users\Molten Ice\javame-sdk\toolbar\3.0
Installation = C:\Program Files\Java\Java_ME_platform_SDK_3.0\toolbar\javamesdk1
C:\Program Files\Java\Java_ME_platform_SDK_3.0\toolbar\ide10
C:\Program Files\Java\Java_ME_platform_SDK_3.0\toolbar\java2
C:\Program Files\Java\Java_ME_platform_SDK_3.0\toolbar\mobility8
C:\Program Files\Java\Java_ME_platform_SDK_3.0\toolbar\profiler2
C:\Program Files\Java\Java_ME_platform_SDK_3.0\toolbar\platform9
Boot & Ext. Classpath = C:\Program Files\Java\jdk1.6.0_23\jre\lib\resources.jar;C:\Program Files\Java\jdk1.6.0_23\jre\lib\rt.jar;C:\Program Files\Java\jdk1.6.0_23\jre\lib\sunrsasign.jar;C:\Program Files\Java\jdk1.6.0_23\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.6.0_23\jre\lib\jce.jar;C:\Program Files\Java\jdk1.6.0_23\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.6.0_23\jre\lib\modules\jdk.boot.jar;C:\Program Files\Java\jdk1.6.0_23\jre\classes;C:\Program Files\Java\jdk1.6.0_23\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.6.0_23\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.6.0_23\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.6.0_23\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.6.0_23\jre\lib\ext\sunpkcs11.jar
Application Classpath = C:\Program Files\Java\Java_ME_platform_SDK_3.0\toolbar\platform9\lib\boot.jar;C:\Program Files\Java\Java_ME_platform_SDK_3.0\toolbar\platform9\lib\org-openide-modules.jar;C:\Program Files\Java\Java_ME_platform_SDK_3.0\toolbar\platform9\lib\org-openide-util.jar;C:\Program Files\Java\jdk1.6.0_23\lib\dt.jar;C:\Program Files\Java\jdk1.6.0_23\lib\tools.jar
Startup Classpath = C:\Program Files\Java\Java_ME_platform_SDK_3.0\toolbar\platform9\core\core.jar;C:\Program Files\Java\Java_ME_platform_SDK_3.0\toolbar\platform9\core\org-openide-filesystems.jar;C:\Program Files\Java\Java_ME_platform_SDK_3.0\toolbar\javamesdk1\core\locale\core_cdctoolbar.jar
WARNING [org.netbeans.core.projects.cache]: Inefficient to include an empty layer in a module: jar:file:/C:/Program%20Files/Java/Java_ME_platform_SDK_3.0/toolbar/javamesdk1/modules/org-netbeans-modules-javame-common.jar!/org/netbeans/modules/javame/common/resources/layer.xml
WARNING [org.netbeans.core.projects.cache]: Inefficient to include an empty layer in a module: jar:file:/C:/Program%20Files/Java/Java_ME_platform_SDK_3.0/toolbar/javamesdk1/modules/org-netbeans-modules-e2e.jar!/org/netbeans/modules/e2e/layer.xml
WARNING [org.openide.filesystems.Ordering]: Not all children in Services/MIMEResolver/ marked with the position attribute: [org-netbeans-modules-javame-netmon-data-NetMonDataResolver.xml], but some are: [org-netbeans-modules-java-mime-resolver.xml, org-apache-tools-ant-module-mime-resolver.xml, org-netbeans-modules-editor-settings-storage-mime-resolver.xml, org-netbeans-modules-url-mime-resolver.xml, org-netbeans-modules-pdf-mime-resolver.xml, org-netbeans-modules-jar-mime-resolver.xml, org-netbeans-modules-editor-codetemplates-mime-resolver.xml]
WARNING [org.openide.filesystems.Ordering]: Not all children in Services/MIMEResolver/ marked with the position attribute: [org-netbeans-modules-javame-netmon-data-NetMonDataResolver.xml], but some are: [org-netbeans-modules-java-mime-resolver.xml, org-apache-tools-ant-module-mime-resolver.xml, org-netbeans-modules-editor-settings-storage-mime-resolver.xml, org-netbeans-modules-url-mime-resolver.xml, org-netbeans-modules-pdf-mime-resolver.xml, org-netbeans-modules-jar-mime-resolver.xml, org-netbeans-modules-editor-codetemplates-mime-resolver.xml]
[ 0] INFO - ootstrap.PropertyEditorManager - Registering custom property editors
[ 117] INFO - bootstrap.ObjectGraphProcessor - Consolidating dependencies...
[ 217] INFO - bootstrap.ObjectGraphProcessor - Consolidated dependencies...
[ 317] INFO - bootstrap.ObjectGraphProcessor - Calculating order...
[ 417] INFO - bootstrap.ObjectGraphProcessor - Calculated order
[ 523] INFO - un.jme.toolkit.bootstrap.Batch - Initializing objects...
[ 627] INFO - un.jme.toolkit.bootstrap.Batch - Applying I18N
[ 732] INFO - un.jme.toolkit.bootstrap.Batch - Initialized objects
[ 832] INFO - un.jme.toolkit.bootstrap.Batch - Calling create() methods...
[ 932] INFO - un.jme.toolkit.bootstrap.Batch - Calling start() methods...
[ 1032] INFO - mpl.ObjectServerConnectionImpl - Connecting to service:jmx:rmi:///jndi/rmi://127.0.0.1:1999/device-manager
[ 2166] WARN - mpl.ObjectServerConnectionImpl - Remote object server is not running at service:jmx:rmi:///jndi/rmi://127.0.0.1:1999/device-manager
[ 2268] INFO - l.process.GenericProcessRunner - Starting process: C:\Program Files\Java\Java_ME_platform_SDK_3.0/bin/device-manager.exe
[ 3384] INFO - mpl.ObjectServerConnectionImpl - Connecting to service:jmx:rmi:///jndi/rmi://127.0.0.1:1999/device-manager
[ 5476] INFO - mpl.ObjectServerConnectionImpl - Connecting to service:jmx:rmi:///jndi/rmi://127.0.0.1:1999/device-manager
[ 7576] INFO - mpl.ObjectServerConnectionImpl - Connecting to service:jmx:rmi:///jndi/rmi://127.0.0.1:1999/device-manager
[ 9677] INFO - mpl.ObjectServerConnectionImpl - Connecting to service:jmx:rmi:///jndi/rmi://127.0.0.1:1999/device-manager
[ 11777] INFO - mpl.ObjectServerConnectionImpl - Connecting to service:jmx:rmi:///jndi/rmi://127.0.0.1:1999/device-manager
[ 13877] INFO - mpl.ObjectServerConnectionImpl - Connecting to service:jmx:rmi:///jndi/rmi://127.0.0.1:1999/device-manager
[ 15977] INFO - mpl.ObjectServerConnectionImpl - Connecting to service:jmx:rmi:///jndi/rmi://127.0.0.1:1999/device-manager
[ 18077] INFO - mpl.ObjectServerConnectionImpl - Connecting to service:jmx:rmi:///jndi/rmi://127.0.0.1:1999/device-manager
[ 20177] INFO - mpl.ObjectServerConnectionImpl - Connecting to service:jmx:rmi:///jndi/rmi://127.0.0.1:1999/device-manager
[ 22277] INFO - mpl.ObjectServerConnectionImpl - Connecting to service:jmx:rmi:///jndi/rmi://127.0.0.1:1999/device-manager
[ 23379] ERROR - un.jme.toolkit.bootstrap.Batch - Problem calling start() on DeviceManagerConnection
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.jme.toolkit.bootstrap.Batch.invoke(Unknown Source)
at com.sun.jme.toolkit.bootstrap.Batch.tryInvoke(Unknown Source)
at com.sun.jme.toolkit.bootstrap.Batch.startObjects(Unknown Source)
at org.netbeans.modules.javame.common.container.Module.start(Module.java:21)
at org.netbeans.modules.javame.common.container.ContainerSupport.startModule(ContainerSupport.java:67)
at org.netbeans.modules.javame.common.container.devicemanager.DevicemanagerHelper.getDeviceManagerConnection(DevicemanagerHelper.java:41)
at org.netbeans.modules.javame.common.container.devicemanager.DevicemanagerHelper.ensureConnected(DevicemanagerHelper.java:48)
at org.netbeans.modules.javame.common.container.devicemanager.DevicemanagerHelper.getDeviceManager(DevicemanagerHelper.java:84)
at org.netbeans.modules.javame.platform.jme_sdk.autoinstaller.AutoInstaller.ensureDMStarted(AutoInstaller.java:292)
at org.netbeans.modules.javame.platform.jme_sdk.autoinstaller.AutoInstaller.restored(AutoInstaller.java:63)
at org.netbeans.core.startup.NbInstaller.loadCode(NbInstaller.java:421)
at org.netbeans.core.startup.NbInstaller.load(NbInstaller.java:342)
at org.netbeans.ModuleManager.enable(ModuleManager.java:906)
at org.netbeans.core.startup.ModuleList.installNew(ModuleList.java:428)
at org.netbeans.core.startup.ModuleList.trigger(ModuleList.java:364)
at org.netbeans.core.startup.ModuleSystem.restore(ModuleSystem.java:276)
at org.netbeans.core.startup.Main.getModuleSystem(Main.java:165)
at org.netbeans.core.startup.Main.start(Main.java:312)
at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:110)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is:
java.net.ConnectException: Connection refused: connect]
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:338)
at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:248)
at com.sun.jme.toolkit.remoting.client.rmiimpl.ObjectServerConnectionImpl.connect(Unknown Source)
at com.sun.jme.toolkit.remoting.client.rmiimpl.ObjectServerConnectionImpl.start(Unknown Source)
... 24 more
Caused by: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is:
java.net.ConnectException: Connection refused: connect]
at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:101)
at com.sun.jndi.toolkit.url.GenericURLContext.lookup(GenericURLContext.java:185)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at javax.management.remote.rmi.RMIConnector.findRMIServerJNDI(RMIConnector.java:1886)
at javax.management.remote.rmi.RMIConnector.findRMIServer(RMIConnector.java:1856)
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:257)
... 27 more
Caused by: java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is:
java.net.ConnectException: Connection refused: connect
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:601)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:322)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:97)
... 32 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at java.net.Socket.connect(Socket.java:478)
at java.net.Socket.<init>(Socket.java:375)
at java.net.Socket.<init>(Socket.java:189)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:595)
... 37 more
SEVERE [org.netbeans.modules.javame.common.container.devicemanager.DevicemanagerHelper]: Cannot connect to device manager
java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at java.net.Socket.connect(Socket.java:478)
at java.net.Socket.<init>(Socket.java:375)
at java.net.Socket.<init>(Socket.java:189)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:595)
Caused: java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is:
java.net.ConnectException: Connection refused: connect
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:601)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:322)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:97)
Caused: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is:
java.net.ConnectException: Connection refused: connect]
at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:101)
at com.sun.jndi.toolkit.url.GenericURLContext.lookup(GenericURLContext.java:185)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at javax.management.remote.rmi.RMIConnector.findRMIServerJNDI(RMIConnector.java:1886)
at javax.management.remote.rmi.RMIConnector.findRMIServer(RMIConnector.java:1856)
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:257)
Caused: java.io.IOException: Failed to retrieve RMIServer stub
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:338)
at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:248)
at com.sun.jme.toolkit.remoting.client.rmiimpl.ObjectServerConnectionImpl.connect(Unknown Source)
at com.sun.jme.toolkit.remoting.client.rmiimpl.ObjectServerConnectionImpl.start(Unknown Source)
Caused: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.jme.toolkit.bootstrap.Batch.invoke(Unknown Source)
at com.sun.jme.toolkit.bootstrap.Batch.tryInvoke(Unknown Source)
at com.sun.jme.toolkit.bootstrap.Batch.startObjects(Unknown Source)
at org.netbeans.modules.javame.common.container.Module.start(Module.java:21)
at org.netbeans.modules.javame.common.container.ContainerSupport.startModule(ContainerSupport.java:67)
at org.netbeans.modules.javame.common.container.devicemanager.DevicemanagerHelper.getDeviceManagerConnection(DevicemanagerHelper.java:41)
at org.netbeans.modules.javame.common.container.devicemanager.DevicemanagerHelper.ensureConnected(DevicemanagerHelper.java:48)
[catch] at org.netbeans.modules.javame.common.container.devicemanager.DevicemanagerHelper.getDeviceManager(DevicemanagerHelper.java:84)
at org.netbeans.modules.javame.platform.jme_sdk.autoinstaller.AutoInstaller.ensureDMStarted(AutoInstaller.java:292)
at org.netbeans.modules.javame.platform.jme_sdk.autoinstaller.AutoInstaller.restored(AutoInstaller.java:63)
at org.netbeans.core.startup.NbInstaller.loadCode(NbInstaller.java:421)
at org.netbeans.core.startup.NbInstaller.load(NbInstaller.java:342)
at org.netbeans.ModuleManager.enable(ModuleManager.java:906)
at org.netbeans.core.startup.ModuleList.installNew(ModuleList.java:428)
at org.netbeans.core.startup.ModuleList.trigger(ModuleList.java:364)
at org.netbeans.core.startup.ModuleSystem.restore(ModuleSystem.java:276)
at org.netbeans.core.startup.Main.getModuleSystem(Main.java:165)
at org.netbeans.core.startup.Main.start(Main.java:312)
at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:110)
at java.lang.Thread.run(Thread.java:662)
[ 23598] INFO - bootstrap.ObjectGraphProcessor - Consolidating dependencies...
[ 23698] INFO - bootstrap.ObjectGraphProcessor - Consolidated dependencies...
[ 23798] INFO - bootstrap.ObjectGraphProcessor - Calculating order...
[ 23898] INFO - bootstrap.ObjectGraphProcessor - Calculated order
[ 23998] INFO - un.jme.toolkit.bootstrap.Batch - Initializing objects...
[ 24098] INFO - un.jme.toolkit.bootstrap.Batch - Applying I18N
[ 24198] INFO - un.jme.toolkit.bootstrap.Batch - Initialized objects
[ 24298] INFO - un.jme.toolkit.bootstrap.Batch - Calling create() methods...
[ 24398] INFO - un.jme.toolkit.bootstrap.Batch - Calling start() methods...
[ 24498] INFO - un.jme.toolkit.bootstrap.Batch - Objects started
[ 24600] INFO - bootstrap.ObjectGraphProcessor - Consolidating dependencies...
[ 24700] INFO - bootstrap.ObjectGraphProcessor - Consolidated dependencies...
[ 24800] INFO - bootstrap.ObjectGraphProcessor - Calculating order...
[ 24900] INFO - bootstrap.ObjectGraphProcessor - Calculated order
[ 25000] INFO - un.jme.toolkit.bootstrap.Batch - Initializing objects...
[ 25100] INFO - un.jme.toolkit.bootstrap.Batch - Applying I18N
[ 25202] INFO - un.jme.toolkit.bootstrap.Batch - Initialized objects
[ 25302] INFO - un.jme.toolkit.bootstrap.Batch - Calling create() methods...
[ 25402] INFO - un.jme.toolkit.bootstrap.Batch - Calling start() methods...
[ 25502] INFO - un.jme.toolkit.bootstrap.Batch - Objects started
[ 25602] INFO - mpl.ObjectServerConnectionImpl - Connecting to service:jmx:rmi:///jndi/rmi://127.0.0.1:1999/device-manager
[ 26699] WARN - mpl.ObjectServerConnectionImpl - Remote object server is not running at service:jmx:rmi:///jndi/rmi://127.0.0.1:1999/device-manager
[ 26799] INFO - l.process.GenericProcessRunner - Starting process: C:\Program Files\Java\Java_ME_platform_SDK_3.0/bin/device-manager.exe
[ 27914] INFO - mpl.ObjectServerConnectionImpl - Connecting to service:jmx:rmi:///jndi/rmi://127.0.0.1:1999/device-manager
[ 30005] INFO - mpl.ObjectServerConnectionImpl - Connecting to service:jmx:rmi:///jndi/rmi://127.0.0.1:1999/device-manager
[ 32106] INFO - mpl.ObjectServerConnectionImpl - Connecting to service:jmx:rmi:///jndi/rmi://127.0.0.1:1999/device-manager
[ 34206] INFO - mpl.ObjectServerConnectionImpl - Connecting to service:jmx:rmi:///jndi/rmi://127.0.0.1:1999/device-manager
[ 36306] INFO - mpl.ObjectServerConnectionImpl - Connecting to service:jmx:rmi:///jndi/rmi://127.0.0.1:1999/device-manager
[ 38406] INFO - mpl.ObjectServerConnectionImpl - Connecting to service:jmx:rmi:///jndi/rmi://127.0.0.1:1999/device-manager
[ 40506] INFO - mpl.ObjectServerConnectionImpl - Connecting to service:jmx:rmi:///jndi/rmi://127.0.0.1:1999/device-manager
[ 42607] INFO - mpl.ObjectServerConnectionImpl - Connecting to service:jmx:rmi:///jndi/rmi://127.0.0.1:1999/device-manager
[ 44706] INFO - mpl.ObjectServerConnectionImpl - Connecting to service:jmx:rmi:///jndi/rmi://127.0.0.1:1999/device-manager
[ 46806] INFO - mpl.ObjectServerConnectionImpl - Connecting to service:jmx:rmi:///jndi/rmi://127.0.0.1:1999/device-manager
SEVERE [org.netbeans.modules.javame.common.container.devicemanager.DevicemanagerHelper]: Cannot connect to device manager
java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at java.net.Socket.connect(Socket.java:478)
at java.net.Socket.<init>(Socket.java:375)
at java.net.Socket.<init>(Socket.java:189)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:595)
Caused: java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is:
java.net.ConnectException: Connection refused: connect
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:601)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:322)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:97)
Caused: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is:
java.net.ConnectException: Connection refused: connect]
at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:101)
at com.sun.jndi.toolkit.url.GenericURLContext.lookup(GenericURLContext.java:185)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at javax.management.remote.rmi.RMIConnector.findRMIServerJNDI(RMIConnector.java:1886)
at javax.management.remote.rmi.RMIConnector.findRMIServer(RMIConnector.java:1856)
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:257)
Caused: java.io.IOException: Failed to retrieve RMIServer stub
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:338)
at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:248)
at com.sun.jme.toolkit.remoting.client.rmiimpl.ObjectServerConnectionImpl.connect(Unknown Source)
at com.sun.jme.toolkit.remoting.client.rmiimpl.ObjectServerConnectionImpl.start(Unknown Source)
at com.sun.jme.toolkit.remoting.client.rmiimpl.ObjectServerConnectionImpl.lookupMBean(Unknown Source)
at com.sun.jme.toolkit.remoting.client.rmiimpl.ObjectServerConnectionImpl.findObject(Unknown Source)
[catch] at org.netbeans.modules.javame.common.container.devicemanager.DevicemanagerHelper.openConnection(DevicemanagerHelper.java:53)
at org.netbeans.modules.javame.common.container.devicemanager.DevicemanagerHelper.getDeviceManager(DevicemanagerHelper.java:86)
at org.netbeans.modules.javame.platform.jme_sdk.autoinstaller.AutoInstaller.ensureDMStarted(AutoInstaller.java:292)
at org.netbeans.modules.javame.platform.jme_sdk.autoinstaller.AutoInstaller.restored(AutoInstaller.java:63)
at org.netbeans.core.startup.NbInstaller.loadCode(NbInstaller.java:421)
at org.netbeans.core.startup.NbInstaller.load(NbInstaller.java:342)
at org.netbeans.ModuleManager.enable(ModuleManager.java:906)
at org.netbeans.core.startup.ModuleList.installNew(ModuleList.java:428)
at org.netbeans.core.startup.ModuleList.trigger(ModuleList.java:364)
at org.netbeans.core.startup.ModuleSystem.restore(ModuleSystem.java:276)
at org.netbeans.core.startup.Main.getModuleSystem(Main.java:165)
at org.netbeans.core.startup.Main.start(Main.java:312)
at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:110)
at java.lang.Thread.run(Thread.java:662)
[ 48018] INFO - bootstrap.ObjectGraphProcessor - Consolidating dependencies...
[ 48118] INFO - bootstrap.ObjectGraphProcessor - Consolidated dependencies...
[ 48218] INFO - bootstrap.ObjectGraphProcessor - Calculating order...
[ 48318] INFO - bootstrap.ObjectGraphProcessor - Calculated order
[ 48418] INFO - un.jme.toolkit.bootstrap.Batch - Initializing objects...
[ 48518] INFO - un.jme.toolkit.bootstrap.Batch - Applying I18N
[ 48618] INFO - un.jme.toolkit.bootstrap.Batch - Initialized objects
[ 48718] INFO - un.jme.toolkit.bootstrap.Batch - Calling create() methods...
[ 48818] INFO - un.jme.toolkit.bootstrap.Batch - Calling start() methods...
[ 48918] INFO - un.jme.toolkit.bootstrap.Batch - Objects started
[ 49018] INFO - bootstrap.ObjectGraphPI did install Nokia's SDK with NetBeans and this works perfectly.
I went through with everything recommended here: http://blogs.sun.com/javamesdk/entry/first_aid_when_emulator_doesn
But nothing worked.
Any help appreciated!
Thanks.Note: This thread was originally posted in the [Sun Java Wireless Toolkit|http://forums.sun.com/forum.jspa?forumID=82] forum, but moved to this forum for closer topic alignment.
-
Hi all,
In the JSP ,if I include the statement <%@ page import="jack.samples.*" %>
it is throwing following error:
This is the Error Message from the Exception:
Server caught unhandled exception from servlet [BaseServlet]: Server caught
unhandled exception from servlet [CategoryDisplay]: Server caught unhandled
exception from servlet [jsp]: Fatal Error: missing resource: java.util.PropertyResourceBundle
I am using Websphere 3.5 on Windows NT.
can somebody please help me what is going wrong here ???I am stopped at
this problem for last 2 days.
Thanks
JackHi,
Finally I was able to resolve after adding this jar file to the classfile
path of the application.
Now,I am trying to access use linkTable.add(new Item(222,"222","333",12.33)) in JSP.
where linkTable is a LinkedList.
It fails giving following error:
This is the Error Message from the Exception:
Server caught unhandled exception from servlet [BaseServlet]: Server caught unhandled exception from servlet : Server caught unhandled exception from servlet [jsp]: Compilation of "softproduct.jsp" failed: d:\ibm\WAServer\temp\default_host\WCSServlets\_jameco_2F_softproduct_2E_jsp_jsp_2.java:824: No constructor matching Item(int, java.lang.String, java.lang.String, double) found in class jack.samples.Item. linkTab.add(new Item(2222,"222","222",22.33)); ^ Note: d:\ibm\WAServer\temp\default_host\WCSServlets\_jameco_2F_softproduct_2E_jsp_jsp_2.java uses or overrides a deprecated API. Recompile with "-deprecation" for details. 1 error, 1 warning
I dont understand why it is failing to add Item object to LinkedList.
can somebody help me in the forum in this regard.
Thanks
Jack -
Error in Import JAVA DUMP phase in Solution Manager installation.
Hi,
when i am installing Solution manager i am getting error in import java dump phase on windows and oracle database. i installed java 1.4.2_09 . plz anybody give the solution. Its very urgent.
Thanks,
Venkat.Hi,
1. Did you select java path (Export CD/DVD) while intsallation? Check once again.
2. Add JAVA_HOME = Java path in environment variable.
3. What is the exact error, you got it, post error here.
Regards,
Srini Nookala -
Cannot import java.util.concurrent.locks ... WHY?
Why is Xcode unable to find the java.util.concurrent.locks package. The class browser knows it exists. For example the entry for the ReentrantLock class looks like this in the browser class window:
ReentrantLock (java.util.concurrent.locks)
Xcode knows about other java.util packages such as java.util.ResourceBundle which I have been accessed successfully in other parts of my projecgt.
Here is a source file and the resulting compiler error:
The source file:
// Foo.java
import java.util.ResourceBundle;
import java.util.concurrent.locks;
public class Foo { }
The compiler error:
compile:
Compiling 2 source files to /Users/Terry/Desktop/JAVA/PROJECTS/Logic/bin
/Users/Terry/Desktop/JAVA/PROJECTS/Logic/src/Foo.java:3: cannot find symbol
symbol : class locks
location: package java.util.concurrent
import java.util.concurrent.locks;
^
1 error
BUILD FAILED
Help or hints would be greatly appreciated!Well the reason to your problem is very simple... java.util.concurrent.locks is a package... Not a class.
if you want to import a specific class, the class should be written at the end like you did for import java.util.ResourceBundle; but if you want to import a whole package you need to add the little star at the end :
import java.util.concurrent.locks.*;
Or else, you only import the class you need :
import java.util.concurrent.locks.ReentrantLock; -
USage of import java.util.* & using another package
When we use import java.util.*; from where does JAVA take the class that are related to util, when I did search for "util" in my machine, I got about 50 results for folders named util and also some where in a folder called "java" when I opened it it did not have the classes, that I was expecting. So I am not clear where does it get the class files from. This is not only for this but for any import commands like import java.io.*;
When we get another package or source code which was written in java and want to use it in our code where do we have keep the files ? eg. i have the java code that i m writing in c:\java then do I put all the downloaded related files in that folder and then run the code ? or i keep a folder inside java folder and then import them into my code ?
please do advice.
Thanks in advance.When we use import java.util.*; from where does JAVA
take the class that are related to util,It means when you use a classname in your code, and that classname is neither in the same package as the class you're writing, nor imported specifically by classname, that it will search for it.
Where it searches is every folder called util whose parent folder is called java which in turn is at the root level of one of the classpath elements. That is, if classpath contains "A" and "B", and you refer to a class called "Foo", then it will look for "A/java/util/Foo.class" and "B/java/util/Foo.class".
search for "util" in my machine, I got about 50
results for folders named util and also some where in
a folder called "java" when I opened it it did not
have the classes, that I was expecting. So I am not
clear where does it get the class files from. This is
not only for this but for any import commands like
import java.io.*; All the java.* and javax.* and whatever else it part of the core API is in rt.jar, which lives inside the Java distribution. Classpath elements can be directories or jar files or zip files. -
Question on import java.util.ArrayList, etc.
Hi,
I was wondering what the following meant and what the differences were. When would I have to use these:
import java.util.ArrayList;
import java.util.Collections; <--I especially don't understand what this means
import java.util.Comparator; <---same for this (can I consolidate these into the bottom two?)
import java.io.*;
import java.util.*;MAresJonson wrote:
Also, what does this mean:
return foo == f.getFoo() ? true : false;
(more specifically...what does the "? true : false" mean and is there another way to code that?)It's called the ternary operator. For your specific example, you could just do:
return foo == f.getFoo();But, more generally,
return foo == f.getFoo() ? "equal" : "Not equal";means:
if (foo == f.getFoo()) {
return "equal";
else {
return "Not equal";
}As everyone else said at the same time... -
Import java.util.Enumeration;
Hi, I test a programmer under eclipe
I can import java.util.Enumeration;(error on Enumeration)
and Vector connections = null;
Enumeration enum = connections.elements();
while (enum.hasMoreElements())
do something
I got error Enumeration can't not be resolve/
why?
and how to modify to change it?Hi, I test a programmer under eclipe Maybe should test the program, not the programmer ;-)
Maybe you are looking for
-
Editing Acrobat 9.0 Bates numered document in Acrobat 8.0
We have Bates numbered a document in Acrobat 9.0, but aren't able to edit the Bates numbering in Acrobat 8.0. Is there a way to patch 8.0 to allow it to work with documents that have been saved in 9.0? We will probably run into this problem with othe
-
Why can't I send a screenshot to Adobe Reader in order to annotate it or highlight phrases?
Hello! I am unable to do the abovementionned task. Why? Is it possible, if yes, how? Thank you!
-
Exporting HiDef Movies To iTunes?
Kind People, I have shot video with my Canon Vixia HF10 camcorder. I edited that video using FCE. I've exported and burned those movies to DVDs with iDVD. Life is beautiful! I have wide screen HiDef movies to share with family and friends. However, w
-
Transports are taking longer time in Production compared to Quality in BI s
Hi All Could anyone please help me to solve this issue. In my BI systems , transports which are moving to production are usually taking much longer time usually double the time than Quality. Please help me to solve this... Regards Bala
-
Saving queries executed in Oracle Text
I am gathering information on Oracle Text for use as a text query capability. My users would like to be able to execute the same queries so would like the ability to save their query parameters. Is this available in Oracle Text?