Problems with loading Ressources out of a jar file
Hi Folks !
My current job for my university is to make some Java programms runnable as a WebStart Application. With most of the programms this was no problem. But i have a problem with one.
The gui of the program loads some icons out of the jar file with the following code:
try {
openIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/open.png"));
generateIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/generate.png"));
editIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/edit.png"));
propertiesIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/properties.png"));
alphabetIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/alphabet.png"));
cutIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/cut.png"));
saveIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/save.png"));
helpIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/help.png"));
aboutIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/about.png"));
exitIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/exit.png"));
startIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/start.png"));
stopIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/stop.png"));
preferencesIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/preferences.png"));
okIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/ok.png"));
noIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/no.png"));
clearIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/clear.png"));
plusIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/plus.png"));
minusIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/minus.png"));
overlapIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/overlap.png"));
canselIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/cansel.png"));
catch(NullPointerException e){
JOptionPane.showMessageDialog(frame,
"There was an error while loading icon files. Probably the needed icon files are not present.",
"Missing icon files!", JOptionPane.ERROR_MESSAGE);
}When i start the program as a normal jar with
java -jar ssstester.jarAll Icons are loaded normaly. But when i start it as a WebStart Application i get the catch (NullPointerException e) error message "There was an error while loading icon files. Probably the needed icon files are not present. Missing icon files!".
So where is the problem ? Don't know if it is important, but the Application gets full rights in the jnlp File
<security>
<all-permissions/>
</security>Greetings and sorry for my horrible english,
Christoph
Thread.currentThread().getContextClassLoader().getResource(imageFilePath); to load the images than the one you are using right now
Edited by: Mayya on Jun 17, 2008 4:34 AM
Similar Messages
-
Problem with JSP using bean packaged in jar file
Hi,
I am trying to use a java bean in a jsp file. The java bean is packaged
into a jar file. I am getting class not found compilation error. If the
bean remains to be a seperated class file, everything work well.
Does anyone know how I can use bean in a jar file within jsp , i.e. to
allow the bean to be found during compilation ?
Thanks,
Terence.
[email protected]
Jacek,
Thanks for replying.
My JSP's are just files in my document root . However, I found a solution to
my
problem. That is to have the jar file defined in my weblogic.class.path. I may
have missed some files in my original jar file which causes my problem.
Mayby I should package everything into a web application for deployment. That
will be my next step.
Thanks anyway.
Terence.
Jacek Laskowski wrote:
> Terence Lai wrote:
> >
> > Hi,
> >
> > I am trying to use a java bean in a jsp file. The java bean is packaged
> > into a jar file. I am getting class not found compilation error. If the
> > bean remains to be a seperated class file, everything work well.
>
> How do you use the JSP file ? Is it a part of web application ? If so,
> the bean jar package should be located in WEB-INF/lib directory. It's
> also recommended to put the bean class into a package, so it's not in
> 'unnamed' package, and <jsp:useBean> can find it.
>
> >
> > Does anyone know how I can use bean in a jar file within jsp , i.e. to
> > allow the bean to be found during compilation ?
>
> see above.
>
> > Terence.
>
> Jacek Laskowski
> HP Consulting
-
Problem in loading applet from non executable jar file
hello ,
I am new to jar concept plz help.. I am trying to call an applet from another applet through frame it is working fine but its download time is much more. now i want to store all my images , sound files and class files of other applets in a jar file and want to access these inner applets from this jar file so that it will make only one http connection with the server for this jar file only and can reduce the download time of applet.
Can anyone can give me suggestion plz..
ThanxYou have to download what you have to download. You
probably can't easily share images between 2 separate
Jar files. Unless you can expose them through the
other applet via a method that can be known once you
have the reference to the other applet.Thanx but i think i have to elaborate the problem :
my project structure is just like this ::
on the top is ::
Applet A---> from this applet i am callling Applet B & Applet C in frame
and communication is established between these 3 applets successfully .
now i have made a single non executable jar file which contains images , sound and class files of these applets .
so i am referencing images and sound files in applets through this jar.
but i wanted to load Applet B & C through this jar file only.
How can i do this ??
Thanx .. I hope now the problem is clear -
I have problem with the BPEL server caching the jar file of Instance
Is there any way to undeploy and redeploy a process where you have changes to the underlying DA, without the BEPL server being restarted. This always works in my Local BPEL server in my Laptop. But when deploying in the hosted BPEL enviroment it becomes a big problem in getting it restarted when ever I MAKE changes.
Is there any other way to disable the Cache of the instance and make it use the newer version uploaded. One more thing if the connection to a database is severed, then the DA will not work until the server is restarted. All the instances using the said connection is failing with either "Invalid Datatype" or "Socket Read exception". Can someone help!!
Thanks,
PrabhakarHi,
have you tried to kill the session of the DA in the database? -
Hello Experts,
I am facing a problem with loading classes.
i have written one application which is running on server.in that application want to use certain jars(Classes)and those jars anmes and
classes inside the jars are same.based on the condition i want to call
corresponding class.
can any one suggest the solution
it's urgent
any help will be appriciated
thanks in advance
With regds
BankuruHi Yogee,
Thanks for ur help.
i have 4.o jars and 5.1 version jars.depending on the condingtion system must use the corrensponding jar.the problem here is that both jars has same clasees and code inside that one is differnet.
when i run application with 4.o condition then 5.1 is not working and
if i run tha application with 5.1 then 4.o is not working.
can u please suggest the possible solution
i have deployed these jars in application server
With Regds
Bankuru -
Beginner Has Problem With Loading JDBC Driver Using MySQL
Hi, I am having problem with loading JDBC driver, and need your diagnotic help.
1. I have installed MySQL (C:\mysql), created a databse (soup), and created a littel table (VIDEOS). I am able to see the table in the console:
sql> select * from videos
2. I have downloaded the latest version of Connector/J (mysql-connector-java-3.1.0-alpha.zip), and unzip the zip file into my C:\ directory.
3. I copied the mysql-connector-java-3.1.0-alpha-bin.jar to the C:\j2sdk1.4.1_02\jre\lib\ext folder and it is in my CLASSPATH
4. MySQL server is running
C:\> C:\mysql\bin\mysqld-nt --standalone
5. open another DOS window and use the database
mysql>USE SOUP
6. succesfully compiled a Java program (javac Test.java):
import java.sql.* ;
public class Test
public static void main( String[] args )
try
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
try
Connection con = DriverManager.getConnection( "jdbc:mysql://localhost:3306/soup" );
try
Statement statement = con.createStatement();
ResultSet rs = statement.executeQuery("SELECT TITLE FROM VIDEOS");
while ( rs.next() )
System.out.println( rs.getString( "TITLE" ) );
rs.close();
statement.close();
catch ( SQLException e )
System.out.println( "JDBC error: " + e );
finally
con.close();
catch( SQLException e )
System.out.println( "could not get JDBC connection: " + e );
catch( Exception e )
System.out.println( "could not load JDBC driver: " + e );
7. when I run the Java program (java Test), I got
the message:
could not load JDBC driver: java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
What am I missing?Hi,
I missed to specify test in my last post.
Try running your program by explicitly setting the classspath when
running your program . java -classpath c:\mysql-connector-java-3.1.0-alpha-bin.jar test
Make sure your jar file contains org.gjt.mm.mysql.Driver class -
Problems with loading native library/missing methods:no ttJdbcCS in java.li
Iam facing one problem while connecting the timesten client to the server The SQL Exception which Iam getting is pasted below:-
Problems with loading native library/missing methods: no ttJdbcCS in java.library.path
I am working with MAC OS X 10.7.2 and my timesten client version is 11.2.1.0
I have also changed the Java Preferences from 64-bit to 32-bit but still whenever i tried to connect with the SQL Developer it gives me the above error.I just tried this out. My environment is OS X 10.7.4, Timesten (32-bit) client 11.2.1.9.0, SQL Developer 3.1.07, Oracle Java 1.7.0_04.
The key things you need to be sure to do (in a terminal window) are:
1. Be sure to . in the TimesTen environment script <tt_install_dir>/bin/ttenv.sh to set the full TT environment.
2. Change directory to SQLDeveloper.app/Contents/Resources/sqldeveloper
3. Run 'sh sqldeveloper.sh -J-d32'
and all should be fine.
Note that if you are using Java7 as I am then there is a step 1a. Change the CLASSPATH environment variable to specify ttjdbc6.jar not ttjdbc5.jar. For some reason running the app directly from Finder does not work even if you add -J-d32 into the sqldeveloper launch script. I'm still looking into that.
Chris -
Canon pixma pro 9500 having problems with my print out. colors are glazed and missing colors
canon pixma pro 9500 having problems with my print out. colors are glazed and missing colors
i have prfiled the mac and printer wiht colormunki and uplodated the profile sucessfully
i set the printer to correct icc profile
print out comes out same with glazed colors and missing tones/colors
however when i use the same printer on windows and with light room, following same icc profile, colormunki calibrated profile, the print our are excellent.
i have also tried using printer manage profile using the Mac and Aperture and get same poor prints
can you please assist and thanksI've a Pro9000 and also use Colormunki successfully.
When I use Colormunki, I calibrate both of my monitors and the printer/paper combination. Colormunki saves the generated profiles to the correct places -- I don't load or change any profiles after that as that would mess-up what the Colormunki had just done for me, and this would likely mess-up the prints.
Though I double-check the settings in the print dialogue, the choice for the printer handling things is already grayed-out. Colorsync handles it all just fine. -
Memory leak problems with loading videos over and over.
I'm having memory leak problems with loading videos into a VideoPlayer aswell as FLVPlayback.
What the flash should do:
- Should be running for 7 days without having to restart the projector.
- Interface that shows people around a 360 3D model with 5 different parts and at the stops it makes during the rotation you can click to zoom in on a location which plays a movie for that aswell.
- Shows a video out of 5 parts for a 360 rotation in 3D in mp4 video (added each time and cleaned up, see code below).
- Still images are used when the video clips are done playing (MovieClip in stage).
- Should run automatically when there is no user interaction for X minutes.
What the problem is:
- The flash (as a exe and swf i guess) starts to consume memory over time (say 10 hours) until the projector crashes. This usually at around 1.75 GB of memory.
I cannot see why the Flash cannot garbage collect this and free up the memory. Mabye there is something I don't understand about the garbage collection in flash?
Here is some code from the video loading and playing:
var fVideo:VideoPlayer;
VideoCreate();
function VideoReady(pEvent:VideoEvent):void
trace("VideoReady()");
// start playing video
fVideo.play();
function VideoLoad(pUrl:String):void
trace("VideoLoad(" + pUrl +
VideoCreate();
if (pUrl != "")
if (fVideoFolder + pUrl == fVideo.source)
fVideo.seek(0);
VideoReady(null);
} else {
trace(fVideo.state);
if (fVideo.state !=
VideoState.DISCONNECTED) fVideo.stop();
fVideo.close();
fVideo.load(fVideoFolder + pUrl);
} else {
// error no url
function VideoCreate():void
trace("VideoCreate()");
// remove old one
if (getChildAt(0) == fVideo)
removeChildAt(0);
fVideo = new
VideoPlayer(1024, 768);
addChildAt(fVideo, 0);
fVideo.autoRewind = false;
fVideo.addEventListener(VideoEvent.COMPLETE, VideoDonePlaying);
fVideo.addEventListener(VideoEvent.READY, VideoReady);Hmm. It's in connection with Dropbox. Så apparantly you can only use one of the two at the same time if you want the programs integrated in Finder.
-
Problem with loading data to Essbase
Hi All,
I have a problem with loading data into Essbase. I've prepared maxl script to load the data, calling rule file. The source table is located in RDBMS Oracle. The script works correctly, ie. generally loads data into Essbase.
But the problem lies in the fact, that after deletion of data from Essbase, when I'm trying to load it again from the source table I get the message: WARNING - 1003035 - No data values modified by load of this data file - although there is no data in Essbase... I've also tried to change the mode of loading data from 'overwrite' to 'add to existing values' (in rule file) but it does'nt help ... Any ideas what can I do?Below few lines from EPM_ORACLE_INSTANCE/diagnostics/logs/essbase/dataload_ODL.err:
[2013-09-24T12:01:40.480-10:01] [ESSBASE0] [AGENT-1160] [NOTIFICATION] [16][] [ecid:1379989900303,0] [tid:1116830016] Received Validate Login Session request
[2013-09-24T12:01:40.482-10:01] [ESSBASE0] [AGENT-1001] [NOTIFICATION] [16][] [ecid:1379989900303,0] [tid:1114724672] Received client request: Get App and Database Status (from user [admin@Native Directory])
[2013-09-24T12:01:54.488-10:01] [ESSBASE0] [AGENT-1001] [NOTIFICATION] [16][] [ecid:1379989900303,0] [tid:1101564224] Received client request: MaxL: Execute (from user [admin@Native Directory])
[2013-09-24T12:01:54.492-10:01] [ESSBASE0] [AGENT-1001] [NOTIFICATION] [16][] [ecid:1379989900303,0] [tid:1115777344] Received client request: MaxL: Describe (from user [admin@Native Directory])
[2013-09-24T12:01:54.492-10:01] [ESSBASE0] [MLEXEC-2] [NOTIFICATION] [16][] [ecid:1379989900303,0] [tid:1115777344] Output columns described
[2013-09-24T12:01:54.494-10:01] [ESSBASE0] [AGENT-1001] [NOTIFICATION] [16][] [ecid:1379989900303,0] [tid:1102616896] Received client request: MaxL: Define (from user [admin@Native Directory])
[2013-09-24T12:01:54.494-10:01] [ESSBASE0] [AGENT-1001] [NOTIFICATION] [16][] [ecid:1379989900303,0] [tid:1102616896] Received client request: MaxL: Fetch (from user [admin@Native Directory])
[2013-09-24T12:01:54.494-10:01] [ESSBASE0] [MLEXEC-3] [NOTIFICATION] [16][] [ecid:1379989900303,0] [tid:1102616896] Record(s) fetched
[2013-09-24T12:01:54.496-10:01] [ESSBASE0] [AGENT-1001] [NOTIFICATION] [16][] [ecid:1379989900303,0] [tid:1116830016] Received client request: MaxL: Fetch (from user [admin@Native Directory])
[2013-09-24T12:01:54.498-10:01] [ESSBASE0] [AGENT-1160] [NOTIFICATION] [16][] [ecid:1379989900303,0] [tid:1114724672] Received Validate Login Session request
[2013-09-24T12:01:54.499-10:01] [ESSBASE0] [AGENT-1001] [NOTIFICATION] [16][] [ecid:1379989900303,0] [tid:1101564224] Received client request: Get Application State (from user [admin@Native Directory]) -
Problem with loading file with SQL loader
i am getting a problem with loading a file with SQL loader. The loading is getting
terminated after around 2000 rows whereas there are around 2700000 rows in the file.
The file is like
919879086475,11/17/2004,11/20/2004
919879698625,11/17/2004,11/17/2004
919879698628,11/17/2004,11/17/2004
the control file, i am using is like:-
load data
infile 'c:\ran\temp\pps_fc.txt'
into table bm_05oct06
fields terminated by ","
(mobile_no, fcal, frdate )
I hope, my question is clear. Please help, in solving the doubt.
regards.So which thread is telling the truth?
Doubt with SQL loader file wih spaces
Are the fields delimited with spaces or with commas?
Perhaps they are a mixture of delimiters and that is where the error is coming in? -
I have a problem with loading the PNG image
I have a problem with loading the PNG image from site. For ex. go to icefilms com and is starts to load png like crazy CPU is huge and you can not shut down Firefox at least a minute. This is not just in this site but whit any one whit lots of pictures.
Image from firefox: Picture [http://img836.imageshack.us/img836/9910/7312011103147pm.jpg 1] [http://img28.imageshack.us/img28/8505/7312011103249pm.jpg 2] [http://img706.imageshack.us/img706/5615/7312011103348pm.jpg 3 ][http://img827.imageshack.us/img827/8483/7312011103533pm.jpg 4]
This is my Task Manager [http://img217.imageshack.us/img217/5715/7312011103621pm.jpg 1]
- I try safe mode, same thing
-All addons and plugins are ok
Any idea why is this so big problem.i did both of them, but still the while sending the mail the diolog box is not showing up and also the spelling and grammer does not do the spelling check.
This problem just started for about 3 to 4 days now. earlier it was working normally. -
Frustratingly, since I upgraded to Yosemite 10.10, I too am having the worst problems with WiFi dropping out. I've never had this problem before on my iMac 27-inch mid 2011 model. Turning WiFi off and then back on again sometimes works. Help please. I've already tried a lot of your suggested fixes, but without success. Why hasn't Apple Fixed this?
Please test after taking each of the following steps that you haven't already tried. Stop when the problem is resolved. Back up all data before making any changes.
Step 1
Take the applicable steps in this support article. The Wireless Diagnostics program generates a large file of information about your system, which would be used by Apple Engineering in case of a support incident. Don't post the contents here.
Step 2
Disconnect all USB 3 devices. If you don't know which are USB 3, disconnect all USB devices except keyboard and mouse.
Step 3
If you're not using a wireless keyboard or trackpad, disable Bluetooth by selecting Turn Bluetooth Off from the menu with the Bluetooth icon. If you don't have that menu, open the Bluetooth preference pane in System Preferences and check the box marked Show Bluetooth in menu bar. Test. If you find that Wi-Fi works better with Bluetooth disabled, you should use the 5 GHz Wi-Fi band. Your router may not support it; in that case, you need a new router.
Step 4
Open the Energy Saver pane in System Preferences and unlock the settings, if necessary. Select the Power Adapter tab, if there is one. Uncheck the box marked
Wake for Wi-Fi network access
if it's checked.
Step 5
Open the Network pane in System Preferences and make a note of your settings in the Wi-Fi service. It may be helpful to take screenshots of the various tabs in the preference pane. If the preference pane is locked, unlock it by clicking the padlock icon and entering your administrator password. Delete Wi-Fi from the service list on the left by selecting it and clicking the minus-sign button at the bottom. Then recreate the service by clicking the plus-sign button and following the prompts.
Step 6
In the Wi-Fi settings, select
Advanced... ▹ TCP/IP ▹ Configure IPv6: Link-local
Click OK and then Apply.
Step 7
Reset the System Management Controller.
Step 8
Reset the PRAM.
Step 9
Launch the Keychain Access application. Search for and delete all AirPort network password items that refer to the network. Make a note of the password first.
Step 10
Make a "Genius" appointment at an Apple Store, or go to another authorized service center. -
Problem with Loading Images?
<pre><i>Locking duplicate thread.
Please continue here: [[/questions/982030]]
</i></pre>
Hi,
I'm using Firefox 26.0 and I'm kinda new user to Firefox.
I'm having this random issue with facebook (sometimes with other websites too),
Sometimes when I open a page, the Images doesn't show as usual.
Sometimes it takes up to 10sec - 2 mnts to finish loading all the images.
My internet is 8Mbps so I don't think its due to that?
Here is a screenshot of the exact issue: http://i.imgur.com/I3eOQaI.jpg
But it get fixed for a while (say 1-2 days) if I clear the cookies and caches. I visits a lot of webpages so clearing cookies and caches all the times is kinda not pretty possible.
I also tried disabling all my add-ons, and ran a full scan with McAfee.
Can anyone tells me what exactly could be the issue? It gets pretty annoying sometimes!
Thanks in advance!
Regards,
Abey'''Hi, Thanks for Visiting this Question. But it was a duplicate of https://support.mozilla.org/en-US/questions/982030 (The Same question) Accidentally posted twice''' and I couldn't find an option to delete it, so please '''ignore''' this :-)
Original thread: [[https://support.mozilla.org/en-US/questions/982030|"Problem with Loading Images"]]
Warm Regards,
Abey -
Please help us, we have a problem with loading a page is slow we have to wait a longer time to open our one page, thanks in advance
You can try these steps in case of issues with web pages:
You can reload web page(s) and bypass the cache to refresh possibly outdated or corrupted files.
*Hold down the Shift key and left-click the Reload button
*Press "Ctrl + F5" or press "Ctrl + Shift + R" (Windows,Linux)
*Press "Command + Shift + R" (Mac)
Clear the cache and cookies only from websites that cause problems.
"Clear the Cache":
*Firefox/Tools > Options > Advanced > Network > Cached Web Content: "Clear Now"
"Remove Cookies" from sites causing problems:
*Firefox/Tools > Options > Privacy > "Use custom settings for history" > Cookies: "Show Cookies"
Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem.
*Switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance
*Do NOT click the Reset button on the Safe Mode start window
*https://support.mozilla.org/kb/Safe+Mode
*https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
Maybe you are looking for
-
Hi, My brand-new HP LaserJet Pro M201dw is suddenly not cooperating when I go to print using my Mac. I had it set up following the directions which closest matched my OS and it worked perfectly for one week; today suddenly it won't cooperate. The pri
-
I have recently upgraded a 2 year old HP Pavilion m9040n to a clean install Win7 64 Bit system with 8 GB of ram. I have installed all applicable updates from both MS and Adobe. The 64 Bit version of Ps had been functioning for about a week with no no
-
Offline / Online RT Confussion
I am having the hardest time with reconecting my footage. This is my workflow: I have capture HDV footage at full resolution. I want to edit at a lower resolution because it takes forever for my HDV footage to render when I apply even the simplest tr
-
Bank reconciliation for Fund transfer
Hi, Client have many bank accounts. He transfer fund from all banks at different places to its corporate bank account on daily basis (once in a day). In this case bank statement shows only reference as transferred to "XXXX bank account" for all trans
-
Cant select and delete text messages
Since the latest ios7 update i can no longer select and delete text messages. I have to delete the entire conversation. Anyone else having this problem? Is there a fix?