How to solve this NullPointerException
Hello everyone
I have got addToBasket button on jsp page, and there is servlet called AddToBasketServlet to process this session. I try to add the productToAdd to the basket, (the code follows) but its ont working. The NullPointerExceptino cum up every time when its running to "product.getKimballNumber() " ,
ProductBean product =
( ProductBean ) session.getAttribute( "productToAdd" );
System.err.println(2);
// if basket does not exist, create it
if ( basket == null ) {
basket = new HashMap();
// set session attribute "basket"
session.setAttribute( "basket", basket );
System.err.println(3);
// determine if product is in basket
BasketBean basketItem =
( BasketBean ) basket.get( product.getKimballNumber() ); <<<<<< the exception occurs here
// if product is already in the basket , update its quantity
I dont no the reason. I have got "ProductBean productBean" in the jsp page, which represent the product to be added, another problem confusing me is how does the program know which Attribute "productToAdd" is pointing to.
Appreciate for any helps
You're fetching the product as a session-scope attribute. Where do you put that product into session scope with that attribute name? If you don't add the attribute before you fetch it, of course you'll get null.
So think about what JSP/servlet added that product to session before you reached this page and you'll be closer to the answer.
Similar Messages
-
Problem with an incoming message. For example, during my conversation the second line receives a call, I hear the sound in dynamics such as "piiiip piiiip," but when in this situation I recieve SMS and i hear established melody and I do't hear the person on all over SMS. How to solve this problem? Perhaps someone tell me? save in advance
Not Charge
- See:
iPod touch: Hardware troubleshooting
iPhone and iPod touch: Charging the battery
- Try another cable. The cable for 5G iPod (lightning connector) seems to be more prone to failure than the older cable.
- Try another charging source
- Inspect the dock connector on the iPod for bent or missing contacts, foreign material, corroded contacts, broken, missing or cracked plastic.
- Make an appointment at the Genius Bar of an Apple store.
Apple Retail Store - Genius Bar -
I'm trying to connect my 30" Cinema Display to my new Mac Pro along with a new Apple 23'" monitor. The new Apple monitor is fine. On the cinema monitor everything is blown up pretty large. Any ideas on how to solve this?
The 30" display needs a DUAL-LINK adapter.
<http://store.apple.com/us/product/MB571Z/A/mini-displayport-to-dual-link-dvi-ada pter> -
Hi, when ever I'm using 3G, on my Iphone4 sim stops working and network is lost, this started after I updated my phone with 6.0.1(10A523)version. Please help how to solve this problem. Thanks.
Photos/videos in the Camera Roll are not synced. Photos/videos in the Camera Roll are not touched with the iTunes sync process. Photos/videos in the Camera Roll can be imported by your computer which is not handled by iTunes. Most importing software includes an option to delete the photos/videos from the Camera Roll after the import process is complete. If is my understanding that some Windows import software supports importing photos from the Camera Roll, but not videos. Regardless, the import software should not delete the photos/videos from the Camera Roll unless you set the app to do so.
Photos/videos in the Camera Roll are included with your iPhone's backup. If you synced your iPhone with iTunes before the videos on the Camera Roll went missing and you haven't synced your iPhone with iTunes since they went missing, you can try restoring the iPhone with iTunes from the iPhone's backup. Don't sync the iPhone with iTunes again and decline the prompt to update the iPhone's backup after selecting Restore. -
I Try to open an Indesign document. The message: it is made in a newer version. Go tot CC: Help/Give your Adobe id/Start Indesign again and try to open the document. This doesn’t work. How to solve this problem?
What version are you running?
What version was it made with? -
The top picture is what my Desktop 1 looks like. And the picture below is what my desktop looks like after clicking mission control. Ive tried changing wallpapers, changing preferences, etc. and I still can't figure out what's wrong. As you can see, on mission control you can't see any of the open windows, or anything that I have placed on my desktop. Any ideas as to how to solve this issue?
Hello cor-el, thanks for your reply. I changed my settings for downloads to desktop and it has appeared on there. When I double click I am asked which program I want to open file. I click firefox and another box "opening install" says I have chosen to open the file which is an application and do I want to save it. This is the only real option so I press save file. I get a box saying this is an executable file which may contain viruses - do you want to run. I press ok and the final box showing C drive file name and desktop appears stating application not found.
This happens the same whenever I try to install.
To my untrained eye the application is not being recognised as an application and I cannot work out how to get it to do that.
My plugin is still showing as out of date.
Is there anything you could suggest. Thanks for your time. -
Hello guys..!! I have got my new iphone 4 2 days ago.The same day it got a problem of auto restart in every 1, to 2 minutes. I updated and restored it many times...but of no use... can any one help me how to solve this problem..!!
Go to Settings/General/Reset - Erase all content and settings. the connecto to iTunes and restore as a New phone. Do not restore any backup. If the problem persists you have a hardware problem. Take it to Apple for exchange.
This assumes that the phone is not hacked or jailbroken. If it is you will have to go elsewhere on the internet for help. -
Does anyone know how to solve this problem: I a trying to download a paid app but I cannot because the AppStore says that info not have enough space to download it even though I have more than enough space so if any of you know what can solve this problem then please let me know
The app is compressed and needs swap space to install. As a rule of thumb you need 3 times the listed size of the app available, or in your case 4.6GB. You only have 1.7GB.
-
iphone 4 is hiting in ios 5.1.1. any one know how to solve this problem??
This sounds like a hardware problem and should be taken to Apple if the heating / "hiting" becomes disturbing to you. If you feel that your iPhone has a heating / "hiting" problem and needs to be repaired, please contact Apple Support and they can further assist you in having it inspected, repaired, or even replaced. In the past, the overheating of Apple products has been known to cause harmful problems to a few particular users. Please evaluate your situation and take further action if you feel necessary.
http://www.apple.com/support/contact/ -
Transaction failed for unknown reason (100) Unable to complete backup at this time. Does anyone know how to solve this issue?
Thanks.The system is set up to backup files to the iCloud at the end of the day. This has ot happen for sometime now and the mesaage I get is the back up error.
-
How to solve this error java.util.MissingResourceException
Hi Friends,
I had developed one web dynpro application by using Internationalization - I18N of WebDynPro (Java) Application (Blog) but I got one error that is
<b>java.util.MissingResourceException: Can't find bundle for base name com.sap.example.language.lang, locale en_US</b>
Actually i created two properties file
1. lang_en.properties
2. lang_ta.properties
I stored this two properties file in this package com.sap.example.language
and this my code in DOInit()
sessionLocale = WDClientUser.getCurrentUser().getLocale();
resourceHandler = ResourceBundle.getBundle("com.sap.example.language.lang",sessionLocale);
catch (WDUMException e)
e.printStackTrace();
wdContext.currentContextElement().setUsername_label(resourceHandler.getString("testview.username"));
wdContext.currentContextElement().setPassword_label(resourceHandler.getString("testview.password"));
How to solve this error?
Guide me.
Advance Thanks,
BalajiHi Friends,
I had developed one web dynpro application by using Internationalization - I18N of WebDynPro -Java Application (Blog) but I got one error that is
<b>java.util.MissingResourceException: Can't find bundle for base name com.sap.example.language.lang, locale en_US</b>
Actually i created two properties file
1. lang_en.properties
2. lang_ta.properties
I stored this two properties file in this package com.sap.example.language
and this my code in DOInit()
sessionLocale = WDClientUser.getCurrentUser().getLocale();
resourceHandler = ResourceBundle.getBundle("com.sap.example.language.lang",sessionLocale);
catch (WDUMException e)
e.printStackTrace();
wdContext.currentContextElement().setUsername_label(resourceHandler.getString("testview.username"));
wdContext.currentContextElement().setPassword_label(resourceHandler.getString("testview.password"));
How to solve this error?
Guide me.
Advance Thanks,
Balaji -
Get error message when syching iPod, iPod cannot be synced. You do not have enough access priveleges for this operation. How to solve this?
Hello FranBNYC
It sounds like a permissions issue with your library, check out the article below to check and make sure that things are set correctly.
Trouble adding music to iTunes library or importing audio CD
http://support.apple.com/kb/ts1387
Thanks for using Apple Support Communities.
Regards,
-Norm G. -
Hi, my Ipod Schuffle (4 gen) dissapears from windows vista right after I execute Itunes, I've change the drive letter, erase temps in App data file, verified USB drivers, etc... Can someone guide on how to solve this?
If you want the shuffle to be always visible in Windows (outside of iTunes), you need to Enable disk use.
Select the shuffle in the iTunes sidebar, under DEVICES. Over to the right, select the Summary tab. You should see a checkbox that says Enable disk use. Check it and click Apply.
NOTE: If disk use is enabled, you have to Eject the shuffle in iTunes, BEFORE you physically disconnect it. If disk use is NOT enabled, you can disconnect the shuffle at any time, as long as iTunes is not doing something with it at that moment (such as syncing); the shuffle's light will then be blinking (to indicate DO NOT DISCONNECT).
So, unless you want to use the shuffle like a USB flash drive (carry random files on it), you may want to NOT Enable disk use. -
I'm using windows 8 on my pc, and i have just downloaded the latest version of itunes, after i upgraded the latest version of itunes, it can't detect my iphone, but my windows/my pc does. Anyone knows how to solve this problem?
Hi jstutsman,
If you are having issues with your iPod nano not being recognized in iTunes after a recent update, you may find the steps and links listed in the following article helpful:
iPod not appearing in iTunes - Apple Support
Regards,
- Brenden -
My external hard drive will no longer connect to my macbook pro via FW800........Any ideas on how to solve this??
Reset the SMC, see this Apple note: http://support.apple.com/kb/HT3964
Also reset the PRAM:
Shut down the computer.
Locate the following keys on the keyboard: Command, Option, P, and R. You will need to hold these keys down simultaneously in step 4.
Turn on the computer.
Press and hold the Command-Option-P-R keys. You must press this key combination before the gray screen appears.
Hold the keys down until the computer restarts and you hear the startup sound for the second time.
Release the keys.
In most cases, those two actions will fix the port issue. If it's still an issue, you may need to see if the external hard drive can connect to another system, to ensure it's not having problems.
Maybe you are looking for
-
HT2486 Is there a way to open two windows with address book on my computer?
Is there a way to open two windows with address book on my computer?
-
The ipod cannot be synced because it cannot be found
All - I just tried downloading the new iOS 6 from iTunes to my 4th-Gen iPod Touch, which currently has iOS 4.3. After about 2/3 of the (very long) time downloading, I kept getting 'the ipod '(my name)' cannot be synced because it cannot be found'.
-
Time capsule problems since Maverick upgrade
Maverick forced an upgrade from Airport Utility 5.6 to the latest version. I am now unable to connect via wifi. I stayed with Airport 5.6 throughout previous upgrades because it allowed me to easily convert between ethernet and wifi. I back up large
-
Table for parked and posted vendor bills for purchase order.
Gurus In which table purchase order histroy data is stored? Is there any standard report for viewing following po no,PO date,line item no.,material code,ordered quantity,GRN date,GRN qty,GRN amount,parked qty,parked amount,posted qty, posted amount.
-
Unable to save the sales order in varient configuration
Hi Gurus, In varient configuration i have done all the settings and it works fine, and i am getting one error while saving the sale order(incomplete long) showing configuration. while click the error shwoing like this : Item 000011 can only be c