Does Java load a class in caché ? New compiled class are not used .
I run my application (using java.exe + 'my class').
One 'Mybutton' launch a new class Frame based, with one button on it. I see this Frame and close it.Ok.
Now a put a new button in this Frame ( I have 2 buttons then), I save it (and Eclipse compile it).
If a do click on 'Mybutton' I see the old Frame (with one button) not the new Frame with 2 buttons.
What happens ? Is there something like cache class loader? How to avoid this?
My intention is to try to test the changes inmediatly, but in this situation I must to close Myapp and re-run it ?
Some solution?
Thamk you
Java classes are loaded by an Object called a ClassLoader. Each classloader permanently caches all the classes it loads, and always uses an already loaded class in preference to loading a new one.
When a program starts there's already a ClassLoader, the one that loaded your main class. It loads classes from the class path. It exists all the time the program is running.
You can create your own classloaders in the program and if you load your changeable class through one then then you can get a new version by creating a new classloader.
Typically you create an instance of URLClassLoader.
However you need to know that classloaders "delegate" loadClass requests before loading the class themselves, which means that if the class you request is on the class path, your URLClassLoader will get the system class loader to load it and it won't work. You need a special directory (typically called a repsitory) for classes you wish to load multiple versions of.
Similar Messages
-
When does Java load classes?
Hi there,
I have a question about when Java is loading class? Does it load the class when use it or it will load all classes in the scope in one shot?
Let's say I have a projectA java program which has classA:
class classA{
I have a jar file: my.jar which uses classA if it is used in projectA:
class myClass{
if( enviroment.equals("projectA") )
classA a = new classA();
This works no problem.
Now let's say I have another program call projectB, which does NOT has classA; Now, can I link my.jar to this projectB and run??
ThanksJava loads classes only upon access.
-
Classes are not loading from WEB-INF/classes directory
Hi All,
I am in a deep troble because the class files in the WEB-INF/classes directory are not loading.
I have deployed the application in Tomcat 6 server. And stored all class files under WEB-INF/classes dirctory. But when I execute a JSP page, I am getting following error:
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP:
JSP FileName:/hello.jsp
An error occurred at line: 1 in the jsp file: /hello.jsp
com.flt.Test cannot be resolved to a type
1: <%=new com.flt.Test().hello()%>
Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:98)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:435)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:298)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:302)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)The classes are available in the WEB-INF/classes directory and the folder name and package name of the classes are correct. I have also tried to execute the application by creating a jar file and put it in the WEB-INF/lib directory. But I am getting same result.
Is it the problem with Tomcat configuration? When I gone through Tomcat documentation, I get to know that the WebAppX class loader in Tomcat, loads application specific classes for a web application. Is it possible to start/stop WebAppx classloader manually?
Please help me to solve this issue.
Many Thanks,
Francis Lukose
Edited by: francis_ on May 13, 2008 10:03 AMThanks for your reply, Soultech2012.
<%=new com.flt.Test().hello()%>is the only code in the JSP page. Just a single line. Nothing more than that.
The code in Test.java is as follows:
* To change this template, choose Tools | Templates
* and open the template in the editor.
package com.flt;
* @author Francis Lukose
public class Test {
public static String hello() {
return "hello";
}Many Thanks,
Francis
Edited by: francis_ on May 13, 2008 6:45 PM -
Kodo says classes are not enhanced, but they are!
Hello,
I have run into a problem with Kodo and a web-app that I just can't solve.
I try to access JDO-objects from within a web-application (that uses
Struts). When I do this, I get an exception from Kodo saying the classes are
not enhanced. But I am sure they are enhanced. The exception is:
javax.jdo.JDOFatalUserException: The system could not initialize; the
following registered persistent types have not been enhanced: [class
de.mediateam.quizmaster.data.User, class
de.mediateam.quizmaster.data.Category, class
de.mediateam.quizmaster.data.Topic, class
de.mediateam.quizmaster.data.Test].
at
com.techtrader.modules.jdo.impl.jdbc.JDBCPersistenceManagerFactory.setup(JDB
CPersistenceManagerFactory.java:190)
at
com.techtrader.modules.jdo.runtime.PersistenceManagerFactoryImpl.privateSetu
p(PersistenceManagerFactoryImpl.java:496)
at
com.techtrader.modules.jdo.runtime.PersistenceManagerFactoryImpl.getPersiste
nceManager(PersistenceManagerFactoryImpl.java:61)
at
com.techtrader.modules.jdo.runtime.PersistenceManagerFactoryImpl.getPersiste
nceManager(PersistenceManagerFactoryImpl.java:50)
at
de.mediateam.quizmaster.persist.jdo.JDOFactory.getPersistenceManager(JDOFact
ory.java)
<snip>
There are two facts about this I don't understand:
1. It was working before, but then something changed (or I changed something
but I really don't remember it) and now it won't work anymore. I tried to go
back to an earlier version of my project but got the same problem.
2. It is really strange, that when I access the database from outside the
web-app (I have a small seed programm to insert some data), it works fine.
No problems.
I am sure that it is the enhanced classes loaded from within the web-app
because when I simply delete them Kodo won't find the classes at all. All
Kodo-jars are in the web-context/WEB-INF/lib directory.
Could anybody tell me the possible reasons that can cause this exception? Is
it just a test for "implements PersistenceCapable" that is done in the
setup-method, or maybe a bit more? I really can't think of anything else I
could do.
Thanks
MartinHello,
I have run into a problem with Kodo and a web-app that I just can't solve.
I try to access JDO-objects from within a web-application (that uses
Struts). When I do this, I get an exception from Kodo saying the classes are
not enhanced. But I am sure they are enhanced. The exception is:
javax.jdo.JDOFatalUserException: The system could not initialize; the
following registered persistent types have not been enhanced: [class
de.mediateam.quizmaster.data.User, class
de.mediateam.quizmaster.data.Category, class
de.mediateam.quizmaster.data.Topic, class
de.mediateam.quizmaster.data.Test].
at
com.techtrader.modules.jdo.impl.jdbc.JDBCPersistenceManagerFactory.setup(JDB
CPersistenceManagerFactory.java:190)
at
com.techtrader.modules.jdo.runtime.PersistenceManagerFactoryImpl.privateSetu
p(PersistenceManagerFactoryImpl.java:496)
at
com.techtrader.modules.jdo.runtime.PersistenceManagerFactoryImpl.getPersiste
nceManager(PersistenceManagerFactoryImpl.java:61)
at
com.techtrader.modules.jdo.runtime.PersistenceManagerFactoryImpl.getPersiste
nceManager(PersistenceManagerFactoryImpl.java:50)
at
de.mediateam.quizmaster.persist.jdo.JDOFactory.getPersistenceManager(JDOFact
ory.java)
<snip>
There are two facts about this I don't understand:
1. It was working before, but then something changed (or I changed something
but I really don't remember it) and now it won't work anymore. I tried to go
back to an earlier version of my project but got the same problem.
2. It is really strange, that when I access the database from outside the
web-app (I have a small seed programm to insert some data), it works fine.
No problems.
I am sure that it is the enhanced classes loaded from within the web-app
because when I simply delete them Kodo won't find the classes at all. All
Kodo-jars are in the web-context/WEB-INF/lib directory.
Could anybody tell me the possible reasons that can cause this exception? Is
it just a test for "implements PersistenceCapable" that is done in the
setup-method, or maybe a bit more? I really can't think of anything else I
could do.
Thanks
Martin -
my ringtones that i purchased have not transfered on to my new iphone and are not in my itunes purchased does anyone know how to fix this problem
Thank you, thank you! It was pretty easy, once you explained it to me.
Now, do you have any idea why my iPhone looks like it's connected to my Airport Extreme, but will not open pages? My iMac, desktop and my iPad connect, no problem, but my phone won't. Verizon even replaced my phone, but it still won't connect. ????? -
Load the data for which these 2 fields are not initial (Blank).
Hi Experts,
I am extracting data from R/3 to BW using a Z data source based on view.
In the extract there will be 2 fields User ID & Date.
My requirement is to load the data for which these 2 fields are not initial (Blank).
My Data source is extracting all the data from R/3 to BW.How can filter it out in BW.
ThanksHi Siegfried,
Thanks for the info Provided.
As I am new to BW, Could you please provide me with the code (ABAP) I need to insert and where...in which part of the below start routine in need to insert the code....
My requirement is to load the data for which the USER ID (ZUSR_ID) & DATE (ZDATE) is not null/blank/0.
<b>Start Routine IN Transfer Rules</b>
Global code used by conversion rules
$$ begin of global - insert your declaration only below this line -
TABLES: ...
DATA: ...
$$ end of global - insert your declaration only before this line -
FORM STARTROUTINE
USING G_S_MINFO TYPE RSSM_S_MINFO
CHANGING DATAPAK type TAB_TRANSTRU
G_T_ERRORLOG TYPE rssm_t_errorlog_int
ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel datapackage
$$ begin of routine - insert your code only below this line -
DATA: l_s_datapak_line type TRANSFER_STRUCTURE,
l_s_errorlog TYPE rssm_s_errorlog_int.
abort <> 0 means skip whole data package !!!
ABORT = 0.
$$ end of routine - insert your code only before this line -
ENDFORM.
Thanks for the help. -
On certain web sites(with java applets embedded or rich content),sometimes browser hotkeys are beeing used with other functionality (eg.: youtube uses ctrl + tab for sliding between player controls).How can I prevent this ?
Thanks for posting this!
I would only mention that your definition is incomplete for this -
Contextual selector A type of Style Sheet Selector that
and that it's most often referred to now as a Descendent selector, not a contextual selector. It's basically the same as the Compound selector that you have already defined.... -
I recently had an update (or upgrade?) for FF 16. Today (and I believe the update was done a day or two ago?) my cache, cookies and history are not clearing when I close FF. Also, certain links are not working. Not links for full web pages but for site pop-ups (like the smilie window on a message board). They worked a few days but are not working today. I click the link and nothing happens. I noticed the problem with the cookies not clearing for a few weeks ago but it was only on one site not all sites which is what's happening now.
My apologies if that's a little confusing. Thanks!At any rate, have you tried running Firefox in Private Browsing mode? This will ensure that no infromation from your session is saved once you exit Private Browsing mode and/or exit Firefox.
You can set Firefox to always start in Private Browsing mode: https://support.mozilla.org/en-US/kb/private-browsing-browse-web-without-saving-info#w_how-do-i-always-start-firefox-in-private-browsing -
have IPod classic that I have been extremely happy with. I now have purchased ipod nano and Iphone. the older version and the new 2.2 are not compatiable. I want to use all my IPods and Iphone, but I only have my one computer, how can I update all of my Apple products. I want to use them all.
Hello graingers45,
graingers45 wrote:
have IPod classic that I have been extremely happy with. I now have purchased ipod nano and Iphone. the older version and the new 2.2 are not compatiable. I want to use all my IPods and Iphone, but I only have my one computer, how can I update all of my Apple products. I want to use them all.
What do you mean it isn't' compatible? What isn't compatible?
There is no limit to the number of iPods you can sync to one computer, iTunes library, or iTunes account. Simply connect each separate iPod/iPhone to your computer and configure each to sync whatever content you wish to.
B-rock -
I have the latest operating system, but can't get my printers added. Why does the software update say that drivers for my printers are not available? I have the drivers installed from the CD but can't add the printer because it wants to go through software update.
It's pretty difficult to offer suggestions when you say nothing about your Mac, the version of Mac OS it's running, or the models of printers you have. This forum, however, is intended for questions about old, pre-G3 hardware, so unless you are asking about an very old Mac, this is not the forum where you'll be most likely to get help with your problem. I'd suggest you ask this question in the forum for your model of Mac or version of Mac OS X it's running. You'll be more likely to get assistance there, assuming you provide sufficient detail for anyone to make a diagnosis of the problem.
Regards. -
I uploaded the latest X Yosemite and fond that Aperture did not work. Then I started the new Picture but are not able to upload all my pictures (app half of them) have anybody had the same issue? and can potentially advise me on how to fix it?
Thanls Ernie. I found the solution. My problem was previous to 10.10.3. It looks like the installation of final cut and uninstallation of fcp delte a plugins that was needed for Aperture. I recover from time machine my plugins in Library/frameworks/plugin.manager.framework and now Aperture works ! Ouf....
-
If I am signed into ICloud on my laptop, does that incur charges on the MiFi even if I am not using it?
No, it does not.
-
Does java have any class that wrap byte[]
my program would send byte[] to remote host;I know byte cant be serializabled;
so I would a class wrap byte[],I cant write new class,because remote host maybe havent this class,
I want to kown if java have a class that wrap byte[];The iPlanet Application Server 6.5 has a very nasty bug when you're using RMI/IIOP: if you want to reference an EJB in a stand-alone application. you can't use reliably methods that take parameters whose type is an array of primitives (like byte[]). The EJB can be called correctly in a Web application or by another EJB, but you can't use them in stand-alone apps.
It is a product that is simultaneously a C++ application server and a Java application server, and has lots and lots of native code. It uses a specially modified JRE 1.3 for its own use.
Sun dumped it (too buggy, too complex, too slow and very oddball) and used the J2EE SDK RI code instead to write the new versions of Sun ONE Application Server and Sun Java System Application Server. -
Does Java have any class for linear algebra/matrix computation
Hi!
I am new to Java. Would like to ask whether Java provides any class or package for linear algebra/matrix computation, before I switch to MATLAB or write the code by myself.
Thank youMaybe you can find something here,
http://math.nist.gov/javanumerics/ -
Load-balancing of transparent cache + IP spoofing + RTSP + MMS not working
We have already in production an architecture with load-balancing of
transparent cache + ip spoofing.
We are unable to do the same for streaming flows (MMS and RTSP).
We are doing PBR from our core network (2 * C6K) to redirect port 80, 554 and
1755 toward CSS boxes, same in our access router (2* Ciso7200).
In this config desired flows are redirected toward the CSS.
Then CSS should load balance the traffic toward our BlueCoat proxy-cache farm.
It's working fine for HTTP but we are unable to make it works for MMS and
RTSP.
Note that we are requiered to use ECMP to perform IP Spoofing on the CSS, meaning we need 4 routes for each client subnet (one route toward upstream C6K, and 3 routes for each proxy cache). We use acl to get rid off looping condition.
Anyone who has already put in place Load-balancing of Streaming transparent cache + IP spoofing could give us some hint.
Many thanks.
Regards,
Pierre ViennetGilles, thanks for your input.
Here where we are at with streaming implementation:
- HTTP on all type off client is working
- RTSP: TCP 554 with Real Media client is working
- RTSP: TCP 554 with WMP not working, but it's due to a bug in Bluecoat implementation, the proxy send an error when he see a request with ( User-Agent: WMPlayer ) for RTSP content.
- MMS: TCP 1755 not working with IP spoofing enable on the proxy but OK without IP spoofing...
- UDP 554: not working
- UDP 1755: not working
I fully understand the limitation for UDP traffic.
But I don't see why it's not working for MMS over TCP traffic.
Note that I have the exact same configuration for RTSP and MMS.
Why is it not working for MMS with IP spoofing? Are you aware of a difference on the way CSS handle MMS flows? or a specificity of the MMS protocol?
Below what we can see on the different equipement when trying to launch a MMS over TCP Stream:
c6k-Faaa#sh mls ip source 195.83.182.72
Displaying Netflow entries in Supervisor Earl
DstIP SrcIP Prot:SrcPort:DstPort Src i/f:AdjPtr
Pkts Bytes Age LastSeen Attributes
202.3.225.5 195.83.182.72 tcp :1755 :1504 0 : 0
3 124 17 18:58:12 L3 - Dynamic
202.3.225.5 195.83.182.72 tcp :1755 :1527 0 : 0
2 84 3 18:58:20 L3 - Dynamic
202.3.225.5 195.83.182.72 tcp :554 :1503 0 : 0
4 360 17 18:58:06 L3 - Dynamic
c6k-Faaa#
CSS11503_CORE1# sho flows 202.3.225.5 | grep 1755
202.3.225.5 38531 195.83.182.72 1755 0.0.0.0 TCP
2/3 2/1
202.3.225.5 1527 195.83.182.72 1755 195.83.182.72 TCP
2/7 2/3
CSS11503_CORE1# sho flows 202.3.225.5 | grep 1755
202.3.225.5 38531 195.83.182.72 1755 0.0.0.0 TCP
2/3 2/1
202.3.225.5 1527 195.83.182.72 1755 195.83.182.72 TCP
2/7 2/3
CSS11503_CORE1# sho flows 202.3.225.5 | grep 1755
202.3.225.5 38531 195.83.182.72 1755 0.0.0.0 TCP
2/3 2/1
202.3.225.5 1527 195.83.182.72 1755 195.83.182.72 TCP
2/7 2/3
CSS11503_CORE1#
TCP 192.168.4.19:1491 195.83.182.72:554 TIME_WAIT
TCP 192.168.4.19:1492 195.83.182.72:554 TIME_WAIT
TCP 192.168.4.19:1493 195.83.182.72:1755 TIME_WAIT
TCP 192.168.4.19:1502 195.83.182.72:554 TIME_WAIT
TCP 192.168.4.19:1503 195.83.182.72:554 TIME_WAIT
TCP 192.168.4.19:1504 195.83.182.72:1755 TIME_WAIT
TCP 192.168.4.19:1525 195.83.182.72:554 TIME_WAIT
TCP 192.168.4.19:1526 195.83.182.72:554 TIME_WAIT
TCP 192.168.4.19:1527 195.83.182.72:1755 TIME_WAIT
Many Thanks for your input.
Pierre Viennet.
Maybe you are looking for
-
End Point URI change in Business service?
Hi all, We had done all our osb code development and moving from one environment to other(Eg. E2E testing to UAT, Then UAT to Production). When we move the codes from one server to the other we need to change the End Point URI in the business service
-
Advantages and disadvantages of using only sequence files or working with sequence files in projects
Hello, can anyone please tell me the advantage of using projects instead of just a sequence file? Do I need projects only if I have more than one sequence file? Thanks a lot!
-
Problem with converted PDF from OTF
Hello, im having a problem with character interpretation in PDF document when i convert it from OTF. At the moment im using Arial true type font in my smartform, im using function module CONVERT_OTF to convert OTF to PDF. When i open PDF document wit
-
OSX 10.5.8 Upgrade to Snow Leopard How ?
Hi, I run a OS X 10.5.8 How can I upgrade to Mountain Lion ? I was told I need to upgrade to Snow Leoprad first, but I don't know how ! Please, help would do me good D
-
Hi experts, I need to set cursor in a perticular field after a button click event, How can I do that. PLease explain me in detail. If possible provide me with code. Thanks, Points are sure.