NullPointerException is killing me
It comes after me with a chainsaw while I'm sleeping.
Alright, here's the briefing. I am working on a program called Radix Sort. This program analyzes the FIRST DIGIT of every number that is inputed by the user, and sorts it from least to greatest based on that digit. So if the user inputed 123, 321 and 582, the new sorted output will be 321, 582, 123. Then, the program will look at the SECOND DIGIT from the NEW OUTPUT, and sort it from least to greatest. The new output will be 321, 123, 582. It will the nlook at the THIRD DIGIT from the NEW OUTPUT, and sort it from least to greatest. The newest and final output will be 123, 321, 582. It is now sorted from least, to greatest completely.
However, the Java God decides to pull some tricks on me. This is what I get when I run the program.
How many numbers would you like it to sort? // This is the program asking the user
3 //This is my input
Please enter value 1. //Program asking user
452 //my input
Please enter value 2. //Program asking user
673 //my input
Please enter value 3. //yadda yadda
234 //you get the point
java.lang.NullPointerException
at radix.itemsToQueues (radix.java:45)
at radix.sort (radix.java:81)
at radix.main (radix.java:124)
at java.lang.VirtualMachine.invokeMain (VirtualMachine.java)
at java.lang.VirtualMachine.main (VirtualMachine.java:108)
Maybe I've been looking at the code too long now, but I can't point out why this error happens. So, if the community can help me out, I would be most thankful. Here is the code in question..
public class radix
* @param number the number that is to be analyzed
* @param n the nth digit of number being examined
private static int getDigits(int number, int n)
int length = 0;
length = findNumLength(number);
int tmp = 0;
if(length < n+1)
return tmp;
else
while(tmp < n)
number = number/10;
tmp++;
tmp = number%10;
return tmp;
* @param nums an array containing the numbers inputed by user
* @param n the nth digit being examined
* @param max the amount of numbers in existance
private static queue[] itemsToQueues(int[] nums, int n, int max)
queue[] ques;
ques = new queue[10];
int tmp = 0;
for(int i = 0; i < max; i++)
tmp = getDigits(nums, n);
ques[tmp].enqueue(new Integer(nums[i]));
return ques;
private static int[] queuesToArray(queue[] ques, int max)
int[] nums; //recreating the array
nums = new int[max];
int tmp = 0;
for(int i = 0; i < max; i++)
while(ques[i].isEmpty() == false)
nums[tmp] = ((Integer) ques[i].dequeue()).intValue();
tmp++;
return nums;
* @param nums an array containing the numbers inputed by user
* @param numDigits the maximum amount of digits there are
* @param max the amount of numbers in existance
public static int[] sort(int[] nums, int numDigits, int max)
queue[] ques;
ques = new queue[10];
int n = 0; //nth digit
do
ques = itemsToQueues(nums, n, max);
nums = queuesToArray(ques, max);
n++;
}while(n < numDigits);
return nums;
private static int findNumLength(int num)
int length = 0;
do
num = num/10;
length++;
}while(num != 0);
return length;
public static void main(String[] args)
int[] nums; //the array that holds the numbers inputed by the user
int max = 0; // the amount of numbers the user will input
int numDigits = 0; //the maximum amount of digits there are
System.out.println("How many numbers would you like it to sort?");
max = input.getInt();
nums = new int[max];
for(int i = 0; i < max; i++)
System.out.println("Please enter value " + (i+1) + ".");
nums[i] = input.getInt();
if(nums[i] > numDigits)
numDigits = nums[i];
numDigits = findNumLength(numDigits);
nums = sort(nums, numDigits, max);
Thanks guys!
Here are some of the other classes that are used in the program..
input.java
import java.io.*;
public class input
public static int getInt()
String input = "";
int result = 0;
boolean check = true;
do
try
BufferedReader console = new BufferedReader(new InputStreamReader(System.in));
input = console.readLine();
result = Integer.parseInt(input);
catch(IOException ioex)
System.out.println("Input error! Please try again.");
check = false;
catch(NumberFormatException nfex)
System.out.println("Input error! Please use integers!");
check = false;
}while(check == false);
return result;
}queue.java
public interface queue
boolean isEmpty();
void enqueue(Object x);
Object dequeue();
Object peekFront();
}list_queue.java
import java.util.LinkedList;
public class ListQueue implements queue
private LinkedList items;
public ListQueue()
items = new LinkedList();
public boolean isEmpty()
return items.isEmpty();
public void enqueue(Object x)
items.addLast(x);
public Object dequeue()
return items.removeFirst();
public Object peekFront()
return items.getFirst();
}Thanks again!
Similar Messages
-
Problems with bursting that fail to generate PDF, but still sends email!
per subject. Essentially I have built a test where the bursting engine is emailing recipients, however the bursting engine is somehow failing to generate a PDF output. The bursting engine essentially fails and I can capture the error, but emails are still sent and without attachments!
Captured exception:
[050106_095850822][oracle.apps.xdo.batch.DeliveryHelper][EXCEPTION] java.io.FileNotFoundException: /tmp/050106_095850733/63.pdf (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java(Compiled Code))
at java.io.FileInputStream.<init>(FileInputStream.java(Inlined Compiled Code))
at Oracle.apps.xdo.batch.DeliveryHelper.getEmailDeliveryRequest(DeliveryHelper.java(Compiled Code))
at oracle.apps.xdo.batch.DeliveryHelper.addRequest(DeliveryHelper.java(Compiled Code))
at oracle.apps.xdo.batch.BurstingProcessorEngine.deliverDocumentOutput(BurstingProcessorEngine.java(Compiled Code))
at oracle.apps.xdo.batch.BurstingProcessorEngine.processDocument(BurstingProcessorEngine.java(Compiled Code))
at oracle.apps.xdo.batch.BurstingProcessorEngine.burstDocument(BurstingProcessorEngine.java(Compiled Code))
at oracle.apps.xdo.batch.BurstingProcessorEngine.globalDataEndElement(BurstingProcessorEngine.java(Inlined Compiled Code))
at oracle.apps.xdo.batch.BurstingProcessorEngine.endElement(BurstingProcessorEngine.java(Compiled Code)
at oracle.xml.parser.v2.XMLContentHandler.endElement(XMLContentHandler.java(Compiled Code))
at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java(Compiled Code))
at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:301)
at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java(Compiled Code))
at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java(Compiled Code))
at oracle.apps.xdo.batch.BurstingProcessorEngine.burstingRequest(BurstingProcessorEngine.java(Compiled Code))
at oracle.apps.xdo.batch.BurstingProcessorEngine.burstingEndElement(BurstingProcessorEngine.java(Compiled Code))
at oracle.apps.xdo.batch.BurstingProcessorEngine.endElement(BurstingProcessorEngine.java(Compiled Code))
at oracle.xml.parser.v2.XMLContentHandler.endElement(XMLContentHandler.java(CompiledCode))
at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java(Compiled Code))
at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:301)
at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java(CompiledCode))
at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java(Compiled Code))
at oracle.apps.xdo.batch.BurstingProcessorEngine.process(BurstingProcessorEngine.java:1191)
at oracle.apps.xdo.batch.DocumentProcessor.process(DocumentProcessor.java:213)
at xxsyk.oracle.apps.xxsyk.xdo.server.BurstingEngine.process(BurstingEngine.java:410)
at xxsyk.oracle.apps.xxsyk.xdo.servlet.BurstingEngineServlet.doGet(BurstingEngineServlet.java:56)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:499)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456)
at org.apache.jserv.JServConnection.run(JServConnection.java:294)
at java.lang.Thread.run(Thread.java:570)To prevent emails from being sent, I implemented the BurstingListener and would check for the existance of document files. If they don't exist, I throw a NullPointerException which kills the bursting process without causing an email to be sent. My implmentation is as follows:
public void afterProcessDocument(int requestIndex,int documentIndex, Vector documentOutputs) {
// Fetch the attachments file locations.
Object[] arr = documentOutputs.toArray();
// We will flag if any files could not be found.
boolean fileNotFound = false;
// Loop for each temp document file...
for (int i = 0; i < arr.length; i++) {
// Report on this file's existance and raise a flag if not.
File file = new File((String)arr);
if (!file.exists()) {
fileNotFound = true;
// OK, there was a problem so force the bursting engine to abort.
if (fileNotFound)
throw new NullPointerException("Bursting Engine did not process some or all documents."); -
I found below error on my applications that are on Oracle AS (data source pool). After I killed some processes on Oracle Database.
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Server.Exception:(/faultcode>
<faultstring>java.lang.NullPointerException</faultstring>
<faultactor>/BBContent/BBWebService</faultactor>
</SOAP-ENV:Fault>1 . I created Soap Application by use
/oracle/product/10.1.3/OracleAS/jdk/bin/java -jar $ORACLE_HOME/webservices/lib/WebServicesAssembler.jar -config config.xml
and deploy from ear file to AS
2. I edit data-sources.xml
<?xml version = '1.0' encoding = 'UTF-8'?>
<data-sources>
<managed-data-source login-timeout="1800" connection-pool-name="PoolVCMGR-COW2" jndi-name="jdbc/OracleDSw4SAP" name="DataSourcew4SAP"/>
<connection-pool name="PoolVCMGR-COW2">
<connection-factory factory-class="oracle.jdbc.pool.OracleDataSource" user="user" password="password" url="jdbc:oracle:thin:@//127.0.0.1:1521/DB"/>
</connection-pool>
</data-sources>
When I killed session on Database or restarted Database.
My application can't work. when we debug, we found
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Server.Exception:(/faultcode>
<faultstring>java.lang.NullPointerException</faultstring>
<faultactor>/BBContent/BBWebService</faultactor>
</SOAP-ENV:Fault>
So We restarted this serverics, that worked.
I don't known why we kill session on Database or restart Database.
Our Application seem, that can't communicate Database.
Help me, How can we resolve this problem? -
Password loop NullPointerException
I am REALLY new to java. Im only a tenth grader at 15 years old, but im really interested in Java(and really bored). So ive decided(just for fun) to create a program that simply asks the user for a password and if the password is correct it exits. but if the password is incorrect it keeps asking until the password is entered correctly.
My only problem is with the NullPointerException that occurs when the 'X' or 'Cancel' options are clicked.
I know all of the basics for java ( i think)
Any ideas on how to either make these exceptions go away OR just have the program ignore them completely?
public static void main(String []args) throws NullPointerException
String password="killer";
String user;
String user2;
user = JOptionPane.showInputDialog("Password");
if (!user.equalsIgnoreCase(password))
do
user = JOptionPane.showInputDialog("Password");
}while (!user.equalsIgnoreCase(password));
}Thanks for the help. (in advance(hopefully))Okay, I appreciate the help but now i get the exception in a different place.
i added the new if statement and removed my old trivial one like you guys suggested. and my code is :
String password="killer";
String user;
String user2;
user = JOptionPane.showInputDialog("Password");
if(user==null)
user = "";
do
user = JOptionPane.showInputDialog("Password");
}while (!user.equalsIgnoreCase(password)); //EXCEPTION OCCURS HERE!
}I marked where the exception occurs.
Any help would be much appreciated.
P.S. people really arent smart enough to use the code tags.... sad.. -
Help with NullPointerException error.
Hey
Im trying to learn java and im doing by creating a simpel text game, but im stock at this NullPointerException error.
What i want to do is to set the currentRoom a player is in. The room objects i create in my game class and then i want to set outside as the startRoom of the game.
Here is some of my game script:
public class Game
private Parser parser;
private Item item;
private Player player;
private Room startRoom;
* Create the game and initialise its internal map.
public Game()
createRooms();
parser = new Parser();
* Create all the rooms and link their exits together.
private void createRooms()
Room outside, theatre, pub, lab, office, cellar;
Item knife, ball, rock, gun;
Player player1;
// create the players
player1 = new Player("JJohnsenDK");
// create the rooms
outside = new Room("outside the main entrance of the university");
pub = new Room("in the campus pub");
lab = new Room("in a computing lab");
office = new Room("in the computing admin office");
// create the items
knife = new Item("Spicey knife", "Instance kill, if hit in leg.", 1);
ball = new Item("Glas ball", "Spreads poison in the air, if broken.", 1);
rock = new Item("Giant rock", "Can't be lifted.", 500);
gun = new Item("Colt rifel", "American army rifel.", 3);
// initialise room exits
outside.setExit("east", theatre);
outside.setExit("south", lab);
outside.setItem(rock, outside);
pub.setExit("east", outside);
pub.setItem(ball, pub);
lab.setExit("north", outside);
lab.setItem(gun, lab);
office.setExit("west", lab);
player1.setNextRoom(outside);
private void printWelcome()
System.out.println();
System.out.println("Welcome to the World of Zuul!");
System.out.println("World of Zuul is a new, incredibly boring adventure game.");
System.out.println("Type 'help' if you need help.");
System.out.println();
System.out.println(player.getCurrentRoom().getLongDescription());
}i get the error in this line: System.out.println(player.getCurrentRoom().getLongDescription());
any help would be much appreciated.here is the part of the Player class that is used:
public class Player
private String username;
private Room currentRoom;
private boolean dropItem;
private boolean pickUpItem;
private HashMap<String, Item> inventory;
private Item item;
private Game game;
* Constructor for objects of class Player
public Player(String username)
this.username = username;
inventory = new HashMap<String, Item>();
public void setNextRoom(Room room)
currentRoom = room;
* Returns the current room that the player is in.
public Room getCurrentRoom()
return currentRoom;
} -
NullPointerException in out.println(message);
Am trying to send a String to a server but getting a NullPointerException on line 46 thats this line:
out.println(message);
the code :
import java.sql.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.applet.Applet;
import java.io.*;
import java.net.*;
import java.util.*;
import java.applet.AudioClip;
import javax.swing.text.html.*;
import java.net.URL;
import java.io.IOException;
public class chatClient extends JApplet implements Runnable
private String hostname, message;
protected BufferedReader in;
protected PrintWriter out;
protected TextArea output;
protected TextField input;
protected Button b;
protected Thread listener;
// Constructor looks after GUI
public chatClient()
//super("Chat Client");
getContentPane().setLayout(new BorderLayout());
output = new TextArea();
// Panel to arrange two components on
Panel p = new Panel();
p.setLayout(new BorderLayout());
input = new TextField();
b= new Button("Send");
// What happens when we press the button...
b.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e)
// read in text from textField, store as string
message = input.getText();
out.println(message);
System.out.println("Message is:" + message);
//out.flush(); We set the boolean autoflush to true in constructor
// blank the textField for next line
input.setText(" ");
}); // ends inner class
// add the textfield and button to the Panel
p.add("North", input);
p.add("South", b);
// add the textArea and the Panel to the Frame
getContentPane().add("Center", output);
getContentPane().add("South", p);
// the 'engine' behind the GUI
public void runClient()
// set hostname to 127.0.0.1 for testing
hostname="localhost";
// try to create the socket and initialise the Streams
try
Socket s = new Socket(hostname,9999);
in = new BufferedReader(new InputStreamReader(s.getInputStream()));
out = new PrintWriter(s.getOutputStream(),true);
output.append("Connected to Server...\n");
catch(UnknownHostException e)
System.err.println(e);
catch(IOException e)
System.err.println(e);
// initialise a listener thread to catch messages from server
listener = new Thread(this);
listener.start();
System.out.println("Listener started");
// listener.start() creates a thread which calls run()
public void run()
// just loop reading the input stream
try
while(true)
String line = in.readLine();
System.out.println("Received from Server:" + line);
output.append(line + "\n");
catch(IOException e)
System.err.println(e);
// when the Thread is killed...
finally
listener = null;
input.setText(" ");
out.close();
public static void main(String args[])
chatClient c = new chatClient();
c.runClient();
Can someone show me the way?Yes positiv this is how my server looks try for your self :
import java.net.*;
import java.io.*;
import java.util.*; /* we need a vector to handle unknown numbers of connections */
public class chatServer
public chatServer() throws IOException
/* we're not too bothered about the exception details, so
we'll acknowledge it here instead of writing lines of
code to analyse it */
// initialise new ServerSocket
ServerSocket s = new ServerSocket(9999);
// loop listening for connections and instantiate a new handler for each one
while(true)
Socket client = s.accept();
System.out.println("Accepted connection from " + client.getInetAddress()+":"+ client.getPort());
chatHandler c = new chatHandler(client);
c.start(); // chatHandler is derived from Thread, so we can call start()
public static void main(String[] args) throws IOException
chatServer cs = new chatServer();
} // end class definition
// define class chatHandler as a derivation of Thread
class chatHandler extends Thread
// declare variables
protected Socket s;
protected BufferedReader in;
protected PrintWriter out;
protected static Vector handlers = new Vector();
public chatHandler(Socket s) throws IOException
// assign socket passed to object to class variable s
this.s = s;
// initialise streams
in = new BufferedReader(new InputStreamReader(s.getInputStream()));
out = new PrintWriter(s.getOutputStream(), true);
System.out.println("Readers and Writers initialised");
public void run()
System.out.println("run called");
try
// add this thread to class variable vector
handlers.addElement(this);
System.out.println("Element added to Vector");
// loop reading input and passing it to broadcast method
while(true)
System.out.println("About to read inputstream");
String message = in.readLine();
System.out.println("Input Stream read");
System.out.println(message);
broadcast(message);
System.out.println("Message passed to broadcast method");
catch(IOException e)
System.err.println(e);
// if this thread is killed....
finally
// remove it from the vector
handlers.removeElement(this);
try
// tidy up debris!
s.close();
catch(IOException e)
System.err.println(e);
// this static method is used by all threads
protected static void broadcast(String message)
/* to prevent two threads trying to access the vector
simultaneously we use a synchronized block */
System.out.println("Broadcast called");
synchronized(handlers)
/* The Enumeration interface gives us a quick way of looking at
a vector which by definition is an unknown length */
Enumeration e = handlers.elements();
// returns true if there are other sockets running
while (e.hasMoreElements())
// loop to the next chatHandler in the vector
chatHandler c = (chatHandler) e.nextElement();
// write the message to it
try
/* prevent two threads trying to write
to the stream c.out */
synchronized(c.out)
c.out.println(message);
} // end synchronized block
//c.out.flush(); we set the boolean autoflush to true in the constructor
catch(Exception ex)
System.err.println(ex);
// explicitly stop the thread if exception is thrown
c = null;
} // end while loop
} // end synchronized block
} // end broadcast
} // ends class -
Sslservice: Exception was: java.lang.NullPointerException
After having upgraded from 4.30 to 4.40 I get
2008/01/31 20:30:08.324 (pid 3787) server/services/error #1201807808324
Sun Secure Global Desktop Software (4.4) ERROR:
Failed to start the service sslservice.
Exception was: java.lang.NullPointerException
at com.sco.tta.server.security.ssl.SSLService.start(SSLService.java:430)
at com.sco.tta.server.services.ServiceRegister.startService(ServiceRegister.java:576)
at com.sco.tta.server.services.ServiceRegister.start(ServiceRegister.java:559)
at com.sco.tta.server.server.JServer.startServices(JServer.java:655)
at com.sco.tta.server.server.JServer.<init>(JServer.java:427)
at TTAServer.run(TTAServer.java:391)
at java.lang.Thread.run(Thread.java:619)
I've redone the SSL configuration multiple times already but no success.
How can I troubleshoot, what the problem here is?
Thanx + Regards,
MarkusTry doing a 'tarantella stop --kill' and a 'tarantella webserver stop'. Then 'ps -ef | grep tta' and kill any stray SGD processes (I'm expecting there will be a 'ttassl' left behind)
Then do 'netstat -an | grep 5307' - this shouldn't show anything listening on port 5307 (the secure port)
If it all looks good so far restart SGD ('tarantella webserver start', 'tarantella start') -
NullPointerException - but why?
I have a line of code throwing a NullPointerException:
nearestPrey = preyCreature[0];Now, I know that the Prey object in preyCreature[0] exists because it's a Thread and is running already by this point! I've tried using index 1 to check for a slip up when instantiating, but it's not that.
Any ideas?
Cheers,
CharlesThe array gets initilised in this bit of code:
Prey[] preyCreature = new Prey[maxPrey];..
for (int i = 0; i < noOfPrey; i++){
preyCreature[i] = new Prey(i, env, initLocation, preyChange, gordon);
preyCreature.initPrey(noOfGenerations, f, gridWidth,
gridHeight, preyCreature, noOfPrey, maxPrey, preyGroupSize,
noOfPredTeams, predtm, maxPreySpeed, preyAcceleration,
preyDeceleration, easeOfPreyTurning, preySightRange, birthChance);
System.out.println("Starting prey...");
for (int i = 0; i < noOfPrey; i++)
preyCreature[i].start();
The line of code mentioned in my first post is in this method:
public void findNearestPrey()
preyChange.P(); // avoid prey being killed while searching for it
nearestPreyDead = false;
nearestPrey = preyCreature[0];
preyDistance = f.distanceTo(predX, predY,
preyCreature[0].getX(), preyCreature[0].getY());
preySpeed = preyCreature[0].getSpeed();
preyEnergy = preyCreature[0].getEnergy();
angleToPrey = f.angleTo(predX, predY, preyCreature[0].getX(),
preyCreature[0].getY(), predDir);
for (int i = 1; i < noOfPrey; i++)
if (f.distanceTo(predX, predY, preyCreature.getX(),
preyCreature[i].getY()) < preyDistance) {
nearestPrey = preyCreature[i];
preyDistance = f.distanceTo(predX, predY,
preyCreature[i].getX(), preyCreature[i].getY());
preySpeed = preyCreature[i].getSpeed();
preyEnergy = preyCreature[i].getEnergy();
angleToPrey = f.angleTo(predX, predY, preyCreature[i].getX(),
preyCreature[i].getY(), predDir);
preyChange.V();
This method is in a different object that is also a Thread (started immediately after the Prey Threads). Do you need anything else?
Charles -
Hi
I did reverse of essbase cube,Its running since 3 hrs, i want to kill the session,i did try to stop session from Operator,I got a messgae saying "Stop Failed,java.lang.NullPointerException".we are on version 10.1.3.How can i kill this session
Please help me
Thanks,If you reverse engineered using the local agent then most probably the session is already killed.
Operator relies on the agent to update the Work repository execution logs to indicate the state of the session.
Since, the agent (for whatever reason) couldnt update the execution log, the Operator will continue to show that the session is running.
You can mark the session as complete/error yourself and that will update the Work rep logs. -
Applet Hanging, a proper way to kill it?
Hi Folks,
Sometime when working with applet in internet explorer 7, an applet will just stop to work properly and hang, in my case it is caused by a NullPointerException. But I can't even close internet explorer anymore. The only way is to Ctr Alt Del and kill internet explorer.
Is there a way to kill just an applet which has been loaded in a web page, without having to reload the page and nuke the entire world...
something like
- list all java process with IDs
- kill java process with IDs ####
Thanks very much for your help,
Cheers,
Arnaud
Edited by: ArnaudL on Nov 4, 2008 9:15 AMWhat is the part number and model of Firewire adapter?
I have used them in the past without any problems whatsoever.
Allan -
[C4005]: Get properties from packet failed killing my sessions
I have a broker in a state where 6 messages are delivered which "kill" the first 6 sessions listening on a particular queue (round-robin delivery sorta situation)
These exceptions are logged only to stderr and no indication is given to my program about them other than the affected sessions never receive another message again, others do.
When the broker or consumer service is restarted, it happens again.
If I start the broker with a -reset messages then the problem goes away. I saved the entire broker var folder to try to find a work around to this.
This is OpenMQ 4.5B29
I'll include the stack traces below, anyone seen something like this or have suggestions on how to deal with this without resorting to reset of the broker?
Could not parse properties java.io.UTFDataFormatException: malformed input around byte 11
Mar 22, 2011 3:42:55 PM com.sun.messaging.jmq.jmsclient.ExceptionHandler logCaughtException
WARNING: [I500]: Caught JVM Exception: java.lang.NullPointerException
java.io.UTFDataFormatException: malformed input around byte 11
at java.io.DataInputStream.readUTF(Unknown Source)
at java.io.DataInputStream.readUTF(Unknown Source)
at com.sun.messaging.jmq.io.PacketProperties.parseProperties(PacketProperties.java:178)
at com.sun.messaging.jmq.io.PacketPayload.getProperties(PacketPayload.java:155)
at com.sun.messaging.jmq.io.Packet.getProperties(Packet.java:644)
at com.sun.messaging.jmq.io.ReadOnlyPacket.getProperties(ReadOnlyPacket.java:348)
at com.sun.messaging.jmq.jmsclient.MessageImpl.getPropertiesFromPacket(MessageImpl.java:601)
at com.sun.messaging.jmq.jmsclient.ProtocolHandler.getJMSMessage(ProtocolHandler.java:2061)
at com.sun.messaging.jmq.jmsclient.SessionReader.getJMSMessage(SessionReader.java:189)
at com.sun.messaging.jmq.jmsclient.SessionReader.deliver(SessionReader.java:107)
at com.sun.messaging.jmq.jmsclient.ConsumerReader.run(ConsumerReader.java:192)
at java.lang.Thread.run(Unknown Source)
Mar 22, 2011 3:42:55 PM com.sun.messaging.jmq.jmsclient.ConsumerReader run
WARNING: [C4005]: Get properties from packet failed. - cause: java.lang.NullPointerException
com.sun.messaging.jms.JMSException: [C4005]: Get properties from packet failed. - cause: java.lang.NullPointerException
at com.sun.messaging.jmq.jmsclient.ExceptionHandler.getJMSException(ExceptionHandler.java:386)
at com.sun.messaging.jmq.jmsclient.ExceptionHandler.handleException(ExceptionHandler.java:337)
at com.sun.messaging.jmq.jmsclient.MessageImpl.getPropertiesFromPacket(MessageImpl.java:604)
at com.sun.messaging.jmq.jmsclient.ProtocolHandler.getJMSMessage(ProtocolHandler.java:2061)
at com.sun.messaging.jmq.jmsclient.SessionReader.getJMSMessage(SessionReader.java:189)
at com.sun.messaging.jmq.jmsclient.SessionReader.deliver(SessionReader.java:107)
at com.sun.messaging.jmq.jmsclient.ConsumerReader.run(ConsumerReader.java:192)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at java.util.Hashtable.put(Unknown Source)
at com.sun.messaging.jmq.io.PacketProperties.parseProperties(PacketProperties.java:193)
at com.sun.messaging.jmq.io.PacketPayload.getProperties(PacketPayload.java:155)
at com.sun.messaging.jmq.io.Packet.getProperties(Packet.java:644)
at com.sun.messaging.jmq.io.ReadOnlyPacket.getProperties(ReadOnlyPacket.java:348)
at com.sun.messaging.jmq.jmsclient.MessageImpl.getPropertiesFromPacket(MessageImpl.java:601)
... 5 more
Mar 22, 2011 3:42:55 PM com.sun.messaging.jmq.jmsclient.ExceptionHandler logCaughtException
WARNING: [I500]: Caught JVM Exception: java.io.UTFDataFormatException: malformed input around byte 11
Mar 22, 2011 3:42:55 PM com.sun.messaging.jmq.jmsclient.ConsumerReader run
WARNING: [C4005]: Get properties from packet failed. - cause: java.io.UTFDataFormatException: malformed input around byte 11
com.sun.messaging.jms.JMSException: [C4005]: Get properties from packet failed. - cause: java.io.UTFDataFormatException: malformed input around byte 11
at com.sun.messaging.jmq.jmsclient.ExceptionHandler.getJMSException(ExceptionHandler.java:386)
at com.sun.messaging.jmq.jmsclient.ExceptionHandler.handleException(ExceptionHandler.java:337)
at com.sun.messaging.jmq.jmsclient.MessageImpl.getPropertiesFromPacket(MessageImpl.java:604)
at com.sun.messaging.jmq.jmsclient.ProtocolHandler.getJMSMessage(ProtocolHandler.java:2061)
at com.sun.messaging.jmq.jmsclient.SessionReader.getJMSMessage(SessionReader.java:189)
at com.sun.messaging.jmq.jmsclient.SessionReader.deliver(SessionReader.java:107)
at com.sun.messaging.jmq.jmsclient.ConsumerReader.run(ConsumerReader.java:192)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.UTFDataFormatException: malformed input around byte 11
at java.io.DataInputStream.readUTF(Unknown Source)
at java.io.DataInputStream.readUTF(Unknown Source)
at com.sun.messaging.jmq.io.PacketProperties.parseProperties(PacketProperties.java:178)
at com.sun.messaging.jmq.io.PacketPayload.getProperties(PacketPayload.java:155)
at com.sun.messaging.jmq.io.Packet.getProperties(Packet.java:644)
at com.sun.messaging.jmq.io.ReadOnlyPacket.getProperties(ReadOnlyPacket.java:348)
at com.sun.messaging.jmq.jmsclient.MessageImpl.getPropertiesFromPacket(MessageImpl.java:601)
... 5 more
Mar 22, 2011 3:42:55 PM com.sun.messaging.jmq.jmsclient.ExceptionHandler logCaughtException
WARNING: [I500]: Caught JVM Exception: java.lang.NullPointerException
Mar 22, 2011 3:42:55 PM com.sun.messaging.jmq.jmsclient.ExceptionHandler logCaughtException
WARNING: [I500]: Caught JVM Exception: java.io.StreamCorruptedException: invalid type code: 00
Mar 22, 2011 3:42:55 PM com.sun.messaging.jmq.jmsclient.ConsumerReader run
WARNING: [C4005]: Get properties from packet failed. - cause: java.lang.NullPointerException
com.sun.messaging.jms.JMSException: [C4005]: Get properties from packet failed. - cause: java.lang.NullPointerException
at com.sun.messaging.jmq.jmsclient.ExceptionHandler.getJMSException(ExceptionHandler.java:386)
at com.sun.messaging.jmq.jmsclient.ExceptionHandler.handleException(ExceptionHandler.java:337)
at com.sun.messaging.jmq.jmsclient.MessageImpl.getPropertiesFromPacket(MessageImpl.java:604)
at com.sun.messaging.jmq.jmsclient.ProtocolHandler.getJMSMessage(ProtocolHandler.java:2061)
at com.sun.messaging.jmq.jmsclient.SessionReader.getJMSMessage(SessionReader.java:189)
at com.sun.messaging.jmq.jmsclient.SessionReader.deliver(SessionReader.java:107)
at com.sun.messaging.jmq.jmsclient.ConsumerReader.run(ConsumerReader.java:192)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at java.util.Hashtable.put(Unknown Source)
at com.sun.messaging.jmq.io.PacketProperties.parseProperties(PacketProperties.java:193)
at com.sun.messaging.jmq.io.PacketPayload.getProperties(PacketPayload.java:155)
at com.sun.messaging.jmq.io.Packet.getProperties(Packet.java:644)
at com.sun.messaging.jmq.io.ReadOnlyPacket.getProperties(ReadOnlyPacket.java:348)
at com.sun.messaging.jmq.jmsclient.MessageImpl.getPropertiesFromPacket(MessageImpl.java:601)
... 5 moreFrom the stack trace, it looks like there is a problem with one of message's string properties. I can't obviously see what, but this might help you track down the cause of the problem.
When you've found out what it is about your message that's causing this exception, please log this as a bug.
Nigel -
IPhone 4 - 4.2 upgrade killed visual voicemail
*iPhone 4 - 4.2 upgrade killed visual voicemail*
Ok, I upgraded to 4.2 and deleted all previous backups, so I know I'm screwed untill the next update.
I've synced, backed up, restored from backup and still no "Visual Voicemail".
My voicemail only works if I restore the phone to original settings. But if I do that, I loose important data in my apps. As soon as I "Restore From Backup" I loose my "Visual Voicemail".
If I reset my voicemail password with AT&T, I get the screen to set up a new password and greeting in Visual Voicemail. When I go through these steps I get the spinning wheel "Saving".
It never saves, and I get an alert that says it can't connect to voicemail.
I can set up voicemail by dialing "1", but then all I see is a blank screen in my "Visual Voicemail".
I've also tried a full reset of my voicemail with AT&T.
I even got a new SIM card. That didn't work.
Can anybody figure this one out???
-ThanksWell, thats the first time I've been told that after a week of phone calls. Maybe it's possible.
I forgot to backup my phone before I upgraded to 4.2. Oops!
When I noticed my Visual Voicemail was gone I tried to backup but ran out of memory.
So I deleted previous backups to make more room. It backed up fine after that.
I don't think it ran out of memory during the update, but maybe it did.
Crap! -
Sender Mail Adapter - java.lang.NullPointerException in CC monitoring
hi,
I configured my Sender Mail Adapter correctly.
I have the correct POP URL, authentication. I'm not using PayloadSwapBean right now.
I can't get rid of the exception inside my Channel monitoring.
exception caught during processing mail message; java.lang.NullPointerException
does anyone know why?
I've been told the POP account has emails already.
I will try to create an outlook account for this POP e-mail account in the mean time to see the e-mails.
Thank youthanks aaron.
I don't see the folder ./SYS/../j2ee/...
will it be under another folder? I don't see a trace log folder either.
I think the problem might be in the Module tab.
I tried.
AF_Modules/PayloadSwapBean
localejbs/AF_Modules/PayloadSwapBean
/localejbs/AF_Modules/PayloadSwapBean
sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean
localejbs/sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean
/localejbs/sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean
they all produce the same error. I wonder if these Beans actually exist.
I think we might have to reinstall this Mail Adapter altogether.
Or maybe it's really the connection to the Mail Server. But would it display this kind of message.
This is what I'm looking at.
Also, i had to use this URL
pop://server:995/
(995 is using SSL and it is the default port). When I use this, I see the Java Null Pointer Exception a lot less frequently. Weird. -
Data Federator Connection to R3 - java.lang.NullPointerException
Hi.
We are trying to add a SAP R3 DataSource in Data Federator XI 3.0 SP2.
Test Connection gives us the following message: "The connection was established but there is no table for the given connection parameters", what it seems to be ok according to the SAP doc.
However, when we try to get a list of the Functions or Infosets in the SAP system, an error comes because of a "java.lang.NullPointerException". Checking the application log we get the following:
2010/03/30 12:21:27.059|<=|||0|26537104| |||||||||||||||"[LeSelect.Api.LSStatementImpl] - [Execution Thread 4]Executing query: CALL executeConnectorCommand '/TEST//TEST/user_bla/sources/draft/R3SYS', 'GET_FUNCTION_LIST * * 200'"
2010/03/30 12:21:27.074|>=|E||0|26537104| |||||||||||||||"[LeSelect.Core.n] - [Execution Thread 4]Bad Wrapper Error:
java.lang.NullPointerException
at LeSelect.Wrappers.SAPR3.H.F(y:343)
at LeSelect.Wrappers.SAPR3.H.executeCommand(y:285)
at LeSelect.Core.B.D.R(y:151)
at LeSelect.Core.QueryEngine.H.p.G(y:131)
at LeSelect.Core.QueryEngine.H.p.A(y:105)
at LeSelect.Core.QueryEngine.B.J.A(y:72)
at LeSelect.Core.QueryEngine.Executor.y.A(y:227)
at LeSelect.Core.QueryEngine.m.A(y:284)
at LeSelect.Api.LSStatementImpl.lsExecuteQuery(y:314)
at LeSelect.B.E.D.V(y:935)
at LeSelect.B.E.K.B(y:105)
at LeSelect.B.E.G$_A.run(y:691)"
We registered the callback program and did all of the steps indicated for the installation, also checked the possible sources of the error according to OSS Note 1278491.
Any idea how to solve this? Thanks.Hello, we have the similar problem: while connecting from Data Federator to SAP ERP we get the following error - "Wrapper /ZTEST/sources/ZTEST reported an exception which is not a WrapperException: java.lang.NullPointerException: null"
It's necessary to install "SAP BusinessObjects Data Federator Infoset, SAP Query and ABAP Functions Connector Prototype"
SAP BusinessObjects Web Intelligence Reporting for SAP ERP
for connection to SAP ERP.
Are there any ideas? Thanks -
PI Java Mapping NullPointerException
Hi Gurus,
I'm having some troubles doing the mapping through java mapping in PI.
I've done the java class in the SAP NWDS and imported it on PI through the ESR.
Now i'm trying to test through the SOAP and i've found the following error in the "Communication Channel Monitor":
500 Internal Server Error SAP NetWeaver Application Server/Java AS
java.lang.NullPointerException: while trying to invoke the method com.sap.aii.af.sdk.xi.lang.Binary.getBytes() of a null object returned from com.sap.aii.af.sdk.xi.mo.xmb.XMBPayload.getContent()
And the following error in the SXMB_MONI:
<SAP:Category>XIServer</SAP:Category>
<SAP:Code area="INTERNAL">CLIENT_SEND_FAILED</SAP:Code>
<SAP:P1>500</SAP:P1>
<SAP:P2>Internal Server Error</SAP:P2>
<SAP:P3>(See attachment HTMLError for details)</SAP:P3>
<SAP:P4 />
<SAP:AdditionalText />
<SAP:Stack>Error while sending by HTTP (error code: 500 , error text: Internal Server Error) (See attachment HTMLError for details)</SAP:Stack>
I've developed the code below:
public class PI_Mapping_IF extends AbstractTransformation {
public void transform(TransformationInput in, TransformationOutput out) throws StreamTransformationException {
this.execute(in.getInputPayload().getInputStream(), out.getOutputPayload().getOutputStream());
public void execute(InputStream in, OutputStream out) throws StreamTransformationException {
try
// Inicio do java mapping
getTrace().addInfo("JAVA Mapping Iniciado"); //Log para o PI/XI
// Declarações referentes ao XML de entrada
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document xml_in = db.parse(in);
// Declarações referentes ao XML de saída
Document xml_out = db.newDocument();
TransformerFactory transformerFactory = TransformerFactory.newInstance();
Transformer transformer = transformerFactory.newTransformer();
// Remove o standalone
xml_in.setXmlStandalone(true);
// Declara a estrutura que a RFC irá receber
Element root = xml_out.createElement("ns1:ZFSD_VMOI_UPLOAD_CF_PG");
root.setAttribute("xmlns:ns1","urn:sap-com:document:sap:rfc:functions");
xml_out.appendChild(root);
Element i_cenario = xml_out.createElement("I_CENARIO");
root.appendChild(i_cenario);
Element t_input = xml_out.createElement("T_INPUT");
root.appendChild(t_input);
Element item = xml_out.createElement("ITEM");
t_input.appendChild(item);
Element STRING = xml_out.createElement("STRING");
item.appendChild(STRING);
Element t_return = xml_out.createElement("T_RETURN");
root.appendChild(t_return);
Element item_r = xml_out.createElement("ITEM");
t_return.appendChild(item_r);
Element message = xml_out.createElement("MESSAGE");
item_r.appendChild(message);
// Verifica se existe algum filho no nó
NodeList nodos = xml_in.getChildNodes();
if (nodos.item(0) != null)
getTrace().addInfo("O nó(XML) possui filhos"); //Log para o PI/XI
// Declaração de variáveis
String ident = ""; // <Ident>
String buyer = ""; // <BuyerLineItemNum>
String result = ""; // <Ident>;<BuyerLineItemNum>;<Date>;<QuantityValue>
// Inicia a extração das informações do XML
try{
// Recupera o nó ShipToParty
NodeList nodeShip = xml_in.getElementsByTagName("ns0:ShipToParty");
Node node = nodeShip.item(0);
Element elemXML = (Element) node;
try{
NodeList nodeIdent = elemXML.getElementsByTagName("ns0:Ident");
Element nameElement = (Element) nodeIdent.item(0);
nodeIdent = nameElement.getChildNodes();
// Recupera o valor da chave <Ident>
ident = PI_Mapping_IF.VerifyNull(((Node) nodeIdent.item(0)).getNodeValue());
}catch(Exception e){
result += "0.0;";
// Recupera o nó ListOfMaterialGroupedPlanningDetail
NodeList nodeBuyer = xml_in.getElementsByTagName("ns0:MaterialGroupedPlanningDetail");
for (int i = 0; i < nodeBuyer.getLength(); i++) {
node = nodeBuyer.item(i);
elemXML = (Element) node;
try{
// Preenche a chave BuyerLineItemNum
NodeList nodeBuyerLine = elemXML.getElementsByTagName("ns0:BuyerLineItemNum");
Element elemBuyerLine = (Element) nodeBuyerLine.item(0);
nodeBuyerLine = elemBuyerLine.getChildNodes();
buyer = PI_Mapping_IF.VerifyNull(((Node) nodeBuyerLine.item(0)).getNodeValue());
}catch(Exception e){
buyer += "0;";
result = ident+";"+buyer+";";
Node nodeDt_Qnt = nodeBuyer.item(i);
Element elemDt_Qnt = (Element)nodeDt_Qnt;
NodeList nodeValores = elemDt_Qnt.getElementsByTagName("ns0:ScheduleDetail");
for (int j = 0; j < nodeValores.getLength(); j++) {
node = nodeValores.item(j);
elemXML = (Element) node;
try{
// Preenche a chave Date
NodeList modelExtra = elemXML.getElementsByTagName("ns0:Date");
Element extraElement = (Element) modelExtra.item(0);
modelExtra = extraElement.getChildNodes();
result += PI_Mapping_IF.VerifyNull(((Node) modelExtra.item(0)).getNodeValue())+";";
}catch(Exception e){
result += "//;";
try {
// Preenche a chave QuantityValue
NodeList modelURL = elemXML.getElementsByTagName("ns0:QuantityValue");
Element urlElement = (Element) modelURL.item(0);
modelURL = urlElement.getChildNodes();
result += PI_Mapping_IF.VerifyNull(((Node) modelURL.item(0)).getNodeValue())+";";
} catch (Exception e) {
result += "0.0;";
// Marca o final do registro
result += "||";
// Preenche os nós itens
Text srcxml = xml_out.createTextNode(result);
STRING.appendChild(srcxml);
result = "";
buyer = "";
}catch(Exception e){
// Remove o standalone
xml_out.setXmlStandalone(true);
// Preenche o Cenario
Text cenario = xml_out.createTextNode("P&G");
i_cenario.appendChild(cenario);
// Preenche mensagem de retorno
Text msgxml = xml_out.createTextNode("XML lido com sucesso!");
message.appendChild(msgxml);
// Escreve a saida do XML
transformer.transform(new DOMSource(xml_out), new StreamResult(out));
getTrace().addInfo("Fim da execução do Java Mapping");
} catch (ParserConfigurationException e) {
getTrace().addWarning(e.getMessage());
throw new StreamTransformationException("Can not create DocumentBuilder.", e);
} catch (SAXException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (TransformerConfigurationException e) {
e.printStackTrace();
} catch (TransformerException e) {
e.printStackTrace();
Am i doing anything wrong in the code? Where can this nullpointerexception be triggered?
Thanks.These three xml are the same:
<?xml version="1.0"?><a:xml xmlns:a="urn:123">root</a:xml>
<?xml version="1.0"?><xml xmlns="urn:123">root</xml>
<?xml version="1.0"?><ns0:xml xmlns:ns0="urn:123">root</ns0:xml>
But your code will work only with last one, because it doesn't bound namespace to prefix ns0.
Maybe you are looking for
-
Ipod cannot be updated the disk could not be read from or written to?
So my iPod seems to be working fine except today when I plugged in I get the above error message? What's it mean and how do I fix it?
-
National characters and new Java API
Hi All, I'm looking for your experience with new java api and national characters (like: ü, ś, ć, etc.). The problem is that when record was updated using MDM Data Manager, and retrieved using new java api - national character are invalid (in java st
-
IPad 3- cracked screen repaired and not working???
So we cracked our iPad three, (the new, now discontinued one) and the screen was completely shattered. We got it repaired at a repair shop that looked reputable but now it doesn't seem so. The screen is completely scratch free and perfect, but the LC
-
Photoshop CC is crashing regularly when I perform Save For Web function
I'm finding that my Photoshop CC, running on Windows, is continually crashing - most notably following a Shift+Ctrl+Alt+S command. Any ideas?
-
Is it possible to delete the 2.02 update and then re-download it?
I am wondering if there was a problem when I downloaded 2.02 for my 2G. Can I yank the version I have and re-download it?