NullPointerException and cannot resolve symbol constructor
807597May 19 2005 — edited May 19 2005The following code was producing a runtime null pointer exception at the line
m_protocolHandler.sendNegativeSound(); at the line marked ***
I thought to remedy the issue I needed to initialize,
So I added the line m_protocolHandler = new ProtocolHandler(); *****
Now I am getting a compilation error:
cannot resolve symbol
symbol : constructor ProtocolHandler ()
location: class oracle.apps.mwa.presentation.telnet.ProtocolHandler
m_protocolHandler = new ProtocolHandler();
^
Please help! Trying to customize some oracle functionality.
Below is the InterEnterSerialPage class:
package oracle.apps.inv.wshtxn.server;
import java.net.Socket;
import oracle.apps.mwa.beans.*;
import oracle.apps.mwa.presentation.telnet.ProtocolHandler;
public class InterEnterSerialPage extends PageBean
implements MWAPageListener, MWAFieldListener
{
public ProtocolHandler m_protocolHandler;
public InterEnterSerialPage(ProtocolHandler protocolhandler, Session session)
{
m_protocolHandler = new ProtocolHandler(); *****
addListener(this);
}
public ProtocolHandler getProtocolHandler()
{
return m_protocolHandler;
}
public boolean InterValidateSerial(MWAEvent mwaevent)
throws AbortHandlerException, InterruptedHandlerException, DefaultOnlyHandlerException
{
Session session = mwaevent.getSession();
boolean intflag = true;
String curfld = ((FieldBean)mwaevent.getSource()).getName();
String intl_inv_item_id = (String)session.getObject("ITEMID");
if(UtilFns.isTraceOn)
{
UtilFns.trace("intl_inv_item_id =" + intl_inv_item_id);
}
String intas[] = {"x_cross_reference","p_inv_item_id"};
String intas1[] = {"O","I"};
String intas2[] = {"V","N"};
String intas3[] = {intl_inv_item_id};
if(UtilFns.isTraceOn)
{
UtilFns.trace("intas value = " + intas);
UtilFns.trace("intas1 = " + intas1);
UtilFns.trace("intas2 = " + intas2);
UtilFns.trace("intas3 = " + intas3);
}
try
{
Connection connection = session.getConnection();
Hashtable hashtable = UtilFns.ProcessFunction(connection, "inter_wsh_new_del.validate_serial",intas, intas1, intas2, intas3);
String int_cross_reference = "";
if((String)hashtable.get("x_cross_reference") != null)
{
int_cross_reference = (String)hashtable.get("x_cross_reference");
String v_full_sn = mSNFld.getValue();
int intlen = v_full_sn.length();
if(intlen > 2)
{
String v_trunc_sn = v_full_sn.substring(0,3);
if(v_trunc_sn.equals(int_cross_reference))
{
}
else
{
session.setStatusMessage("Serial Number does not match Cross Reference " + int_cross_reference + "please validate");
intflag = false;
UtilFns.trace("current field = " + curfld);
m_protocolHandler.willSendNegativeSound(); ***
}
} //for length
else
{
intflag = false;
UtilFns.trace("in less 3 else statement");
session.setStatusMessage("Serial Number is < 3 characters, cannot verify cross reference");
m_protocolHandler.willSendNegativeSound(); ***
}
}
}
catch(SQLException sqlexception)
{
session.setStatusMessage("in Exception" + sqlexception);
if(UtilFns.isTraceOn)
{
UtilFns.trace("in Exception" + sqlexception);
}
}
return intflag;
}
}
Below is the ProtocolHandler class:
package oracle.apps.mwa.presentation.telnet;
import java.io.*;
import java.lang.reflect.Constructor;
import java.net.*;
import java.util.*;
import oracle.apps.fnd.common.VersionInfo;
import oracle.apps.mwa.container.*;
// Referenced classes of package oracle.apps.mwa.presentation.telnet:
// Action, DeadSocketException, DeviceConfig, DeviceConfigStorage,
// ExitThreadException, Listener, Options, PresentationManager,
// TelnetSession, TerminalEmulation, VT100TerminalEmulation
public class ProtocolHandler extends Thread
{
public ProtocolHandler(Socket socket)
{
m_fromDispatcher = false;
m_tryCurrentConnection = false;
m_deadSocket = false;
setSocket(socket);
try
{
socket.setSoTimeout(5000);
}
catch(SocketException _ex) { }
s_numOfConnectingClients++;
}
... more code to perform other tasks ...
public synchronized void sendNegativeSound()
{
String s = m_deviceConfig.m_negativeSound;
try
{
m_output.write(s);
sendSnoopData(s);
return;
}
catch(IOException _ex)
{
return;
}
}
public void willSendNegativeSound()
{
m_willSendNegativeSound = true;
}
public boolean m_willSendNegativeSound;
}