LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-07-2012, 04:07 AM   #1
Huamin
Member
 
Registered: May 2011
Posts: 520

Rep: Reputation: Disabled
Upload file issue


Hi,
Does anyone have any ideas that the below errors are happening due to line 59 & 71, for my app by Jdev 11.1.1.5?

public String UploadImage() {

UploadedFile myfile = (UploadedFile)this.getFile();

BindingContext bindingctx = BindingContext.getCurrent();
BindingContainer bindings = bindingctx.getCurrentBindingsEntry();
DCBindingContainer bindingsImpl = (DCBindingContainer)bindings;
DCIteratorBinding iter =
bindingsImpl.findIteratorBinding("UserTabView1_1Iterator");

Row row = iter.getCurrentRow();
59 row.setAttribute("pict", createBlobDomain(myfile));
60
61 return null;
62 }
63
64 private BlobDomain createBlobDomain(UploadedFile file) {
65
66 InputStream in = null;
67 BlobDomain blobDomain = null;
68 OutputStream out = null;
69
70 try {
71 in = file.getInputStream();
72 ...

Caused by: java.lang.NullPointerException
at view.backing.UploadImageClass.createBlobDomain(UploadImageClass.java:71)
at view.backing.UploadImageClass.UploadImage(UploadImageClass.java:59)

Many Thanks & Best Regards,
HuaMin
 
Old 06-08-2012, 04:11 AM   #2
Huamin
Member
 
Registered: May 2011
Posts: 520

Original Poster
Rep: Reputation: Disabled
Any advice to this?

Many Thanks & Best Regards,
HuaMin
 
Old 06-08-2012, 04:13 AM   #3
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,767

Rep: Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886
please try to use [code][/code] to keep formatting of your code.

NullPointerException means you tried to use the class file (line 71: file.getInputStream()), but probably it was null. You would need to check if this call UploadedFile myfile = (UploadedFile)this.getFile(); returned valid myfile.





_____________________________________
If someone helps you, or you approve of what's posted, click the "Add to Reputation" button, on the left of the post.
Happy with solution ... mark as SOLVED
(located in the "thread tools")
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] SFTP file upload bash script issue. moodah Programming 1 10-07-2010 11:55 PM
Can't upload anything. Maybe a Flash issue? joeyrf Ubuntu 1 02-22-2010 05:58 AM
Upload file to ftp server -vsftp- but can not delete or change the file once uploaded murattas6 Linux - Server 2 06-26-2009 07:00 AM
Redhat ES3 / vsftpd file upload permissions issue c955437 Linux - Software 4 07-19-2007 09:51 AM
Ftp issue can't upload 1jnike Solaris / OpenSolaris 6 05-15-2007 06:40 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration