Null Pointer Exception and Illegal Arguement when ran with Wireless Toolkit
The following code throws a null pointer exception after it tried to initialize the textBox. I am not sure if there is something I am not importing, or if it's just because I'm sick and my head is cloudy. :-}.
I am using Wireless Toolkit 2.2 and Java 5.0
Anyhelp would be appreicated. Thank You.
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class TacticalTestMain extends MIDlet implements CommandListener {
private Display display;
private Form formMain;
private TextBox tbHelp; //Text Box for help Command
private Command cmExit; //A button to exit midLet
private Command cmBack; //Go "back" to main form
private Command cmHelp; //Ask for help
public TacticalTestMain()
display = Display.getDisplay(this);
formMain = new Form("Tactical Survey Program");
cmExit = new Command("Exit", Command.SCREEN, 1);
cmBack = new Command("Back", Command.BACK, 1);
cmHelp = new Command("Help", Command.HELP, 1);
formMain.addCommand(cmExit);
formMain.addCommand(cmBack);
formMain.addCommand(cmHelp);
formMain.setCommandListener(this);
System.out.println("Before Create Text Box");
//Create the help textBox with a max of 25 charecters
tbHelp = new TextBox("HeLp", "You can press the back button", 25, 0);
tbHelp.addCommand(cmBack);
tbHelp.setCommandListener(this);
System.out.println("AfTER Create Text Box");
}//end constructor
public void startApp()
System.out.println("Inside StartApp()");
display.setCurrent(formMain);
}//end startApp()
public void pauseApp()
}//end pauseApp
public void destroyApp(boolean unconditional)
notifyDestroyed();
}//end destroyApp()
//Check to see if the exit button was selected
public void commandAction(Command c, Displayable d)
System.out.println("Inside commandAction()");
String sLabel = c.getLabel();
if(sLabel.equals("Exit"))
destroyApp(true);
Errors from the KToolbar:
Running with storage root DefaultColorPhone
Before Create Text Box
Unable to create MIDlet TacticalTestMain
java.lang.IllegalArgumentException
at javax.microedition.lcdui.TextField.setChars(+105)
at javax.microedition.lcdui.TextField.setString(+27)
at javax.microedition.lcdui.TextField.<init>(+134)
at javax.microedition.lcdui.TextBox.<init>(+74)
at TacticalTestMain.<init>(+134)
at java.lang.Class.runCustomCode(+0)
at com.sun.midp.midlet.MIDletState.createMIDlet(+19)
at com.sun.midp.midlet.Selector.run(+22)
Execution completed.
743701 bytecodes executed
23 thread switches
741 classes in the system (including system classes)
4071 dynamic objects allocated (120440 bytes)
2 garbage collections (91412 bytes collected)
Hi zoya,
Here is the problem:
tbHelp = new TextBox("HeLp", "You can press the back button", 25, 0);
This line declares a maximum textbox size of 25 but in reality he is declaring a textbox of size 29.
Thats why it is throwing the illegal argument.
happy coding :)
Similar Messages
-
Null pointer exception and servlet
I cant figure out why i am getting a null pointer exception. this works if i keep my form output in the same class as my driving servlet. All i did was break off the html display to a new form and i get a null pointer exception.
this is just an excerpt. no reason to post the whole form.
Here are my two classes...
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
import java.text.*;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.*;
import org.w3c.dom.Document;
import org.w3c.dom.DOMException;
import org.w3c.dom.Element;
public class myServlet extends HttpServlet
implements SingleThreadModel {
displayScreen myAddressBook;
HttpServletRequest request;
HttpServletResponse response;
String displayForm = "DISPLAYFORM";
String addForm = "ADDFORM";
String editForm = "EDITFORM";
// get function
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException
request = this.request;
response = this.response;
displayScreen myAddressBook = new displayScreen(this.request,this.response);
myAddressBook.sendAddressBook(request,response,false,displayForm);
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
errorMsg = "";
errCount=0;
//stores address book in hashmap. Not currently using Address Book object
request = this.request;
response = this.response;
if ((request.getParameterValues("submit")[0].equals("Next")))
myAddressBook.sendAddressBook(request,response,false,displayForm);
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
import java.text.*;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.*;
public class displayScreen {
int errCount;
String errorMsg;
String displayForm = "DISPLAYFORM";
String addForm = "ADDFORM";
String editForm = "EDITFORM";
HttpServletRequest request;
HttpServletResponse response;
displayScreen (HttpServletRequest request, HttpServletResponse response) {
request = this.request;
response = this.response;
public void sendAddressBook (HttpServletRequest request, HttpServletResponse response,boolean FileError,String formType)
throws ServletException, IOException {
request = this.request;
response = this.response;
response.setContentType("text/html"); /*****/ I GET A NULL POINTER EXCEPTION RIGHT HERE!!!!!!
}anyway to write the system.err to an html screen with
a servlet?Why would you ask that? Surely you should have asked "Any way to write a stack trace to an HTML screen from a servlet?"
And in fact there is. I am sure you have not yet looked up the Exception class and the versions of its printStackTrace() method. But when you do, you will see that there are printStackTrace(PrintStream) and printStackTrace(PrintWriter). And you know how to write HTML (or text in general) to the servlet response so that it shows up in the client's browser, right? I will let you figure out how to put those things together. -
Adding a new UDF throws a null pointer exception and modifying user.xml
Hello,
I have a two part question.
i. I am trying to add a UDF (using Advanced>User Configuration..Attributes) to a fully configured OIM i.e. oim with reconciliation and provisioning from and to resources but it throws a null pointer exception. Look at the log, I see
===============Excerpt form the log file==========
[2012-01-26T11:28:14.447-05:00] [oim_server1] [NOTIFICATION] [] [oracle.iam.platform.authz.impl] [tid: [ACTIVE].ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: xelsysadm] [ecid: 0000JKQq8vZ8dpC5nFk3yZ1Evvpt000LzY,0] [APP: oim#11.1.1.3.0] [dcid: c62f3a4b80d21e6f:ef93519:134587d39c4:-7ffd-0000000000022a3e] [[
---Stack Trace Begins[[This is not an exception. For debugging purposes]]---
oracle.iam.platform.authz.impl.OESAuthzServiceImpl.doCheckAccess(OESAuthzServiceImpl.java:210)
oracle.iam.platform.authz.impl.OESAuthzServiceImpl.hasAccess(OESAuthzServiceImpl.java:188)
oracle.iam.platform.authz.impl.OESAuthzServiceImpl.hasAccess(OESAuthzServiceImpl.java:180)
oracle.iam.platform.authz.impl.AuthorizationServiceImpl.hasAccess(AuthorizationServiceImpl.java:173)
oracle.iam.configservice.impl.ConfigManagerImpl.checkAuthorization(ConfigManagerImpl.java:1899)
oracle.iam.configservice.impl.ConfigManagerImpl.addAttribute(ConfigManagerImpl.java:177)
oracle.iam.configservice.api.ConfigManagerEJB.addAttributex(Unknown Source)
... 21 lines skipped..
oracle.iam.configservice.api.ConfigManager_5u0nrx_ConfigManagerRemoteImpl.addAttributex(ConfigManager_5u0nrx_ConfigManagerRemoteImpl.java:864)
... 13 lines skipped..
oracle.iam.configservice.api.ConfigManagerDelegate.addAttribute(Unknown Source)
oracle.iam.configservice.agentry.config.CreateAttributeActor.perform(CreateAttributeActor.java:266)
oracle.iam.consoles.faces.mvc.canonic.Model.perform(Model.java:547)
oracle.iam.consoles.faces.mvc.admin.Model.perform(Model.java:324)
oracle.iam.consoles.faces.mvc.canonic.Controller.doPerform(Controller.java:255)
oracle.iam.consoles.faces.mvc.canonic.Controller.doSelectAction(Controller.java:178)
oracle.iam.consoles.faces.event.NavigationListener.processAction(NavigationListener.java:97)
... 24 lines skipped..
oracle.iam.platform.auth.web.PwdMgmtNavigationFilter.doFilter(PwdMgmtNavigationFilter.java:115)
... weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
oracle.iam.platform.auth.web.OIMAuthContextFilter.doFilter(OIMAuthContextFilter.java:100)
... 15 lines skipped..
weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
---Stack Tracefor this call Ends---
[2012-01-26T11:28:14.447-05:00] [oim_server1] [NOTIFICATION] [IAM-1010010] [oracle.iam.platform.authz.impl] [tid: [ACTIVE].ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: xelsysadm] [ecid: 0000JKQq8vZ8dpC5nFk3yZ1Evvpt000LzY,0] [APP: oim#11.1.1.3.0] [dcid: c62f3a4b80d21e6f:ef93519:134587d39c4:-7ffd-0000000000022a3e] [arg: 1] [arg: null] [arg: USER_MANAGEMENT_CONFIG] [arg: CREATE_ATTRIBUTE] ********** Entering the Authorization Segment with parameters:: LoggedInUserId = 1, target resourceID = null, Feature = USER_MANAGEMENT_CONFIG, Action = CREATE_ATTRIBUTE **********
[2012-01-26T11:28:14.448-05:00] [oim_server1] [NOTIFICATION] [IAM-1010021] [oracle.iam.platform.authz.impl] [tid: [ACTIVE].ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: xelsysadm] [ecid: 0000JKQq8vZ8dpC5nFk3yZ1Evvpt000LzY,0] [APP: oim#11.1.1.3.0] [dcid: c62f3a4b80d21e6f:ef93519:134587d39c4:-7ffd-0000000000022a3e] [arg: [InternalObligation: name: noop, values: [true], convertToObligation: false, InternalObligation: name: noop, values: [true], convertToObligation: false]] Validating the Internal Obligations: [InternalObligation: name: noop, values: [true], convertToObligation: false, InternalObligation: name: noop, values: [true], convertToObligation: false]
[2012-01-26T11:28:14.448-05:00] [oim_server1] [NOTIFICATION] [IAM-1010022] [oracle.iam.platform.authz.impl] [tid: [ACTIVE].ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: xelsysadm] [ecid: 0000JKQq8vZ8dpC5nFk3yZ1Evvpt000LzY,0] [APP: oim#11.1.1.3.0] [dcid: c62f3a4b80d21e6f:ef93519:134587d39c4:-7ffd-0000000000022a3e] ---------- The list of Internal Obligation is satisfied, returning TRUE ----------
[2012-01-26T11:28:14.448-05:00] [oim_server1] [NOTIFICATION] [IAM-1010026] [oracle.iam.platform.authz.impl] [tid: [ACTIVE].ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: xelsysadm] [ecid: 0000JKQq8vZ8dpC5nFk3yZ1Evvpt000LzY,0] [APP: oim#11.1.1.3.0] [dcid: c62f3a4b80d21e6f:ef93519:134587d39c4:-7ffd-0000000000022a3e] [arg: Decision :PERMIT\nObligations from policy: ] ********** Exiting the Authorization Segment with result Decision :PERMIT[[
=============Excerpt ends==============
Is there a reason why this is and how do I get by it.
ii. Can I just add the field directly within the MDS>file/user.xml? Would there be an issue with changing an existing attribute metadata using the user.xml?Pradeep thank you for your response. it was helpful. However, I also found the responses to both my questions.
i. The null pointer exception was due to using a complex query I was using in the LOV query. I tried a simple query and that worked fine.
ii. For modifying the user defined attributes one can consult the following forum post:
OIM 11g - Change UDF Field Type form String to LOV
Thanks -
Null Pointer Exception on Dynamic vo when drag as dynamic table in popup
Hi All,
i am using jdev version 11.1.1.5.0. i have create one dynamic vo and drag as dynamic table. it is running fine but when i drag it in popupwindow and when i click on button on action listener
change query of dynamic vo then following error occur.
<UIXRegion> <_warn> Error processing viewId: /stmreqapply-task-flow-definition/StmReqApply.jsff URI: /StmReqApply.jsff actual-URI: /StmReqApply.jsff.
java.lang.NullPointerException
at oracle.adfinternal.view.faces.dynamic.DynamicForm.isRefreshNecessary(DynamicForm.java:503)
at oracle.adfinternal.view.faces.dynamic.DynamicForm.createChildren(DynamicForm.java:370)
at oracle.adfinternal.view.faces.dynamic.DynamicForm.encodeBegin(DynamicForm.java:280)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:928)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:399)
at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2633)
at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer._encodeChild(PanelGroupLayoutRenderer.java:432)
at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.access$300(PanelGroupLayoutRenderer.java:30)
at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:682)
at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:601)
at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:170)
at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:290)
at org.apache.myfaces.trinidad.component.UIXComponent.encodeFlattenedChildren(UIXComponent.java:255)
at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.encodeAll(PanelGroupLayoutRenderer.java:358)
at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:937)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:399)
at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2633)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:415)
at oracle.adfinternal.view.faces.renderkit.rich.PanelWindowRenderer.encodeContent(PanelWindowRenderer.java:608)
at oracle.adfinternal.view.faces.renderkit.rich.PanelWindowRenderer.encodeAll(PanelWindowRenderer.java:457)
at oracle.adfinternal.view.faces.renderkit.rich.DialogRenderer.encodeAll(DialogRenderer.java:143)
at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:937)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:399)
at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2633)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:415)
at oracle.adfinternal.view.faces.renderkit.rich.PopupRenderer.encodeAll(PopupRenderer.java:776)
at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:937)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:399)
at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2633)
at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer._encodeChild(PanelGroupLayoutRenderer.java:432)
at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.access$300(PanelGroupLayoutRenderer.java:30)
at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:682)
at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:601)
at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:170)
at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:290)
at org.apache.myfaces.trinidad.component.UIXComponent.encodeFlattenedChildren(UIXComponent.java:255)
at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.encodeAll(PanelGroupLayoutRenderer.java:358)
at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:937)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:399)
at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2633)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:415)
at oracle.adfinternal.view.faces.renderkit.rich.PanelBoxRenderer._encodeAllChildren(PanelBoxRenderer.java:1352)
at oracle.adfinternal.view.faces.renderkit.rich.PanelBoxRenderer._renderContentRow(PanelBoxRenderer.java:1265)
at oracle.adfinternal.view.faces.renderkit.rich.PanelBoxRenderer.encodeAll(PanelBoxRenderer.java:355)
at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:937)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:399)
at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2633)
at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer._encodeChild(PanelGroupLayoutRenderer.java:432)
at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.access$300(PanelGroupLayoutRenderer.java:30)
at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:682)
at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:601)
at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:170)
at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:290)
at org.apache.myfaces.trinidad.component.UIXComponent.encodeFlattenedChildren(UIXComponent.java:255)
at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.encodeAll(PanelGroupLayoutRenderer.java:358)
at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:937)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:399)
at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2633)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:415)
at oracle.adfinternal.view.faces.renderkit.rich.RegionRenderer._encodeChildren(RegionRenderer.java:278)
at oracle.adfinternal.view.faces.renderkit.rich.RegionRenderer.encodeAll(RegionRenderer.java:201)
at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
at oracle.adf.view.rich.component.fragment.UIXRegion.encodeEnd(UIXRegion.java:300)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:937)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:399)
at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2633)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:415)
at oracle.adfinternal.view.faces.renderkit.rich.FormRenderer.encodeAll(FormRenderer.java:220)
at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:937)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:399)
at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2633)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:415)
at oracle.adfinternal.view.faces.renderkit.rich.DocumentRenderer.encodeAll(DocumentRenderer.java:1273)
at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:937)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:933)
at com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:266)
at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:197)
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:189)
at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:193)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._renderResponse(LifecycleImpl.java:800)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:294)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:214)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:106)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177)
at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
<LifecycleImpl> <_handleException> ADF_FACES-60098:Faces lifecycle receives unhandled exceptions in phase RENDER_RESPONSE 6Thanks in Advanceone important thing is that when i drag dynamic vo in jspx page running fine. but when i used it on fragment page(jsff) then Null poiner exception occur.
i am using following tutorial to create dynamic table.
https://blogs.oracle.com/shay/entry/adf_faces_dynamic_tags_-fora
is there any solution?
error is following-
java.lang.NullPointerException
at oracle.adfinternal.view.faces.dynamic.DynamicForm.isRefreshNecessary(DynamicForm.java:503)
at oracle.adfinternal.view.faces.dynamic.DynamicForm.createChildren(DynamicForm.java:370)
at oracle.adfinternal.view.faces.dynamic.DynamicForm.encodeBegin(DynamicForm.java:280)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:928)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:399)
at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2633)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:415)
at oracle.adfinternal.view.faces.renderkit.rich.RegionRenderer._encodeChildren(RegionRenderer.java:278)
at oracle.adfinternal.view.faces.renderkit.rich.RegionRenderer.encodeAll(RegionRenderer.java:201)
at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)And when i have refresh page it is running fine.
Edited by: Manish on २५ दिसंबर, २०१२ ६:२८ अपराह्न -
I can't figure out why I'm getting a Null Pointer Exception
I'm writing a program that calls Bingo numbers. I got that part of the program to work but when I started adding Swing I kept getting a Null Pointer Exception and I don't know how to fix it. The Exception happens on line 15 of class Panel (g = image.getGraphics();). Here is the code for my classes. I'm still not finished with the program and I can't finish it until I know that this issue is resolved.
package Graphics;
import java.awt.Graphics;
import javax.swing.JFrame;
public class DrawFrame extends JFrame{
public Panel panel;
public DrawFrame(int x, int y, String s) {
super(s);
this.setBounds(0, 0, x, y);
this.setResizable(false);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setPreferredSize(getSize());
panel = this.getPanel();
this.getContentPane().add(panel);
panel.init();
this.setVisible(true);
public Graphics getGraphicsEnvironment(){
return panel.getGraphicsEnvironment();
Panel getPanel(){
return new Panel();
package Graphics;
import javax.swing.JPanel;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Image;
public class Panel extends JPanel{
Graphics g;
Image image;
public void init() {
image = this.createImage(this.getWidth(), this.getHeight());
g = image.getGraphics();
g.setColor(Color.white);
g.fillRect(0, 0, this.getWidth(), this.getHeight());
Graphics getGraphicsEnvironment() {
return g;
public void paint(Graphics graph) {
if (graph == null)
return;
if (image == null) {
return;
graph.drawImage(image, 0, 0, this);
package Graphics;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
public class Keys extends KeyAdapter{
public int keyPressed; //creates a variable keyPressed that stores an integer
public void keyPressed(KeyEvent e) { //creates a KeyEvent from a KeyListner
keyPressed = e.getKeyCode(); //gets the key from the keyboard
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.event.KeyEvent;
import Graphics.*;
public class Bingo {
static Ball balls[][] = new Ball[5][15]; //creates a 2D 5 by 15 array
public static void main(String[] args) {
DrawFrame frame = new DrawFrame(1500, 500, "Welcome to the automated Bingo Caller."); //creates instance of DrawFrame that is 1000 pixels wide and 500 pixels high
Graphics g = frame.getGraphicsEnvironment(); //calls the getGraphicsEnvironment method in the DrawFrame class
Keys key = new Keys(); //creates instance of the Key class
frame.addKeyListener(key); //adds a KeyListener called Key
for (int x = 0; x < 5; x++) { //fills rows
for (int y = 0; y < 15; y++) { //fills columns
balls[x][y] = new Ball(x, y+1); //fills array
frame.pack(); //adjusts the size of the frame so everything fits
g.setColor(Color.black); //sets the font color to black
g.setFont(new Font("MonoSpace", Font.PLAIN, 20)); //creates new font
for(int y=0;y<balls.length;y++){ //draws all possible balls
g.drawString(balls[y][0].s, 0, y*100); //draws numbers
for(int x=0;x<balls[y].length;x++){ //draws all possible balls
g.drawString(balls[y][x].toString(), (x+1)*100, y*100); //draws letters
do {
frame.repaint(); //repaints the balls when one is called
int x, y; //sets variables x and y as integers
boolean exit; //sets a boolean to the exit variable
do {
exit = false; //exit is set to false
x = (int)(Math.random() * 5); //picks a random number between 0 and 4 and stores it as x
y = (int)(Math.random() * 15); //picks a random number between 0 and 14 stores it as y
if (!balls[x][y].called) { //checks to see if a value is called
exit = true; //changes exit to true if it wasn't called
balls[x][y].called = true; //sets called in the Ball class to true if it wasn't called
System.out.println(balls[x][y]); //prints value
} while (!exit); //if exit is false, returns to top of loop
int count = 0; //sets a count for the number of balls called
for(int z=0;z<balls.length;z++){ //looks at balls
g.setColor(Color.black); //displays in black
g.drawString(balls[z][0].s, 0, z*100); //draws balls as a string
for(int a=0;a<balls[z].length;a++){ //looks at all balls
if (balls[z][a].called){ //if a ball is called
g.setColor(Color.red); //change color to red
count++; //increments count
} else {
g.setColor(Color.black); //if it isn't called stay black
g.drawString(balls[z][a].toString(), (a+1)*100, y*100); //draws balls as string
do {
if (key.keyPressed == KeyEvent.VK_R||count==5*15) { //if R is pressed or count = 5*15
count=5*15; //changes count to 5*15
for(int z=0;z<balls.length;z++){ //recreates rows
g.setColor(Color.black); //sets color to black
g.drawString(balls[z][0].s, 0, z*100); //redraws rows
for(int a=0;a<balls[z].length;a++){ //recreates columns
balls[z][a] = new Ball(z, a+1); //fills array
g.drawString(balls[z][a].toString(), (a+1)*100, z*100); //redraws columns
} while (key.keyPressed!=KeyEvent.VK_ENTER || count == 5 * 15); //determines if the key was pressed or counter is 5*15s
} while (key.keyPressed == KeyEvent.VK_ENTER);
public class Ball {
String s; //initiates s that can store data type String
int i; //initiates i that can store data as type integer
boolean called = false; //initiates called as a boolean value and sets it to false
public Ball(int x, int y) {
i = (x * 15) + y; //stores number as i to be passed to be printed
switch (x) { //based on x value chooses letter
case 0:
s = "B";
break;
case 1:
s = "I";
break;
case 2:
s = "N";
break;
case 3:
s = "G";
break;
case 4:
s = "O";
public String toString() { //overrides toString method, converts answer to String
return s + " " + i; //returns to class bingo s and i
}The javadoc of createImage() states that "The return value may be null if the component is not displayable."
Not sure, but it may be that you need to call init() after this.setVisible(true). -
Null Pointer exception in Webshop
Hi,
We are facing a problem of null pointer exception in the webshop when opening the product details (only in case of handful of products and not for other products) from the hyperlink of the product in the basket.
The product itself appears with short description as soon as we type the product ID in the basket along with price. Still, only for certain products, we always get the null pointer exception when opening the hyperlink of the product details.
The logs of initial replication as well as delta replications later on do not indicate any errors during replication.
These few products are no different from the rest that are OK in the webshop. The details in the product master is also no different. I have tried delta replication multiple times and all of them have been successful. The trace at Unix level also did not help much.
Can somebody help?
Rgds
ShankarShankar
Check the follwoing SAP Note : 970044
Also try RESTARTing the Webshop application using Visual Admin.
Thanks
Jack
<b>Allot points if my post helps !</b> -
Null Pointer Exception Error's in WebDynpro Java
Hi All,
How Types are coming Null Pointer Exception Error's in WebDynpro Java, Please provide the types.of Errors.
Ex. Cardinality Type not correct etc...
Thanks,
Bye,
Vijay Hari.HI
Null Pointer Exception can occur in may instances , for suppose
1) when you create a Value Node with some attribute which has cardinality , and you have not
initialized the Node , then it would through Null Pointer exception ,
2) when you integrate the RFC and parameters you pass as input to the RFC are not set correctly
then there could be null pointer when you execute the RFC
3>or may be when you doesnot bind the node when using webservice then there could be null pointer exception
and there could be many occurances for the exception -
Help in null pointer exception
I have a null pointer exception and i cant figure out which variable is null,
This is my servlet code.
ArrayList pmArray = pDAO.getPlacemarkByRegion(northEastLong, northEastLat, southWestLat, southWestLat);
//loop through the placemark
for ( int i=0; i< pmArray.size();i++) {
Placemark pm = (Placemark)pmArray.get(i);
// parse string
String pmId = pm.getPlacemarkid()+"";
String pmLat = pm.getLatitude()+"";
String pmLong = pm.getLongtitude()+"";
String s = "{\"markers\":[ " +
"{\"placemarkid\" : + pmId , \"latitude\" : + pLat , \"longtitude\": + pmLong} + ]}";
System.out.println(s);This is my DAO class
public ArrayList getPlacemarkByRegion(double northEastLong, double northEastLat, double southWestLong, double southWestLat)When i get the placemark andNullPointerException appear. I think that my Arraylist is incorrect, I have also try-catch exception in the servlet but it still show me null pointer. Can anyone please kindly guide me?
Message was edited by:
peebuhmm, i have solved my sql syntext already, but i still manage to get pmArray null.
I have check through my codes but pmArray is still null.
try{
pDAO = new PlacemarkDAO();
ArrayList pmArray = pDAO.getPlacemarkByRegion(northEastLong,northEastLat,southWestLong, southWestLat);
if(pmArray!=null && pmArray.size()>0){ //Check if the method pDao.getPlacemarkByRegion return a null to pmArray
for ( int i=0; i< pmArray.size();i++) {
Placemark pm = (Placemark)pmArray.get(i);
if(pm!=null){ //check if the instance pm is null
String pmId = pm.getPlacemarkid()+"";
String pmLat = pm.getLatitude()+"";
String pmLong = pm.getLongtitude()+"";
out.println("{\"markers\" : [ {\"placemarkid\":, \"latitude\" :, \"longtitude\" :}," +
"{\"placemarkid\" :, \"latitude\":, \"longtitude\" :}," +
"{\"placemarkid\" :, \"latitude\" :, \"longtitude\" :}" +
}else{
System.out.println("Error in: "+i + " element"); //if pm instance is null then return the element position of the pmArray
}else{
System.out.println("pmArray is null");
catch(Exception e)
e.printStackTrace();
out.close();
}Hmm, anyone can tell me why is it still null ? is it still related to my DAO class? Or i have lacked out something?Can anyone please give me pointers and guide me along? -
Null pointer exception in jsp ,data missing in chat application
Hi all....
I have a chat application in jsp using ajax.I have opened a d/b connection in a jsp which is called each time I sent a message.But sometimes I get null pointer exception in this page when msgs are sent so fast...also I miss some of the msgs I sent....I can't avoid that connection ther..When I commented all those d/b connection statements...everything is working fine..Please suggest me any solution...
Thanks in advance.Hi,
Am not getting exception now.In the jsp wer I ve written connection,am taking some values using request.getParameter("msg") . I had opened the connection statement before getting these parameter values.Think I ws getting null pointer exception due to this.Now I have opened connection after getting these parameter values...anyway am not getting the exception now...
Thanks. -
While trying to send mail getting NUll Pointer exception
Hi,
I am trying to send email through email notification but instance doesn't through any fault but on opmn log it sends null pointer exception and doesn't send any mail. But some other flow using same SMTP server are able to send mail.
Exceptions:
07/11/14 16:46:25 java.lang.NullPointerException
07/11/14 16:46:25 at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:363)
07/11/14 16:46:25 at oracle.tip.pc.services.notification.email.EmailDriver.sendMessage(EmailDriver.java:207)
07/11/14 16:46:25 at oracle.tip.pc.services.notification.email.EmailDriver.send(EmailDriver.java:185)
07/11/14 16:46:25 at oracle.tip.pc.services.notification.DefaultNotificationServiceImpl.sendEmailNotification(DefaultNotificationServiceImpl.java:251)
07/11/14 16:46:25 at oracle.tip.pc.services.notification.NotificationServiceImpl.sendEmailNotification(NotificationServiceImpl.java:271)
07/11/14 16:46:25 at oracle.bpel.services.notification.queue.sender.MDBConsumer.deliverNotification(MDBConsumer.java:256)
07/11/14 16:46:25 at oracle.bpel.services.notification.queue.sender.MDBConsumer.onMessage(MDBConsumer.java:137)
07/11/14 16:46:25 at sun.reflect.GeneratedMethodAccessor65.invoke(Unknown Source)
07/11/14 16:46:25 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
07/11/14 16:46:25 at java.lang.reflect.Method.invoke(Method.java:585)
07/11/14 16:46:25 at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
07/11/14 16:46:25 at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
07/11/14 16:46:25 at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
07/11/14 16:46:25 at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
07/11/14 16:46:25 at com.evermind.server.ejb.interceptor.system.SetContextActionInterceptor.invoke(SetContextActionInterceptor.java:44)
07/11/14 16:46:25 at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
07/11/14 16:46:25 at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
07/11/14 16:46:25 at com.evermind.server.ejb.MessageDrivenConsumer.onMessage(MessageDrivenConsumer.java:347)
07/11/14 16:46:25 at com.evermind.server.ejb.MessageDrivenConsumer.processMessages(MessageDrivenConsumer.java:233)
07/11/14 16:46:25 at com.evermind.server.ejb.MessageDrivenConsumer.run(MessageDrivenConsumer.java:169)
07/11/14 16:46:25 at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:298)
07/11/14 16:46:25 at java.lang.Thread.run(Thread.java:595)
Any Idea?Hi,
I am also trying E-mail Activity but I am not able to receive the e-mail.
I have set the following in the ns_emails.xml
<EmailAccount>
<Name>Default</Name>
<GeneralSettings>
<FromName>Oracle BPM</FromName>
<FromAddress>[email protected]</FromAddress>
</GeneralSettings>
<OutgoingServerSettings>
<SMTPHost>Server' IPADRESS</SMTPHost>
<SMTPPort>25</SMTPPort>
</OutgoingServerSettings>
<IncomingServerSettings>
<SMTPHost>Server' IPADRESS</SMTPHost>
<SMTPPort>25</SMTPPort>
</IncomingServerSettings>
In this "[email protected]" is the user configured and "Server' IPADRESS" is the IPADDRESS of the SMTP server.
Moreover I have also have SMTP server as the incoming server.
Now I have a simple BPEL PROCESS having Email Activity of sending a mail.
The "To" section has "[email protected]".
I am not able to recive the mail and I have also cheked the SMTP server there is no mail there but BPEL Process runs fine.
I also have one Script which can send mail to the user Ihave mentioned and it works fine.So server setting seems to be fine.Are there any other setting required.
If you are able to send the mail then can you give me your inputs on this issue.
Regards
Lalit -
Getting null pointer exception in secured web services client
Hi all,
I am developing client for web services. It works fine when the web service is unsecured. Its giving a null pointer exception at call.invoke when the web service is secured. I have tried setting the system properties. It did not help. any other way I can do. Can you help me with settings i need to do to be able to connect to secured server.
ThanksHi all,
I am developing client for web services. It works fine when the web service is unsecured. Its giving a null pointer exception at call.invoke when the web service is secured. I have tried setting the system properties. It did not help. any other way I can do. Can you help me with settings i need to do to be able to connect to secured server.
Thanks -
Client proxy Null pointer exception
Folks,
I have a problem with ABAP client proxy. The scenario runs fine, but a few messages does not enter XI pipeline with a null pointer exception in RWB. When I click on Message Content of these errored messages, I get
500 Internal Server Error
SAP J2EE Engine/7.00
Application error occurred during request processing.
Details: Error [javax.servlet.ServletException: null], with root cause [java.lang.NullPointerException: null].
Exception id: [00096BDD38BA00480003206B00002EE7000447B40745C832]
The strangest thing is if I retrigger the same message for processing from ABAP proxy, the message gets processed successfully.
Even in the successfully reprocessed errored message, I am not able to view the message content. I am able to view the message content in SXMB_MONI with out any problem.
Any ideas what could be the reason.
Thanks in Advance.
Regards,
JaishankarHi Ramakrishna,
I doubt Timeout is the cause for this problem coz. we used to get Time out errored messages apart from the Null pointer Exception messages. When I resend a Timedout message from RWB it gets processed sucessfully. But when I resend a null pointer exception message from RWB, the same error occurs again. Only if I resend the message from R/3 it is getting processed successfully.
I will try this setting too. Thanks for sharing.
Regards,
Jaishankar -
Really frustrating Null Pointer Exception
Hi I had the day off and was bored so I decided to start work on a poker game. Today I just started making a deck of cards and drawing a random card from it. However it isn't working as I get a very annoying null pointer exception which I don't understand. Anyway I will post my code:
public class DeckOfCards
public static void main(String args[])
Deck daDeck = new Deck();
Card[] drawnCards = new Card[10];
for (int i=0; i < 10; ++i)
drawnCards[i] = daDeck.DrawCard();
System.out.println(drawnCards.getTitle());
import java.util.*;
public class Deck
Suit Hearts;
Suit Diamonds;
Suit Spades;
Suit Clubs;
public void Deck()
Hearts = new Suit("Hearts");
Diamonds = new Suit("Diamonds");
Spades = new Suit("Spades");
Clubs = new Suit("Clubs");
public Card DrawCard()
System.out.println("Drawing card...");
Random generator = new Random();
Card card = null;
System.out.println("Card variable inited");
while (card == null)
System.out.println("Bleep");
switch (generator.nextInt(4))
case 0:
System.out.println("0");
return Hearts.getAvailableCard();
case 1:
System.out.println("1");
return Diamonds.getAvailableCard();
case 2:
System.out.println("2");
return Spades.getAvailableCard();
case 3:
System.out.println("3");
return Clubs.getAvailableCard();
default:
System.out.println("none");
System.out.println("Exited while loop");
return card;
import java.util.*;
public class Suit
Card[] cards = new Card[13];
public Suit(String suit_)
cards[0] = new Card("Two", suit_);
cards[1] = new Card("Three", suit_);
cards[2] = new Card("Four", suit_);
cards[3] = new Card("Five", suit_);
cards[4] = new Card("Six", suit_);
cards[5] = new Card("Seven", suit_);
cards[6] = new Card("Eight", suit_);
cards[7] = new Card("Nine", suit_);
cards[8] = new Card("Ten", suit_);
cards[9] = new Card("Jack", suit_);
cards[10] = new Card("Queen", suit_);
cards[11] = new Card("King", suit_);
cards[12] = new Card("Ace", suit_);
public Card getAvailableCard()
System.out.println("Getting an available card...");
Random generator = new Random();
Card card = new Card();
int randomNo = generator.nextInt(13);
System.out.println(randomNo);
if (cards[randomNo].isAvailable())
return cards[randomNo];
return card;
public class Card
String strValue;
String suitName;
int value;
int suit;
boolean available = true;
public Card()
strValue = "Out";
suitName = "cards";
public Card(String strValue_, String suitName_)
strValue = strValue_;
suitName = suitName_;
public String getTitle()
String title = strValue + " of " + suitName;
return title;
public void setAvailable(boolean available_)
available = available_;
public boolean isAvailable()
return available;
What the program is meant to do is create a deck of cards, then pick ten cards, randomly picking a suit and card in that suit. If the card has already been drawn ( not available ) then the DrawCard() method should repick a suit and card and try again. The program may be doing something differently to what I have said and may be a bit messy just because I have messed around with things trying to understand why I am getting the exception. This is the exception:
Exception in thread "main" java.lang.NullPointerException
at Deck.DrawCard(Deck.java:34)
at DeckOfCards.main(DeckOfCards.java:13)
The program doesn't even make it to the first line of the getAvailableCard() method in the Suit Class.
So all I am asking is can anyone see why I am getting the null pointer exception and what action could I take to fix it. Thankyou to anyone who has read this.Figure out what's null.
Print out cards and then cards[randomNo].
If those aren't null, then you need to look more closely at the erorr message and put in print statements to find out what is.
Whatever turns out to be null, you'll need to trace back and figure out why.
If it's the array, and the array is a member variable, then you need to know that reference member variables are initilaized to null.
If the array isn't null (because you did cards = new Card[something]) but cards[randomNo] is null, then it's because you didn't do this: for (int ix = 0; ix < cards.length; ix++) {
cards[ix] = new Card(...);
} -
9.3.3 Upgrade, null pointer exception when accessing business rules and mac
Hello,
We upgraded from 9.3.1 to 9.3.3. In the Essbase Administration Services Console, when I attempt to access business rules or macros from a client PC, we get a null pointer exception. The message does not tell us much, but I cannot find more.
I can access business rules and macros using EAS Console from the server. Do I have a bad installation, or have I missed a step?
Thank you,Hi,
You might have to re-organize your application module hierarchy to place your common code.
If your intension is to auto populate the primary key for your Entity Objects., I would suggest below common practice.
1). Create a Base Entity Impl class for your project that extends oracle.jbo.server.EntityImpl
2). Code your getDbSequence() method inside this base entity impl class
3). Make sure that all your Entity Objects extend your base entity impl class
4). Use EL expression to call this method for auto-generating primary key attribute of your Entity Object.
e.g., adf.object.getDbSequence("sequenceName")
Regards,
Eshwar -
Null Pointer exception returned when object is not null!
I've isolated the problem and cut down the code to the minimum. Why do I get a null pointer exception when the start method is called, when the object objJTextField is not null at this point???? I'm really stuck here, HELP!
(two small java files, save as BasePage.java and ExtendedPage.java and then run ExtendedPage)
first file
~~~~~~~
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public abstract class BasePage extends JFrame implements ActionListener
private JPanel objJPanel = null;
public BasePage()
setSize(300,200);
Container objContentPane = getContentPane();
objJPanel = new JPanel();
createObjects();
createPage();
// Add panels to content pane
objContentPane.add(objJPanel);
public void addComponentToPage(JComponent objJComponent)
objJPanel.add(objJComponent);
public void addButtonToPage(JButton objJButton)
objJButton.addActionListener(this);
objJPanel.add(objJButton);
public void actionPerformed(ActionEvent objActionEvent)
System.out.println("Action performed");
userDefinedButtonClicked(objActionEvent.getActionCommand());
// overide
public abstract void createObjects();
public abstract void createPage();
public abstract void userDefinedButtonClicked(String sActionCommand);
file 2
~~~~
import javax.swing.*;
public class ExtendedPage extends BasePage
private JTextField objJTextField = null;
private JButton objJButtonBrowse = null;
public ExtendedPage()
super();
public void createObjects()
objJTextField = new JTextField(20);
objJButtonBrowse = new JButton("Start");
objJButtonBrowse.setActionCommand("START");
public void createPage()
addComponentToPage(objJTextField);
addButtonToPage(objJButtonBrowse);
public void userDefinedButtonClicked(String sActionCommand)
if ((sActionCommand != null) && (sActionCommand.equals("START")) )
start();
private void start()
objJTextField.setText("Doesn't work");
public static void main(String[] args)
ExtendedPage objEP = new ExtendedPage();
objEP.show();Hello ppaulf,
Your problem is in your ExtendedPage.java file. You can fix this by changing the line
private JTextField objJTextField = null;to:
private JTextField objJTextField = new JTextField();This creates a proper instance.
Good luck,
Ming
Developer Technical Support
http://www.sun.com/developers/support
Maybe you are looking for
-
Wifi not working on mac air windows 7
i cant get connected to internet after installing window 7 on my new macbook air no wi-fi bars in the tray,any help will do
-
Alright, I "borrow" internet from my neighbor, is it possible for me to run my wireless connection from my macbook to my pc with just an ethernet cable?
-
SD: Sales Office Data report
Hello! We have about 800 sales offices (TVBUR-VKBUR). Each one has it address data (city, phone number etc.) We need do give for our users posibility to find a list of sales offices and there address data. (ready for excel) Is there is transaction o
-
Applications not copying to iTunes
When I first got my phone every time I synced it asked me if I wanted to copy my purchased item into my iTunes library. I always want to do that so I selected yes and clicked "don't ask again", but now my applications are never copied and it doesn't
-
When I check my old global-messages-db.sqlite file from my windows backup the emails still semm to be in there, can I somehow merger/ extract these mails into my current account? Best regards, temps