Finding classes
Hello all,
I am writing an applet that will paint on a canvas, and need to get the width and height of the canvas. When I use the getWidth() and getHeight() methods of canvas, I get a methodNotFoundException. I presume this is because the 1.1 spec doesn't have these methods. The WIDTH and HEIGHT fields in canvas don't make much sense... the frame in which I put the canvas is 300 square, but the fields hold 1 and 2 respectively.
I thought a way around this might be to use include the 1.2 version of Canvas in the applets jar... but it didn't seem to help (I thought that if the browser couldn't find a class with the methods in it's library, then it would look to the jar).
What do I do?
Thanx in advance Jj.
Have you tried using "getSize().height" and "getSize().width"?
Similar Messages
-
hi ,OTN
I have an ADF 10g application which I migrate to Jdeveloper 11.1.1.3.0 version after migration and turning Adf faces to Apache Trinidad components and fixing all my code,compiling the application without any Errors,when I deployed my application to weblogic I had a deployment exception this is all the stack trace
User defined listener com.sun.faces.config.ConfigureListener failed: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED!
Cause: Unable to find class 'oracle.adf.controller.faces.lifecycle.ADFPhaseListener '
com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED!
Cause: Unable to find class 'oracle.adf.controller.faces.lifecycle.ADFPhaseListener'
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:212)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:195)
at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:481)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
Truncated. see log file for complete stacktrace
Caused By: com.sun.faces.config.ConfigurationException:
Cause: Unable to find class 'oracle.adf.controller.faces.lifecycle.ADFPhaseListener'
at com.sun.faces.config.processor.AbstractConfigProcessor.createInstance(AbstractConfigProcessor.java:248)
at com.sun.faces.config.processor.LifecycleConfigProcessor.addPhaseListeners(LifecycleConfigProcessor.java:141)
at com.sun.faces.config.processor.LifecycleConfigProcessor.process(LifecycleConfigProcessor.java:114)
at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:108)
at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:132)
Truncated. see log file for complete stacktrace
<08/10/2010 EET 04:11:11 م> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID '1286547027015' for task '0'. Error is: 'weblogic.application.ModuleException: '
weblogic.application.ModuleException:
at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1514)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:486)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
Truncated. see log file for complete stacktrace
Caused By: com.sun.faces.config.ConfigurationException:
Cause: Unable to find class 'oracle.adf.controller.faces.lifecycle.ADFPhaseListener'
at com.sun.faces.config.processor.AbstractConfigProcessor.createInstance(AbstractConfigProcessor.java:248)
at com.sun.faces.config.processor.LifecycleConfigProcessor.addPhaseListeners(LifecycleConfigProcessor.java:141)
at com.sun.faces.config.processor.LifecycleConfigProcessor.process(LifecycleConfigProcessor.java:114)
at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:108)
at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:132)
Truncated. see log file for complete stacktrace
>
<08/10/2010 EET 04:11:11 م> <Error> <Deployer> <BEA-149202> <Encountered an exception while attempting to commit the 1 task for the application 'Version4'.>
<08/10/2010 EET 04:11:11 م> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating deploy task for application 'Version4'.>
<08/10/2010 EET 04:11:11 م> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004
weblogic.application.ModuleException: :com.sun.faces.config.ConfigurationException:
Source Document: file:/C:/Documents and Settings/Administrator/Application Data/JDeveloper/system11.1.1.3.37.56.60/o.j2ee/drs/Version4/ViewControllerWebApp.war/WEB-INF/faces-config.xml
Cause: Unable to find class 'oracle.adf.controller.faces.lifecycle.ADFPhaseListener'
at com.sun.faces.config.processor.AbstractConfigProcessor.createInstance(AbstractConfigProcessor.java:248)
at com.sun.faces.config.processor.LifecycleConfigProcessor.addPhaseListeners(LifecycleConfigProcessor.java:141)
at com.sun.faces.config.processor.LifecycleConfigProcessor.process(LifecycleConfigProcessor.java:114)
at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:108)
at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:132)
Truncated. see log file for complete stacktrace
help please?thank you for quick reply. but I ran my application in the integrated weblogic server in the Jdeveloper.I did not deploy it to a standalone one.did you mean the default domain?
-
Unable to find class oracle.panama.personalization.login
oracle.jsp.parse.JspParseException: Line # 21, Error: Unable to find class for bean: login defined by tag with class: oracle.panama.personalization.login
I get this message when trying to go to "http://{hostname}/papz/login.jsp"
window 2k, Oracle 8.1.7, 9iASwe 1.0.2.0.0.
Any help would be great.
Thanks in advance
Sean.I'm also having this problem. Could really use some help
-
I created a project, and a JavaBean that connects to the database and I want to use it in a JSP page that exists in my project.
Bean:
package BeerPackage;
import java.sql.*;
public class ConnectionBean
JSP:
<%@ page import="BeerPackage.*" contentType="text/html;charset=windows-1252"%>
<jsp:useBean id="connection" class="ConnectionBean" scope="session"/>
Then I get the error:
Error(2): Unable to find class for bean: connection defined by tag with class: ConnectionBean
When I try to build the JSP
Any ideas?Seems even though I have an import, I still have to specify the package name in front of the useBean.
What am I missing here? -
Cannot find class in same package but in different file
I have following two source files. Both the file has same package statement as below
package java.buron.doeacc ;
But whenever i try to compile File: shoepolish.java ( mainfram.java compiled succesfully before)
following error message appear
..\..\buron\doeacc\shoepolish.java:12: cannot resolve symbol
symbol : class MainFrame
location: class java.buron.doeacc.shoepolish
MainFrame mainFrame = new MainFrame();
^
..\..\buron\doeacc\shoepolish.java:12: cannot resolve symbol
symbol : class MainFrame
location: class java.buron.doeacc.shoepolish
MainFrame mainFrame = new MainFrame();
^
Please tell me What is the problem and how it can be solved.
why cannot find the class that are in same package.
I have JDK 1.3
FOLLOWING ARE THE TWO FILES
File: mainframe.java/////////////////////////////////////////////////////////////////////
package java.buron.doeacc ;
import javax.swing.* ;
import java.awt.*;
import java.awt.event.* ;
class MainFrame extends JFrame
private final String APP_NAME = "Shoe Polish";
// constructor
public MainFrame()
super("Shoe Polish");
setSize(500, 500);
setVisible(true);
File : shoepolish.java
package java.buron.doeacc ;
import java.io.* ;
import java.buron.doeacc.* ;
class shoepolish
public static void main(String args[])
MainFrame mainFrame = new MainFrame();The javac compiler uses the Classpath to find classes. If your directory structure is c:\myjava\buron\doeacc (for example) then you need to have c:\myjava in the Classpath when you compile. For example javac -classpath c:\myjava MainFrame.java
-
Can't find class org/apache/jk/apr/AprImpl
Hi
I have Tomcat 4.1.29 and Apache Web Server 2.0.48 installed.
I have used this tutorial since I'm a newbie :(
http://www.gregoire.org/howto/Apache2_Jk2_TC4.1.x_JSDK1.4.x.html
My problem is when I try to regroup them, I obtained this error error.log.
error] Can't find class org/apache/jk/apr/AprImpl
java.lang.NoClassDefFoundError: javax/management/MBeanRegistration
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Here is my confid file (workers.properties) :
[logger]
level=DEBUG
[config:]
#file=C:/Apache2/conf/workers2.properties
file=C:/Apache2/conf/workers2.properties
debug=0
debugEnv=0
[uriMap:]
info=Maps the requests. Options: debug
debug=0
# Alternate file logger
#[logger.file:0]
#level=DEBUG
#file=C:/Apache2/logs/jk2.log
[shm:]
info=Scoreboard. Required for reconfiguration and status with multiprocess servers
file=C:/Apache2/logs/jk2.shm
size=1000000
debug=0
disabled=0
[workerEnv:]
info=Global server options
timing=1
debug=0
# Default Native Logger (apache2 or win32 )
# can be overriden to a file logger, useful
# when tracing win32 related issues
#logger=logger.file:0
[lb:lb]
info=Default load balancer.
debug=0
#[lb:lb_1]
#info=A second load balancer.
#debug=0
[channel.socket:localhost:8009]
info=Ajp13 forwarding over socket
debug=0
tomcatId=localhost:8009
#[channel.socket:localhost:8019]
#info=A second tomcat instance.
#debug=0
#tomcatId=localhost:8019
#lb_factor=1
#group=lb
#group=lb_1
#disabled=0
#[channel.un:/opt/33/work/jk2.socket]
#info=A second channel connecting to localhost:8019 via unix socket
#tomcatId=localhost:8019
#lb_factor=1
#debug=0
[channel.jni:jni]
info=The jni channel, used if tomcat is started inprocess
[status:]
info=Status worker, displays runtime informations
[vm:]
info=Parameters used to load a JVM in the server process
#JVM=C:\jdk\jre\bin\hotspot\jvm.dll
OPT=-Djava.class.path=c:/Tomcat/bin/tomcat-jni.jar;c:/Tomcat/server/lib/commons-logging.jar
OPT=-Dtomcat.home=${TOMCAT_HOME}
OPT=-Dcatalina.home=${TOMCAT_HOME}
OPT=-Xmx128M
#OPT=-Djava.compiler=NONE
disabled=0
[worker.jni:onStartup]
info=Command to be executed by the VM on startup. This one will start tomcat.
class=org/apache/jk/apr/TomcatStarter
ARG=start
disabled=0
stdout=C:/Apache2/logs/stdout.log
stderr=C:/Apache2/logs/stderr.log
[worker.jni:onShutdown]
info=Command to be executed by the VM on shutdown. This one will stop tomcat.
class=org/apache/jk/apr/TomcatStarter
ARG=stop
disabled=0
[uri:/jkstatus/*]
info=Display status information and checks the config file for changes.
group=status:
#[uri:127.0.0.1:8003]
#info=Example virtual host. Make sure myVirtualHost is in /etc/hosts to test it
#alias=myVirtualHost:8003
#[uri:127.0.0.1:8003/ex]
#info=Example webapp in the virtual host. It'll go to lb_1 ( i.e. localhost:8019 )
#context=/ex
#group=lb_1
[uri:/examples]
info=Example webapp in the default context.
context=/examples
debug=0
#[uri:/examples1/*]
#info=A second webapp, this time going to the second tomcat only.
#group=lb_1
#debug=0
[uri:/examples/servlets/*]
info=Prefix mapping
[uri:/examples/*.jsp]
info=Extension mapping
[uri:/examples/*]
info=Map the whole webapp
[uri:/examples/servlets/HelloW]
info=Exampel with debug enabled.
debug=10
Thank you for your time !
MaxBtw: I get the warning starting IIS - It seems to me that IIS tries to load Tomcat on-the-fly. The Tomcat load the fails and IIS continues to load successfully.
The beginning of the IIS Event log outputs this:
Apache Jakarta Connector2, Information, Info: [jk_vm_default.c (340)]: vm.detach() ok
Apache Jakarta Connector2, Warning, Error: [jk_worker_jni.c (308)]: Can't find class org/apache/jk/apr/AprImpl
Apache Jakarta Connector2, Information, Info: [jk_worker_jni.c (297)]: Loaded org/apache/jk/apr/TomcatStarter
Apache Jakarta Connector2, None, Debug: [jk_vm_default.c (302)]: vm.attach() allready attached
Apache Jakarta Connector2, Information, Info: [jk_worker_jni.c (252)]: jni.validate() class= org/apache/jk/apr/TomcatStarter
Apache Jakarta Connector2, Information, Info: [jk_vm_default.c (607)]: vm.open2() done
Apache Jakarta Connector2, Information, Info: [jk_vm_default.c (500)]: vm.init(): Jni lib: C:\wwwapps\j2sdk1.4.2_01\jre\bin\client\jvm.dll
/watson -
Hello,
At times, I keep getting this error of unable to find class for bean even though, the definition I used for the Bean in the jsp page is as follows:
<jsp:useBean id="deptbean" class="avt.DepartmentHandler"
scope="session"/>
The Error I get is "Unable to find class for bean deptbean: defined by tag with class: avt.DepartmentHandler".
I had saved the Java class file DepartmentHandler before attempting on the jsp page which used this.
I have no clue as to why this is happening. Please do help.
Thanks in Advance.Hello,
I think I figured out why it is happening so, it was because I hadnt compiled the java class files and java bean files. Once I compiled the java files, I was able to get rid of the error.
Thanks. -
Cannot find class: Exception??
Hi
The compiler claims it cannot find class FileNotFoundException or any other exception in my Main. Any packages I import has no problem. My structure:
java \ myMain \ Main.java
java \ com \ myName \ packages //no, the space is just there as visual help:)
Use javac -classpath java\ @compile.file
...where compile.file is a txt file giving the paths and filenames to all files I include.
This is first time I use the -classpath parameter, but I believed java.lang always was included. What Am I doing wrong.
regards
JTYou should review the tool documentation for the javac command and its use of classpath.
Your problem appears to be due to the way you defined classpath, "-classpath java\". While you don't provide enough information to conclusively say what it should be, I'm guessing it should also include java\myMain\ - assuming that you're issuing the javac command from the parent of the \java\ directory, as your command example indicates.
Here is a clip about its use of the classpath.
"When compiling a source file, the compiler often needs information about a type whose definition did not appear in the source files given on the command line. The compiler needs type information for every class or interface used, extended, or implemented in the source file. This includes classes and interfaces not explicitly mentioned in the source file but which provide information through inheritance.
For example, when you subclass java.applet.Applet, you are also using Applet's ancestor classes: java.awt.Panel, java.awt.Container, java.awt.Component, and java.lang.Object.
When the compiler needs type information, it looks for a source file or class file which defines the type. The compiler searches for class files first in the bootstrap and extension classes, then in the user class path (which by default is the current directory). The user class path is defined by setting the CLASSPATH environment variable or by using the -classpath command line option. (For details, see Setting the Class Path).
If you set the -sourcepath option, the compiler searches the indicated path for source files; otherwise the compiler searches the user class path for both class files and source files." -
How to Find Classes Urgent!
I have loaded .class files using classLoader ..
i want to find calsses & interfaces which are present in perticular package structure(in memory)..if i use Package.getPackages() mathod
its returning me all the packages which are loaded in memory.using that package structure how to find the
classes and interface's
Advance Thanxthe problem is that its to hard to track the each classes and its packages.. i have more then 20 jars..each jar having morethen 25 classes with diff packge structure.. (more then one jar having same package structued classes )
so that i have loade all the classes using Systems class loader..
now my need is to find classes whichare present in perticular package structure..
for Ex. in system class loader it will automatically load java.jang.allclasses;
what i want is if i knew that package name (java.jang)
i should find the class name's like Object,String,Long...etc -
How to find Classes to which characterstics are assigned
Hi,
How to find the classes to which a particular characterstics are assighned in 46B.
I have characterstics and I should able to find the class/classes to which it is assighned.
I have a BAPI BAPI_CHARACT_GETWHEREUSEDLIST which does the same as in 5.0 and I want the same FM or BAPI where it is used in 46B.
Best Regards,
MarkHere's an example of a way to find classes based on characteristics if you need to write your own. Obviously this is for a report, but you get the idea.
select-options: s_atnam for cabn-atnam.
data: begin of t_class occurs 0,
class like klah-class,
atnam like cabn-atnam,
end of t_class.
select klahclass cabnatnam into table t_class
from klah inner join ksml
on klahclint = ksmlclint
inner join cabn
on ksmlimerk = cabnatinn
where cabn~atnam in s_atnam. -
How to find (classes,interface,subpackage info) in some package
Plz tell me if any one know how to find (classes,interface,subpackage) in some package
e.g. in java.io
"Above senerio in not concern with java doc
but tell me if an other way i.e by help of programming
i could find some package information"
as we know we find out any "object" classType , methods and fields information with help of "java.lang.reflect" API's
but how to find a package information as provided by jdk is in current useYou can locate the .zip or .jar file where the stuff is, and say either
unzip -l classes.zip
or
jar tvf classes.jar.
So you see the list of the classes in the given package.
Then you can say
javap -classpath classes.zip MyPackage.MyClass
to see the fields and methods of the given class. -
How to find classes in the package if package path
in java i want to find classes,Interface,Exception names which are presant
in the package..
for example
java.sql; if i give this it should return
class name
Date
Time
DrivarManager
pls helpme in this fielddownload the jdk documentation or view it here
http://java.sun.com/j2se/1.3/docs/api/index.html
The exact problem is i hava set the path to my application that path contains several jar's(contains classes,Interfaces) and classes with package structure,
now my need is if i run the application ,the application
should find out the classes and Interfaces for given package structure which are present in classpath...
for this i have to load all the classes to memory(using classes loader) . then find out the classes which are present in memory...
or
any other inbuilt method is there in java when i give path structure it find and give classes which are in class path..
for ex..
if i set path to jdk
then if i give the path like java.lang
it should give me the out put as
String (or) String.class
Double
Cloneable
(classes & interface in that package) -
Preverification error: Cannot find class com/sun/perseus/model/Viewport
Hi all,
I have a (previously) working Midlet to which I have added one line as follows:
SVGImage image = (SVGImage)SVGImage.createEmptyImage(null);
- and imported the necessary from javax.microedition.m2g. (I am using the library that comes with the WTK, jsr226.jar).
This builds, jars, obfuscates fine. But when I try to preverify (using Antenna's wtkpreverify) on the jar, it gives up in disgust very swiftly as follows:
[wtkpreverify] Error preverifying class javax.microedition.m2g.ScalableGraphics
[wtkpreverify] VERIFIER ERROR javax/microedition/m2g/ScalableGraphics.render(IILjavax/microedition/m2g/ScalableImage;)V:
[wtkpreverify] Cannot find class com/sun/perseus/model/Viewport
I'm using the WTK2.5.1ea and antenna 0.9.14, CLDC1.1, MIDP2.0...
Many thanks for any ideas.Problem resolved simply by replacing jsr226.jar (as distributed with WTK2.5.1ea) with m2g.jar (as distributed with J2MEPolish).
-
Hi,
Im trying to use swing for almost the first time.
I changed my system to Linux and installed J2sdk 1.4.
When I write a class
e.g.
import javax.swing.*;
import java.awt.*;
etc...
class Test extends JPanel {
I receive an error message "Cannot find class "JPanel""
Can anyone help ? Maybe I didnt install the right thing ?
Thanks
Ulrikeyou sure reinstall and overwrite your current sdk. Do you have the runtime environment installed too -- should come with the sdk
-
Cannot find class java/lang/Thread
I'm getting this error trying to compile a program that I'm writing in java. Its a very simple program just to get me back to basics. Any ideas as to how I can fix this problem??
Extracted from Sun's website,
* Error Message: "Exception in thread NULL" or
"Unable to initialize threads: cannot find class java/lang/Thread"
If you are getting one of these fatal error messages when running java,
javac, or appetviewer, you should check your CLASSPATH environment variable.
It may list "c:\java" or the "classes" directory from an older release. You can either unset the CLASSPATH variable, or set it to
include only the latest version of the Java platform class library. For example:
C:\> set CLASSPATH=.;C:\jdk1.1.8\lib\classes.zip
This will make sure that you are using the correct classes for this release.
-- Sudha -
Cannot find class in same directory during compilation
hi
i have two file hello.java & hi.java in same directory having simple println statements.
hello.java
public class hello {
public static void main(String[] args) {
System.out.println("hello");
new hi();
}hi.java
class hi {
hi() {
System.out.println("hi");
}hi.java has compiled
but when i try to compile hello.java i get error saying "Cannot find symbol class hi"
i've tried giving classpath pointing to current directory during compilation as
javac -classpath . hello.java
but this also does not work.
Please let me know if i am missing anything?
thanks in advance...The javac compiler uses the Classpath to find classes. If your directory structure is c:\myjava\buron\doeacc (for example) then you need to have c:\myjava in the Classpath when you compile. For example javac -classpath c:\myjava MainFrame.java
Maybe you are looking for
-
Error in data load from application server
Well, this problem again! In datasource for dataload by flatfile, tab Extraction i selected Load Text-Type File From Application Server. In tab Proposal: Converter: Separated with Separator (for Example, CSV). No. of Data Records: 9198 Data load suce
-
How do I set up Time Machine to work with an Iomega network hard drive?
I have just bought a new iMac having switched from Windows, and am very much a beginner when it comes to all things Apple. Previously I had used my NAS hard drive with my old windows pc. i successfully used it to transfer a lot of data from the old p
-
HT2518 which program can I use to open a Word file that is formatted for use ONLY on a PC?
I hve a word doc that is formatted only for use on a PC. I cannot change the file at the request of the sender. Is there a way to open and fill out the word document on a mac. I used to have Parrelles which allowed me to do so but no longer have this
-
Regd. Receiver determination when we have 1Bsystem&1Bservice
Hi All, I am trying to do reciever determination based on one element in the input Message. Its works fine if i set a condition and based on that send it to one of the business Services But i have one business system and one business service and i ha
-
Adobe Flash Player evaporates after installation
I own a Dell Inspiron laptop for about a year - running Win 7 and having Trend Micro Titanium Internet Security 2013. have downloaded Adobe Flash Player from your site innumerable times but continue to have problems when requiring its use. Get msg