Query from mySQL java.lang.NullPointerException
I have compile and run the following code but it was an error (java.lang.NullPointerException) when I click the loginButton. Please help me, I don't know how to solve the problem.
/* * Main.java * * Created on February 19, 2008, 2:50 AM */ package dataprotect; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import javax.swing.*; import javax.swing.JOptionPane; import dataprotect.SecretQuest; public class Main extends javax.swing.JFrame { /** Creates new form Main */ private Connection connection; private Statement statement; private ResultSet rs; /** * * @author Aiman */ public void connectToDB() { try { connection= DriverManager.getConnection("jdbc:mysql://localhost/data_protect?user=root&password=password"); statement = connection.createStatement(); } catch (SQLException connectException) { System.out.println(connectException.getMessage()); System.out.println(connectException.getSQLState()); System.out.println(connectException.getErrorCode()); System.exit(1); } } private void init() { connectToDB(); } /** Creates new form Main */ public Main() { initComponents(); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ // <editor-fold defaultstate="collapsed" desc=" Generated Code "> private void initComponents() { loginPanel = new javax.swing.JPanel(); userField = new javax.swing.JTextField(); passLabel = new javax.swing.JLabel(); passField = new javax.swing.JPasswordField(); loginButton = new javax.swing.JButton(); userLabel = new javax.swing.JLabel(); jLabel1 = new javax.swing.JLabel(); registerPanel = new javax.swing.JPanel(); regLabel = new javax.swing.JLabel(); registerButton = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("Data Protector"); loginPanel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); passLabel.setText("Password:"); loginButton.setText("Login"); loginButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { loginButtonActionPerformed(evt); } }); userLabel.setText("Username:"); javax.swing.GroupLayout loginPanelLayout = new javax.swing.GroupLayout(loginPanel); loginPanel.setLayout(loginPanelLayout); loginPanelLayout.setHorizontalGroup( loginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, loginPanelLayout.createSequentialGroup() .addContainerGap() .addGroup(loginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(userLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 89, Short.MAX_VALUE) .addComponent(passLabel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 89, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(loginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(loginButton) .addComponent(passField, javax.swing.GroupLayout.DEFAULT_SIZE, 134, Short.MAX_VALUE) .addComponent(userField, javax.swing.GroupLayout.DEFAULT_SIZE, 134, Short.MAX_VALUE)) .addContainerGap()) ); loginPanelLayout.setVerticalGroup( loginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(loginPanelLayout.createSequentialGroup() .addContainerGap() .addGroup(loginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(userField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(userLabel)) .addGap(16, 16, 16) .addGroup(loginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(passLabel) .addComponent(passField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 21, Short.MAX_VALUE) .addComponent(loginButton) .addContainerGap()) ); jLabel1.setFont(new java.awt.Font("Tahoma", 1, 18)); jLabel1.setText("Data Protector"); registerPanel.setBorder(javax.swing.BorderFactory.createEtchedBorder()); regLabel.setText("If you are first user? Please register first."); registerButton.setText("Register"); registerButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { registerButtonActionPerformed(evt); } }); javax.swing.GroupLayout registerPanelLayout = new javax.swing.GroupLayout(registerPanel); registerPanel.setLayout(registerPanelLayout); registerPanelLayout.setHorizontalGroup( registerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(registerPanelLayout.createSequentialGroup() .addGroup(registerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(registerPanelLayout.createSequentialGroup() .addGap(93, 93, 93) .addComponent(registerButton)) .addGroup(registerPanelLayout.createSequentialGroup() .addGap(28, 28, 28) .addComponent(regLabel))) .addContainerGap(18, Short.MAX_VALUE)) ); registerPanelLayout.setVerticalGroup( registerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, registerPanelLayout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(regLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(registerButton) .addContainerGap()) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap(72, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(registerPanel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(loginPanel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGap(67, 67, 67)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 146, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(114, 114, 114)))) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(15, 15, 15) .addComponent(loginPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(25, 25, 25) .addComponent(registerPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGap(27, 27, 27)) ); pack(); }// </editor-fold> private void registerButtonActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: // registerPanel a = new MainFrame(); // a.show(); this.setVisible(false); } private void loginButtonActionPerformed(java.awt.event.ActionEvent evt) { Connection conn = null; Statement stmt = null; ResultSet rs = null; try { Statement statement = connection.createStatement(); rs = statement.executeQuery("select username, password from system"); // create a statement stmt = conn.createStatement(); // extract data from the ResultSet String username = userField.getText(); String password = new String(passField.getPassword()); if(username.equalsIgnoreCase(password)) { JOptionPane.showMessageDialog(this, "Login Successful"); SecretQuest a = new SecretQuest(); a.show(); this.setVisible(false); } else{ JOptionPane.showMessageDialog(this, "Incorrect username/password combination.", "Login Error", JOptionPane.ERROR_MESSAGE); } } catch (Exception e) { e.printStackTrace(); System.exit(1); } /* try { java.sql.Statement s = conn.createStatement(); java.sql.ResultSet r = s.executeQuery ("SELECT username, password FROM system"); while(r.next()) { System.out.println ( r.getString("username") + " " + r.getString("password") ); } } catch (Exception e) { System.out.println(e); System.exit(0); } */ } /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Main().setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JLabel jLabel1; private javax.swing.JButton loginButton; private javax.swing.JPanel loginPanel; private javax.swing.JPasswordField passField; private javax.swing.JLabel passLabel; private javax.swing.JLabel regLabel; private javax.swing.JButton registerButton; private javax.swing.JPanel registerPanel; private javax.swing.JTextField userField; private javax.swing.JLabel userLabel; // End of variables declaration }
I'm using mysql-connector-java-5.0.8 and mysql version 5.0...Any ideas?
Thanks a lot for your help =)
Its look can't solve the error..I try to change from:
// create a statement
stmt = conn.createStatement();
// extract data from the ResultSetto this one as you said:
// create a statement
stmt = connection.createStatement();
// extract data from the ResultSetBut the same problem was happen.
After the error it appear this on output windows of NetBean 5.5:
at dataprotect.Main.loginButtonActionPerformed(Main.java:198)
at dataprotect.Main.access$000(Main.java:17)
at dataprotect.Main$1.actionPerformed(Main.java:76)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.Component.processMouseEvent(Component.java:6038)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
at java.awt.Component.processEvent(Component.java:5803)
at java.awt.Container.processEvent(Container.java:2058)
at java.awt.Component.dispatchEventImpl(Component.java:4410)
at java.awt.Container.dispatchEventImpl(Container.java:2116)
at java.awt.Component.dispatchEvent(Component.java:4240)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
at java.awt.Container.dispatchEventImpl(Container.java:2102)
at java.awt.Window.dispatchEventImpl(Window.java:2429)
at java.awt.Component.dispatchEvent(Component.java:4240)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)Edited by: Aiman on Feb 25, 2008 5:43 AM
Similar Messages
-
Running ABAP program from web - java.lang.NullPointerException
Hi experts,
Need help. We have a web portal that one of the link is to call out a customized report to be displayed on nthe browser. There is a standard function to download the report by List -> Save/Send -> File. It seems that after we upgrade to ECC6/web dispatcher, this function failed to work. Our Basis has helped to check and they are highlighting that this is application side issue. They gave us the following:
Exception in thread "AWT-EventQueue-4" java.lang.NullPointerException: String is null
at sun.java2d.SunGraphics2D.drawString(Unknown Source)
at Query.paint(Unknown Source)
at sun.awt.RepaintArea.paintComponent(Unknown Source)
at sun.awt.RepaintArea.paint(Unknown Source)
at sun.awt.windows.WComponentPeer.handleEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Frankly I really cannot understand this and also not sure how to solve it. Anyone have any ideas?Hi All,
I am also getting similar type of error
java.lang.NullPointerException
at se.abb.com.View2.wdDoInit(View2.java:102)
at se.abb.com.wdp.InternalView2.wdDoInit(InternalView2.java:202)
at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.doInit(DelegatingView.java:61)
at com.sap.tc.webdynpro.progmodel.controller.Controller.initController(Controller.java:215)
at com.sap.tc.webdynpro.progmodel.view.View.initController(View.java:445)
... 34 more
Please help me to resolve this error.
Thanks
Uday -
Java.lang.NullPointerException trying to migrate from MySQL to OracleXE
(Originally posted in the SQL Developer forum)
I'm trying to migrate a small MySQL database (four tables) to OracleXE. When I capture an object (table, schema or entire database), I'm receiving a java.lang.NullPointerException message from the Capture source in the Migration Log window. The migrated object doesn't show up in the Captured Objects window until after I shut down SQL Developer and restart it, then the tables in the migration script don't have any columns defined in them.
Here's the error from the console:
java.lang.Exception: java.lang.NullPointerException
at oracle.dbtools.migration.workbench.core.ui.AbstractMigrationProgressRunnable.start(AbstractMigrationProgressRunnable.java:139)
at oracle.dbtools.migration.workbench.core.CaptureInitiator.launch(CaptureInitiator.java:57)
at oracle.dbtools.raptor.controls.sqldialog.ObjectActionController.handleEvent(ObjectActionController.java:127)
at oracle.ide.controller.IdeAction.performAction(IdeAction.java:551)
at oracle.ide.controller.IdeAction$2.run(IdeAction.java:804)
at oracle.ide.controller.IdeAction.actionPerformedImpl(IdeAction.java:823)
at oracle.ide.controller.IdeAction.actionPerformed(IdeAction.java:521)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.AbstractButton.doClick(AbstractButton.java:302)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1000)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1041)
at java.awt.Component.processMouseEvent(Component.java:5501)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3135)
at java.awt.Component.processEvent(Component.java:5266)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3968)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
at java.awt.Window.dispatchEventImpl(Window.java:1778)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)Caused by: java.lang.NullPointerException
at oracle.dbtools.migration.workbench.plugin.MySQLCapturer.captureColumnDetails(MySQLCapturer.java:473)
at oracle.dbtools.migration.workbench.plugin.MySQLCapturer.captureObjects(MySQLCapturer.java:145)
at oracle.dbtools.migration.capture.CaptureWorker.capturePerTable(CaptureWorker.java:568)
at oracle.dbtools.migration.capture.CaptureWorker.captureType(CaptureWorker.java:331)
at oracle.dbtools.migration.capture.CaptureWorker.runCapture(CaptureWorker.java:282)
at oracle.dbtools.migration.workbench.core.ui.CaptureRunner.doWork(CaptureRunner.java:63)
at oracle.dbtools.migration.workbench.core.ui.AbstractMigrationProgressRunnable.run(AbstractMigrationProgressRunnable.java:159)
at oracle.dbtools.migration.workbench.core.ui.MigrationProgressBar.run(MigrationProgressBar.java:532)
at java.lang.Thread.run(Thread.java:595)
My environment is:
Windows Xp sp2
SQL Developer (ver. 1.1.2.25.78)
J2SE Development Kit 5.0 Update 11
mysql-connector-java-5.0.5
Oracle Database 10g Express Edition Release 10.2.0.1.0
The MySQL database is version 4.1.2 running on a remote Mandriva Linux 2006 server.
Are there any specific version requirements for the components involved?
Thanks.Hi,
There's a known bug in the code that captures 4.1 MySQL databases (specifically). The fix has been applied, and will be available in our next release.
for a temporary workaround, you can put your data into a MySQL 4.0 or 5.0 database.
Regards,
Dermot. -
Query fromMysql with Java---java.lang.NullPointerException
Database is named 'test'��in it, one of the table is named 'item'.It displays the following error:java.lang.NullPointerException when I do query with following code.
This java is used to connect mysql:
package Be;
import java.sql.*;
import java.util.*;
public class Dataconnection {
public Connection conn;
String sql;
public Connection makeC() throws SQLException,ClassNotFoundException,InstantiationException,IllegalAccessException
try
String dbDriver = "com.mysql.jdbc.Driver";
Class.forName(dbDriver).newInstance();
Connection conn= java.sql.DriverManager.getConnection("jdbc:mysql://localhost/test","root","");
catch (ClassNotFoundException cnfe)
//System.err.println(cnfe.getMessage());
System.out.println(cnfe.getMessage());
return conn;
this java is used to do query from table 'item'
ackage Be;
import java.util.*;
import java.sql.*;
import java.lang.*;
public class testForMysql{
public void testMysql() throws SQLException,ClassNotFoundException,InstantiationException,IllegalAccessException
DB = new Dataconnection();
Statement stmt = null;
ResultSet rs = null;
try{ //try1
stmt = conn.createStatement();
rs = stmt.executeQuery("SELECT * FROM item");
System.out.println("SELECT * FROM item");
while (rs.next()) //while1
int invoiceno = rs.getInt("invoiceno");
System.out.println(invoiceno);
}//while1 over
rs.close();
conn.close();
}//try1 over
catch (SQLException e) {System.out.print(e);}
catch (Exception e){System.out.print(e);}
private String sql;
public Dataconnection DB;
public Connection conn;
public static void main(String[] args)throws Exception
testForMysql sta =new testForMysql();
sta.testMysql();
Any idea or hint?
thanks a lot!At what point did you get the exception? You say you got a NullPointerException, but you give no indication as to where it happened. That would give you a good clue.
Start following the Sun Java coding conventions:
http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html
When you post code, put it inside [ code][ code] tags (see the special tokens link up above).
Make that connection in your Dataconnection class private. Why public?
If I was writing this class, here's how I'd do it:
package be;
import java.sql.*;
import java.util.*;
public class DataConnection
public static final String DEFAULT_DRIVER = "sun.jdbc.odbc.JdbcOdbcDriver";
public static final String DEFAULT_URL = "jdbc:odbc:DRIVER={Microsoft Access Driver (*.mdb)};DBQ=c:\\Software\\Java\\Forum\\DataConnection.mdb";
public static final String DEFAULT_USERNAME = "admin";
public static final String DEFAULT_PASSWORD = "";
/** Database connection */
private Connection connection;
* Driver for the DataConnection
* @param command line arguments
* <ol start='0'>
* <li>SQL query string</li>
* <li>JDBC driver class</li>
* <li>database URL</li>
* <li>username</li>
* <li>password</li>
* </ol>
public static void main(String [] args)
DataConnection db = null;
try
if (args.length > 0)
String sql = args[0];
String driver = ((args.length > 1) ? args[1] : DEFAULT_DRIVER);
String url = ((args.length > 2) ? args[2] : DEFAULT_URL);
String username = ((args.length > 3) ? args[3] : DEFAULT_USERNAME);
String password = ((args.length > 4) ? args[4] : DEFAULT_PASSWORD);
db = new DataConnection(driver, url, username, password);
List result = db.query(sql);
System.out.println(result);
else
System.out.println("Usage: db.DataConnection <sql> <driver> <url> <username> <password>");
catch (SQLException e)
System.err.println("SQL error: " + e.getErrorCode());
System.err.println("SQL state: " + e.getSQLState());
e.printStackTrace(System.err);
catch (Exception e)
e.printStackTrace(System.err);
finally
if (db != null)
db.close();
db = null;
* Create a DataConnection
* @throws SQLException if the database connection fails
* @throws ClassNotFoundException if the driver class can't be loaded
public DataConnection() throws SQLException,ClassNotFoundException
this(DEFAULT_DRIVER, DEFAULT_URL, DEFAULT_USERNAME, DEFAULT_PASSWORD);
* Create a DataConnection
* @throws SQLException if the database connection fails
* @throws ClassNotFoundException if the driver class can't be loaded
public DataConnection(final String driver,
final String url,
final String username,
final String password)
throws SQLException,ClassNotFoundException
Class.forName(driver);
this.connection = DriverManager.getConnection(url, username, password);
* Clean up the connection
public void close()
try
this.connection.close();
catch (Exception e)
; // do nothing; you've done your best
* Execute an SQL query
* @param SQL query to execute
* @returns list of row values
* @throws SQLException if the query fails
public List query(final String sql) throws SQLException
Statement statement = this.connection.createStatement();
ResultSet rs = statement.executeQuery(sql);
ResultSetMetaData meta = rs.getMetaData();
int numColumns = meta.getColumnCount();
List rows = new ArrayList();
while (rs.next())
Map thisRow = new LinkedHashMap();
for (int i = 1; i <= numColumns; ++i)
String columnName = meta.getColumnName(i);
Object value = rs.getObject(columnName);
thisRow.put(columnName, value);
rows.add(thisRow);
rs.close();
statement.close();
return rows;
}This code compiled and ran on my Windows machine. I tested it against an Access database, and it worked fine. You'll have to change those static variables to point to your stuff if you try it. - MOD -
Error occurred while sending query result: 'java.lang.NullPointerException'
I am doing end to end scenario from SQL server to File
JDBC --XI -- File
I am getting the following Error while monitoring the sender CC in RWB
"Error occurred while sending query result: 'java.lang.NullPointerException'
Please Help !!Hi,
To see the Adapter Error log, try:
http://<XiServerHostName>:<J2EE-Port>/MessagingSystem
Try viewing the Audit Log for each message (Newspaper Icon)
Regards,
Amitabha -
Hello,
I'm trying to run a simple OpenScript script in Eclipse that creates a record (a Supplier in this case) in Oracle E-Business Suite. So I copied the the script file from OpenScript and created it as a Class in Eclipse. Then I created a main class to call the methods within the script class but no matter what method I call (initialize, run or finalize) I'm getting the java.lang.NullPointerException message. The error doesn't seem to be related with any specific line in the script but with the way that I'm calling it.
Should I call the OpenScript class from my main class in a different way? (see my examples below)
BTW, all external .jar files coming with OATS have been added to my project in Eclipse.
1) Here's the main class I created to call the OpenScript method (Eclipse auto-corrected my main class adding a Try and Catch around the method call):
public class Test {
public static void main(String[] args) {
nvscript nvs = new nvscript();
try {
nvs.initialize();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
2) Here's the script from OpenScript (the actual script has more steps but I'm just using the first one for a proof of concept):
import oracle.oats.scripting.modules.basic.api.*;
import oracle.oats.scripting.modules.browser.api.*;
import oracle.oats.scripting.modules.functionalTest.api.*;
import oracle.oats.scripting.modules.utilities.api.*;
import oracle.oats.scripting.modules.utilities.api.sql.*;
import oracle.oats.scripting.modules.utilities.api.xml.*;
import oracle.oats.scripting.modules.utilities.api.file.*;
import oracle.oats.scripting.modules.webdom.api.*;
import oracle.oats.scripting.modules.formsFT.api.*;
import oracle.oats.scripting.modules.applet.api.*;
public class nvscript extends IteratingVUserScript {
@ScriptService oracle.oats.scripting.modules.utilities.api.UtilitiesService utilities;
@ScriptService oracle.oats.scripting.modules.browser.api.BrowserService browser;
@ScriptService oracle.oats.scripting.modules.functionalTest.api.FunctionalTestService ft;
@ScriptService oracle.oats.scripting.modules.webdom.api.WebDomService web;
@ScriptService oracle.oats.scripting.modules.applet.api.AppletService applet;
@ScriptService oracle.oats.scripting.modules.formsFT.api.FormsService forms;
public void initialize() throws Exception {
this.getSettings().set("formsft.useformsonly",true);
browser.launch();
public void run() throws Exception {
beginStep(
"[1] E-Business Suite Home Page Redirect (/ebs12cloud.winshuttle.com:8000/)",
0);
web.window(2, "/web:window[@index='0' or @title='about:blank']")
.navigate("http://ebs12.xxxxxxx.com:8000/");
web.window(4, "/web:window[@index='0' or @title='Login']")
.waitForPage(null);
think(4.969);
web.textBox(
7,
"/web:window[@index='0' or @title='Login']/web:document[@index='0']/web:form[@id='DefaultFormName' or @name='DefaultFormName' or @index='0']/web:input_text[@id='usernameField' or @name='usernameField' or @index='0']")
.setText("winshuttle_user");
think(2.0);
web.textBox(
8,
"/web:window[@index='0' or @title='Login']/web:document[@index='0']/web:form[@id='DefaultFormName' or @name='DefaultFormName' or @index='0']/web:input_password[@id='passwordField' or @name='passwordField' or @index='0']")
.click();
think(1.109);
web.textBox(
9,
"/web:window[@index='0' or @title='Login']/web:document[@index='0']/web:form[@id='DefaultFormName' or @name='DefaultFormName' or @index='0']/web:input_password[@id='passwordField' or @name='passwordField' or @index='0']")
.setPassword(deobfuscate("kjhkjhkj=="));
think(1.516);
web.button(
10,
"/web:window[@index='0' or @title='Login']/web:document[@index='0']/web:form[@id='DefaultFormName' or @name='DefaultFormName' or @index='0']/web:button[@id='SubmitButton' or @value='Login' or @index='0']")
.click();
endStep();
public void finish() throws Exception {
3) Here's the error messages I'm getting based on the method I call from my main class:
3.a) when calling Initialize():
java.lang.NullPointerException
at oracle.oats.scripting.modules.basic.api.IteratingVUserScript.getSettings(IteratingVUserScript.java:723)
at nvscript.initialize(nvscript.java:22)
at Test.main(Test.java:9)
3 b) when calling Run():
java.lang.NullPointerException
at oracle.oats.scripting.modules.basic.api.IteratingVUserScript.beginStep(IteratingVUserScript.java:260)
at nvscript.run(nvscript.java:30)
at Test.main(Test.java:9)
Any help and/or constructive comment will be appreciated it.
Thanks.
Federico.UPDATE
Compiling from command line I found out that the class definition for oracle.oats.scripting.modules.basic.api.IteratingVUserScript is missing. Do you know what .jar file contains this class?
Thanks.
Fede. -
Java.lang.NullPointerException during MySQL 5.0 migration
The error occurs at the end of the migration process of 150 tables and 4,917 columns. The error occurs with either "Quick Migrate" or "Capture Schema".
Additional error;
oracle.dbtools.migration.workbench.core.ui.AbstractMigrationProgressRunnable.start(AbstractMigrationProgressRunnable.java:141)
Any ideas as to the issue?
Source DB - MySQL5.0, 150 tables, approx 4,900 columns.
Target DB - 10.2.0.3 Ent
sqldeveloper -
CVS Version Internal to Oracle SQL Developer (client-only)
Java(TM) Platform 1.6.0_07
Oracle IDE 1.5.1.54.40
Versioning Support 1.5.1.54.40
Thanks in advance,
Tim
Addtional details for sqldeveloper
About
Oracle SQL Developer 1.5.1
Version 1.5.1
Build MAIN-5440
Copyright © 2005,2008 Oracle. All Rights Reserved.
IDE Version: 11.1.1.0.22.49.42
Product ID: oracle.sqldeveloper
Product Version: 11.1.1.54.40
Version
Component Version
========= =======
CVS Version Internal to Oracle SQL Developer (client-only)
Java(TM) Platform 1.6.0_07
Oracle IDE 1.5.1.54.40
Versioning Support 1.5.1.54.40
Properties
Name Value
==== =====
apple.laf.useScreenMenuBar true
awt.toolkit sun.awt.windows.WToolkit
class.load.environment oracle.ide.boot.IdeClassLoadEnvironment
class.load.log.level CONFIG
class.transfer delegate
com.apple.macos.smallTabs true
com.apple.mrj.application.apple.menu.about.name "SQL_Developer"
com.apple.mrj.application.growbox.intrudes false
file.encoding Cp1252
file.encoding.pkg sun.io
file.separator \
ice.browser.forcegc false
ice.pilots.html4.ignoreNonGenericFonts true
ice.pilots.html4.tileOptThreshold 0
ide.AssertTracingDisabled true
ide.bootstrap.start 13479365579083
ide.build MAIN-5440
ide.conf C:\sqldeveloper\sqldeveloper\bin\sqldeveloper.conf
ide.config_pathname C:\sqldeveloper\sqldeveloper\bin\sqldeveloper.conf
ide.debugbuild false
ide.devbuild false
ide.extension.search.path sqldeveloper/extensions:jdev/extensions:ide/extensions
ide.firstrun false
ide.java.minversion 1.5.0
ide.launcherProcessId 4684
ide.main.class oracle.ide.boot.IdeLauncher
ide.patches.dir ide/lib/patches
ide.pref.dir C:\Documents and Settings\Administrator\Application Data\SQL Developer
ide.pref.dir.base C:\Documents and Settings\Administrator\Application Data
ide.product oracle.sqldeveloper
ide.shell.enableFileTypeAssociation C:\sqldeveloper\sqldeveloper.exe
ide.splash.screen splash.gif
ide.startingArg0 C:\sqldeveloper\sqldeveloper.exe
ide.startingcwd C:\sqldeveloper
ide.user.dir C:\Documents and Settings\Administrator\Application Data\SQL Developer
ide.user.dir.var IDE_USER_DIR
ide.work.dir C:\Documents and Settings\Administrator\My Documents\SQL Developer
ide.work.dir.base C:\Documents and Settings\Administrator\My Documents
java.awt.graphicsenv sun.awt.Win32GraphicsEnvironment
java.awt.printerjob sun.awt.windows.WPrinterJob
java.class.path ..\..\ide\lib\ide-boot.jar
java.class.version 50.0
java.endorsed.dirs C:\Java\jdk1.6.0_07\jre\lib\endorsed
java.ext.dirs C:\Java\jdk1.6.0_07\jre\lib\ext;C:\WINDOWS\Sun\Java\lib\ext
java.home C:\Java\jdk1.6.0_07\jre
java.io.tmpdir c:\temp\
java.library.path C:\sqldeveloper;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\oracle\product\10.2.0\client_1\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Universal Extractor\bin;C:\Program Files\IDM Computer Solutions\UltraEdit-32;C:\Program Files\Diskeeper Corporation\Diskeeper\;c:\Embarcadero\PerformanceCenter
java.naming.factory.initial oracle.javatools.jndi.LocalInitialContextFactory
java.runtime.name Java(TM) SE Runtime Environment
java.runtime.version 1.6.0_07-b06
java.specification.name Java Platform API Specification
java.specification.vendor Sun Microsystems Inc.
java.specification.version 1.6
java.util.logging.config.file logging.conf
java.vendor Sun Microsystems Inc.
java.vendor.url http://java.sun.com/
java.vendor.url.bug http://java.sun.com/cgi-bin/bugreport.cgi
java.version 1.6.0_07
java.vm.info mixed mode
java.vm.name Java HotSpot(TM) Client VM
java.vm.specification.name Java Virtual Machine Specification
java.vm.specification.vendor Sun Microsystems Inc.
java.vm.specification.version 1.0
java.vm.vendor Sun Microsystems Inc.
java.vm.version 10.0-b23
jdbc.driver.home /C:/oracle/product/10.2.0/client_1/
jdbc.library /C:/oracle/product/10.2.0/client_1/jdbc/lib/ojdbc14.jar
line.separator \r\n
oracle.home C:\sqldeveloper
oracle.ide.util.AddinPolicyUtils.OVERRIDE_FLAG true
oracle.translated.locales de,es,fr,it,ja,ko,pt_BR,zh_CN,zh_TW
oracle.xdkjava.compatibility.version 9.0.4
orai18n.library /C:/oracle/product/10.2.0/client_1/jlib/orai18n.jar
os.arch x86
os.name Windows XP
os.version 5.1
path.separator ;
reserved_filenames con,aux,prn,lpt1,lpt2,lpt3,lpt4,lpt5,lpt6,lpt7,lpt8,lpt9,com1,com2,com3,com4,com5,com6,com7,com8,com9,conin$,conout,conout$
sun.arch.data.model 32
sun.boot.class.path C:\Java\jdk1.6.0_07\jre\lib\resources.jar;C:\Java\jdk1.6.0_07\jre\lib\rt.jar;C:\Java\jdk1.6.0_07\jre\lib\sunrsasign.jar;C:\Java\jdk1.6.0_07\jre\lib\jsse.jar;C:\Java\jdk1.6.0_07\jre\lib\jce.jar;C:\Java\jdk1.6.0_07\jre\lib\charsets.jar;C:\Java\jdk1.6.0_07\jre\classes
sun.boot.library.path C:\Java\jdk1.6.0_07\jre\bin
sun.cpu.endian little
sun.cpu.isalist
sun.desktop windows
sun.io.unicode.encoding UnicodeLittle
sun.java2d.ddoffscreen false
sun.jnu.encoding Cp1252
sun.management.compiler HotSpot Client Compiler
sun.os.patch.level Service Pack 3
user.country US
user.dir C:\sqldeveloper\sqldeveloper\bin
user.home C:\Documents and Settings\Administrator
user.language en
user.name zsysadmin
user.timezone America/Los_Angeles
user.variant
windows.shell.font.languages
Extensions
Name Identifier Version Status
==== ========== ======= ======
Check For Updates oracle.ide.webupdate 11.1.1.0.22.49.42 Loaded
Code Editor oracle.ide.ceditor 11.1.1.0.22.49.42 Loaded
Database Connection Support oracle.jdeveloper.db.connection 11.1.1.0.22.49.42 Loaded
Database Object Explorers oracle.ide.db.explorer 11.1.1.0.22.49.42 Loaded
Database UI oracle.ide.db 11.1.1.0.22.49.42 Loaded
Diff/Merge oracle.ide.diffmerge 11.1.1.0.22.49.42 Loaded
Extended IDE Platform oracle.javacore 11.1.1.0.22.49.42 Loaded
External Tools oracle.ide.externaltools 11.1.1.0.22.49.42 Loaded
Feedback oracle.ide.feedback 11.1.1.0.22.49.42 Loaded
File Support oracle.ide.files 11.1.1.0.22.49.42 Loaded
File System Navigator oracle.sqldeveloper.filenavigator 11.1.1.54.40 Loaded
Help System oracle.ide.help 11.1.1.0.22.49.42 Loaded
History Support oracle.jdeveloper.history 11.1.1.0.22.49.42 Loaded
Import/Export Support oracle.ide.importexport 11.1.1.0.22.49.42 Loaded
JTDS JDBC Driver oracle.sqldeveloper.thirdparty.drivers.sqlserver 11.1.1.54.11 Loaded
Log Window oracle.ide.log 11.1.1.0.22.49.42 Loaded
Mac OS X Adapter oracle.ideimpl.apple 11.1.1.0.22.49.42 Loaded
MySQL JDBC Driver oracle.sqldeveloper.thirdparty.drivers.mysql 11.1.1.54.11 Loaded
Navigator oracle.ide.navigator 11.1.1.0.22.49.42 Loaded
Object Gallery oracle.ide.gallery 11.1.1.0.22.49.42 Loaded
Object Viewer oracle.sqldeveloper.oviewer 11.1.1.54.40 Loaded
Oracle IDE oracle.ide 11.1.1.0.22.49.42 Loaded
Oracle Microsoft Access Browser oracle.sqldeveloper.thirdparty.access 11.1.1.54.40 Loaded
Oracle Migration Workbench oracle.sqldeveloper.migration 11.1.1.54.40 Loaded
Oracle Migration Workbench - MS Access oracle.sqldeveloper.migration.msaccess 11.1.1.54.40 Loaded
Oracle Migration Workbench - MySQL oracle.sqldeveloper.migration.mysql5 11.1.1.54.40 Loaded
Oracle Migration Workbench - SQLServer oracle.sqldeveloper.migration.sqlserver2005 11.1.1.54.40 Loaded
Oracle Migration Workbench - Translation Core oracle.sqldeveloper.migration.translation.core 11.1.1.54.44 Loaded
Oracle Migration Workbench - Translation MS Access oracle.sqldeveloper.migration.translation.msaccess 11.1.1.54.40 Loaded
Oracle Migration Workbench - Translation MS SQL Server oracle.sqldeveloper.migration.translation.sqlserver 11.1.1.54.40 Loaded
Oracle Migration Workbench - Translation MySQL oracle.sqldeveloper.migration.translation.mysql 11.1.1.54.40 Loaded
Oracle Migration Workbench - Translation Sybase oracle.sqldeveloper.migration.translation.sybase 11.1.1.54.44 Loaded
Oracle Migration Workbench - Translation UI oracle.sqldeveloper.migration.translation.gui 11.1.1.54.40 Loaded
Oracle MySQL Browser oracle.sqldeveloper.thirdparty.mysql 11.1.1.54.40 Loaded
Oracle SQL Developer oracle.sqldeveloper 11.1.1.54.40 Loaded
Oracle SQL Developer Extras oracle.sqldeveloper.extras 11.1.1.54.40 Loaded
Oracle SQL Developer Reports oracle.sqldeveloper.report 11.1.1.54.40 Loaded
Oracle SQL Developer SearchBar oracle.sqldeveloper.searchbar 11.1.1.54.40 Loaded
Oracle SQL Developer TimesTen oracle.sqldeveloper.timesten 1.5.1.1.2 Loaded
Oracle SQL Server Browser oracle.sqldeveloper.thirdparty.sqlserver 11.1.1.54.40 Loaded
Oracle Sybase Browser oracle.sqldeveloper.thirdparty.sybase 1.2.1.54.40 Loaded
Oracle XML Schema Support oracle.sqldeveloper.xmlschema 11.1.1.54.40 Loaded
OrindaBuild Java Service Generator (Demo) com.orindasoft.app.procbuilder.sqldeveloper 5.1.20081208 Loaded
PROBE Debugger oracle.jdeveloper.db.debug.probe 11.1.1.0.22.49.42 Loaded
Peek oracle.ide.peek 1.0 Loaded
Replace With oracle.ide.replace 11.1.1.0.22.49.42 Loaded
Runner oracle.ide.runner 11.1.1.0.22.49.42 Loaded
SQL Worksheet Window oracle.sqldeveloper.sqlworksheet 11.1.1.54.40 Loaded
Search Bar oracle.ide.searchbar 11.1.1.0.0 Loaded
Snippet Window oracle.sqldeveloper.snippet 11.1.1.54.40 Loaded
Sybase 12 oracle.sqldeveloper.migration.sybase12 11.1.1.54.40 Loaded
Sybase 15 oracle.sqldeveloper.migration.sybase15 11.1.1.54.40 Loaded
Tuning oracle.sqldeveloper.tuning 11.1.1.54.40 Loaded
VHV oracle.ide.vhv 11.1.1.0.22.49.42 Loaded
Versioning Support oracle.jdeveloper.vcs 11.1.1.0.22.49.42 Loaded
Versioning Support for CVS oracle.jdeveloper.cvs 11.1.1.0.22.49.42 Loaded
Versioning Support for Subversion oracle.jdeveloper.subversion 11.1.1.0.22.49.42 Loaded
Web Browser and Proxy oracle.ide.webbrowser 11.1.1.0.22.49.42 Loaded
oracle.ide.dependency oracle.ide.dependency 11.1.1.0.22.49.42 Loaded
oracle.ide.indexing oracle.ide.indexing 11.1.1.0.22.49.42 Loaded
Edited by: user518195 on Nov 9, 2008 3:59 PMMireille,
Thanks for the input. I did both steps you suggested and same result, with the 11.1.0.6 client as well. The stack trace and environment is noted below.
Still looking for a solution.
Cheers,
Tim
oracle.dbtools.migration.workbench.core.ui.AbstractMigrationProgressRunnable.start(AbstractMigrationProgressRunnable.java:141)
Stack trace;
java.lang.Exception: java.lang.NullPointerException
at oracle.dbtools.migration.workbench.core.ui.AbstractMigrationProgressRunnable.start(AbstractMigrationProgressRunnable.java:141)
at oracle.dbtools.migration.workbench.core.CaptureInitiator.launch(CaptureInitiator.java:93)
at oracle.dbtools.raptor.controls.sqldialog.ObjectActionController.handleEvent(ObjectActionController.java:146)
at oracle.ide.controller.IdeAction.performAction(IdeAction.java:524)
at oracle.ide.controller.IdeAction.actionPerformedImpl(IdeAction.java:855)
at oracle.ide.controller.IdeAction.actionPerformed(IdeAction.java:496)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1220)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1261)
at java.awt.Component.processMouseEvent(Component.java:6041)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
at java.awt.Component.processEvent(Component.java:5806)
at java.awt.Container.processEvent(Container.java:2058)
at java.awt.Component.dispatchEventImpl(Component.java:4413)
at java.awt.Container.dispatchEventImpl(Container.java:2116)
at java.awt.Component.dispatchEvent(Component.java:4243)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
at java.awt.Container.dispatchEventImpl(Container.java:2102)
at java.awt.Window.dispatchEventImpl(Window.java:2440)
at java.awt.Component.dispatchEvent(Component.java:4243)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Caused by: java.lang.NullPointerException
at oracle.dbtools.migration.workbench.plugin.MySQL5Capturer.captureColumnDetails(MySQL5Capturer.java:405)
at oracle.dbtools.migration.workbench.plugin.MySQLCapturer.captureObjects(MySQLCapturer.java:176)
at oracle.dbtools.migration.workbench.plugin.MySQL5Capturer.captureObjects(MySQL5Capturer.java:134)
at oracle.dbtools.migration.capture.OnlineCaptureWorker.capturePerTableImpl(OnlineCaptureWorker.java:188)
at oracle.dbtools.migration.capture.CaptureWorker.capturePerTable(CaptureWorker.java:526)
at oracle.dbtools.migration.capture.CaptureWorker.captureType(CaptureWorker.java:283)
at oracle.dbtools.migration.capture.CaptureWorker.runCapture(CaptureWorker.java:231)
at oracle.dbtools.migration.workbench.core.ui.CaptureRunner.doWork(CaptureRunner.java:65)
at oracle.dbtools.migration.workbench.core.ui.AbstractMigrationProgressRunnable.run(AbstractMigrationProgressRunnable.java:161)
at oracle.dbtools.migration.workbench.core.ui.MigrationProgressBar.run(MigrationProgressBar.java:569)
at java.lang.Thread.run(Thread.java:619)
java.lang.NullPointerException
Stack trace;
java.lang.Exception: java.lang.NullPointerException
at oracle.dbtools.migration.workbench.core.ui.AbstractMigrationProgressRunnable.start(AbstractMigrationProgressRunnable.java:141)
at oracle.dbtools.migration.workbench.core.CaptureInitiator.launch(CaptureInitiator.java:93)
at oracle.dbtools.raptor.controls.sqldialog.ObjectActionController.handleEvent(ObjectActionController.java:146)
at oracle.ide.controller.IdeAction.performAction(IdeAction.java:524)
at oracle.ide.controller.IdeAction.actionPerformedImpl(IdeAction.java:855)
at oracle.ide.controller.IdeAction.actionPerformed(IdeAction.java:496)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1220)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1261)
at java.awt.Component.processMouseEvent(Component.java:6041)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
at java.awt.Component.processEvent(Component.java:5806)
at java.awt.Container.processEvent(Container.java:2058)
at java.awt.Component.dispatchEventImpl(Component.java:4413)
at java.awt.Container.dispatchEventImpl(Container.java:2116)
at java.awt.Component.dispatchEvent(Component.java:4243)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
at java.awt.Container.dispatchEventImpl(Container.java:2102)
at java.awt.Window.dispatchEventImpl(Window.java:2440)
at java.awt.Component.dispatchEvent(Component.java:4243)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Caused by: java.lang.NullPointerException
at oracle.dbtools.migration.workbench.plugin.MySQL5Capturer.captureColumnDetails(MySQL5Capturer.java:405)
at oracle.dbtools.migration.workbench.plugin.MySQLCapturer.captureObjects(MySQLCapturer.java:176)
at oracle.dbtools.migration.workbench.plugin.MySQL5Capturer.captureObjects(MySQL5Capturer.java:134)
at oracle.dbtools.migration.capture.OnlineCaptureWorker.capturePerTableImpl(OnlineCaptureWorker.java:188)
at oracle.dbtools.migration.capture.CaptureWorker.capturePerTable(CaptureWorker.java:526)
at oracle.dbtools.migration.capture.CaptureWorker.captureType(CaptureWorker.java:283)
at oracle.dbtools.migration.capture.CaptureWorker.runCapture(CaptureWorker.java:231)
at oracle.dbtools.migration.workbench.core.ui.CaptureRunner.doWork(CaptureRunner.java:65)
at oracle.dbtools.migration.workbench.core.ui.AbstractMigrationProgressRunnable.run(AbstractMigrationProgressRunnable.java:161)
at oracle.dbtools.migration.workbench.core.ui.MigrationProgressBar.run(MigrationProgressBar.java:569)
at java.lang.Thread.run(Thread.java:619)
About
Oracle SQL Developer 1.5.1
Version 1.5.1
Build MAIN-5440
Copyright © 2005,2008 Oracle. All Rights Reserved.
IDE Version: 11.1.1.0.22.49.42
Product ID: oracle.sqldeveloper
Product Version: 11.1.1.54.40
Version
Component Version
========= =======
CVS Version Internal to Oracle SQL Developer (client-only)
Java(TM) Platform 1.6.0_07
Oracle IDE 1.5.1.54.40
Versioning Support 1.5.1.54.40
Properties
Name Value
==== =====
apple.laf.useScreenMenuBar true
awt.toolkit sun.awt.windows.WToolkit
class.load.environment oracle.ide.boot.IdeClassLoadEnvironment
class.load.log.level CONFIG
class.transfer delegate
com.apple.macos.smallTabs true
com.apple.mrj.application.apple.menu.about.name "SQL_Developer"
com.apple.mrj.application.growbox.intrudes false
file.encoding Cp1252
file.encoding.pkg sun.io
file.separator \
ice.browser.forcegc false
ice.pilots.html4.ignoreNonGenericFonts true
ice.pilots.html4.tileOptThreshold 0
ide.AssertTracingDisabled true
ide.bootstrap.start 453697421257
ide.build MAIN-5440
ide.conf C:\sqldeveloper\sqldeveloper\bin\sqldeveloper.conf
ide.config_pathname C:\sqldeveloper\sqldeveloper\bin\sqldeveloper.conf
ide.debugbuild false
ide.devbuild false
ide.extension.search.path sqldeveloper/extensions:jdev/extensions:ide/extensions
ide.firstrun false
ide.java.minversion 1.5.0
ide.launcherProcessId 5044
ide.main.class oracle.ide.boot.IdeLauncher
ide.patches.dir ide/lib/patches
ide.pref.dir C:\Documents and Settings\Administrator\Application Data\SQL Developer
ide.pref.dir.base C:\Documents and Settings\Administrator\Application Data
ide.product oracle.sqldeveloper
ide.shell.enableFileTypeAssociation C:\sqldeveloper\sqldeveloper.exe
ide.splash.screen splash.gif
ide.startingArg0 C:\sqldeveloper\sqldeveloper.exe
ide.startingcwd C:\sqldeveloper
ide.user.dir C:\Documents and Settings\Administrator\Application Data\SQL Developer
ide.user.dir.var IDE_USER_DIR
ide.work.dir C:\Documents and Settings\Administrator\My Documents\SQL Developer
ide.work.dir.base C:\Documents and Settings\Administrator\My Documents
java.awt.graphicsenv sun.awt.Win32GraphicsEnvironment
java.awt.printerjob sun.awt.windows.WPrinterJob
java.class.path ..\..\ide\lib\ide-boot.jar
java.class.version 50.0
java.endorsed.dirs C:\Java\jdk1.6.0_07\jre\lib\endorsed
java.ext.dirs C:\Java\jdk1.6.0_07\jre\lib\ext;C:\WINDOWS\Sun\Java\lib\ext
java.home C:\Java\jdk1.6.0_07\jre
java.io.tmpdir c:\temp\
java.library.path C:\sqldeveloper;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\oracle\product\11.1.0\client_1\bin;C:\oracle\product\10.2.0\client_1\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Universal Extractor\bin;C:\Program Files\IDM Computer Solutions\UltraEdit-32;C:\Program Files\Diskeeper Corporation\Diskeeper\;c:\Embarcadero\PerformanceCenter
java.naming.factory.initial oracle.javatools.jndi.LocalInitialContextFactory
java.runtime.name Java(TM) SE Runtime Environment
java.runtime.version 1.6.0_07-b06
java.specification.name Java Platform API Specification
java.specification.vendor Sun Microsystems Inc.
java.specification.version 1.6
java.util.logging.config.file logging.conf
java.vendor Sun Microsystems Inc.
java.vendor.url http://java.sun.com/
java.vendor.url.bug http://java.sun.com/cgi-bin/bugreport.cgi
java.version 1.6.0_07
java.vm.info mixed mode
java.vm.name Java HotSpot(TM) Client VM
java.vm.specification.name Java Virtual Machine Specification
java.vm.specification.vendor Sun Microsystems Inc.
java.vm.specification.version 1.0
java.vm.vendor Sun Microsystems Inc.
java.vm.version 10.0-b23
jdbc.driver.home /C:/oracle/product/11.1.0/client_1/
jdbc.library /C:/oracle/product/11.1.0/client_1/jdbc/lib/ojdbc5.jar
line.separator \r\n
oracle.home C:\sqldeveloper
oracle.ide.util.AddinPolicyUtils.OVERRIDE_FLAG true
oracle.translated.locales de,es,fr,it,ja,ko,pt_BR,zh_CN,zh_TW
oracle.xdkjava.compatibility.version 9.0.4
orai18n.library /C:/oracle/product/11.1.0/client_1/jlib/orai18n.jar
os.arch x86
os.name Windows XP
os.version 5.1
path.separator ;
reserved_filenames con,aux,prn,lpt1,lpt2,lpt3,lpt4,lpt5,lpt6,lpt7,lpt8,lpt9,com1,com2,com3,com4,com5,com6,com7,com8,com9,conin$,conout,conout$
sun.arch.data.model 32
sun.boot.class.path C:\Java\jdk1.6.0_07\jre\lib\resources.jar;C:\Java\jdk1.6.0_07\jre\lib\rt.jar;C:\Java\jdk1.6.0_07\jre\lib\sunrsasign.jar;C:\Java\jdk1.6.0_07\jre\lib\jsse.jar;C:\Java\jdk1.6.0_07\jre\lib\jce.jar;C:\Java\jdk1.6.0_07\jre\lib\charsets.jar;C:\Java\jdk1.6.0_07\jre\classes
sun.boot.library.path C:\Java\jdk1.6.0_07\jre\bin
sun.cpu.endian little
sun.cpu.isalist
sun.desktop windows
sun.io.unicode.encoding UnicodeLittle
sun.java2d.ddoffscreen false
sun.jnu.encoding Cp1252
sun.management.compiler HotSpot Client Compiler
sun.os.patch.level Service Pack 3
user.country US
user.dir C:\sqldeveloper\sqldeveloper\bin
user.home C:\Documents and Settings\Administrator
user.language en
user.name zsysadmin
user.timezone America/Los_Angeles
user.variant
windows.shell.font.languages
Extensions
Name Identifier Version Status
==== ========== ======= ======
Check For Updates oracle.ide.webupdate 11.1.1.0.22.49.42 Loaded
Code Editor oracle.ide.ceditor 11.1.1.0.22.49.42 Loaded
Database Connection Support oracle.jdeveloper.db.connection 11.1.1.0.22.49.42 Loaded
Database Object Explorers oracle.ide.db.explorer 11.1.1.0.22.49.42 Loaded
Database UI oracle.ide.db 11.1.1.0.22.49.42 Loaded
Diff/Merge oracle.ide.diffmerge 11.1.1.0.22.49.42 Loaded
Extended IDE Platform oracle.javacore 11.1.1.0.22.49.42 Loaded
External Tools oracle.ide.externaltools 11.1.1.0.22.49.42 Loaded
Feedback oracle.ide.feedback 11.1.1.0.22.49.42 Loaded
File Support oracle.ide.files 11.1.1.0.22.49.42 Loaded
File System Navigator oracle.sqldeveloper.filenavigator 11.1.1.54.40 Loaded
Help System oracle.ide.help 11.1.1.0.22.49.42 Loaded
History Support oracle.jdeveloper.history 11.1.1.0.22.49.42 Loaded
Import/Export Support oracle.ide.importexport 11.1.1.0.22.49.42 Loaded
JTDS JDBC Driver oracle.sqldeveloper.thirdparty.drivers.sqlserver 11.1.1.54.11 Loaded
Log Window oracle.ide.log 11.1.1.0.22.49.42 Loaded
Mac OS X Adapter oracle.ideimpl.apple 11.1.1.0.22.49.42 Loaded
MySQL JDBC Driver oracle.sqldeveloper.thirdparty.drivers.mysql 11.1.1.54.11 Loaded
Navigator oracle.ide.navigator 11.1.1.0.22.49.42 Loaded
Object Gallery oracle.ide.gallery 11.1.1.0.22.49.42 Loaded
Object Viewer oracle.sqldeveloper.oviewer 11.1.1.54.40 Loaded
Oracle IDE oracle.ide 11.1.1.0.22.49.42 Loaded
Oracle Microsoft Access Browser oracle.sqldeveloper.thirdparty.access 11.1.1.54.40 Loaded
Oracle Migration Workbench oracle.sqldeveloper.migration 11.1.1.54.40 Loaded
Oracle Migration Workbench - MS Access oracle.sqldeveloper.migration.msaccess 11.1.1.54.40 Loaded
Oracle Migration Workbench - MySQL oracle.sqldeveloper.migration.mysql5 11.1.1.54.40 Loaded
Oracle Migration Workbench - SQLServer oracle.sqldeveloper.migration.sqlserver2005 11.1.1.54.40 Loaded
Oracle Migration Workbench - Translation Core oracle.sqldeveloper.migration.translation.core 11.1.1.54.44 Loaded
Oracle Migration Workbench - Translation MS Access oracle.sqldeveloper.migration.translation.msaccess 11.1.1.54.40 Loaded
Oracle Migration Workbench - Translation MS SQL Server oracle.sqldeveloper.migration.translation.sqlserver 11.1.1.54.40 Loaded
Oracle Migration Workbench - Translation MySQL oracle.sqldeveloper.migration.translation.mysql 11.1.1.54.40 Loaded
Oracle Migration Workbench - Translation Sybase oracle.sqldeveloper.migration.translation.sybase 11.1.1.54.44 Loaded
Oracle Migration Workbench - Translation UI oracle.sqldeveloper.migration.translation.gui 11.1.1.54.40 Loaded
Oracle MySQL Browser oracle.sqldeveloper.thirdparty.mysql 11.1.1.54.40 Loaded
Oracle SQL Developer oracle.sqldeveloper 11.1.1.54.40 Loaded
Oracle SQL Developer Extras oracle.sqldeveloper.extras 11.1.1.54.40 Loaded
Oracle SQL Developer Reports oracle.sqldeveloper.report 11.1.1.54.40 Loaded
Oracle SQL Developer SearchBar oracle.sqldeveloper.searchbar 11.1.1.54.40 Loaded
Oracle SQL Developer TimesTen oracle.sqldeveloper.timesten 1.5.1.1.2 Loaded
Oracle SQL Server Browser oracle.sqldeveloper.thirdparty.sqlserver 11.1.1.54.40 Loaded
Oracle Sybase Browser oracle.sqldeveloper.thirdparty.sybase 1.2.1.54.40 Loaded
Oracle XML Schema Support oracle.sqldeveloper.xmlschema 11.1.1.54.40 Loaded
OrindaBuild Java Service Generator (Demo) com.orindasoft.app.procbuilder.sqldeveloper 5.1.20081208 Loaded
PROBE Debugger oracle.jdeveloper.db.debug.probe 11.1.1.0.22.49.42 Loaded
Peek oracle.ide.peek 1.0 Loaded
Replace With oracle.ide.replace 11.1.1.0.22.49.42 Loaded
Runner oracle.ide.runner 11.1.1.0.22.49.42 Loaded
SQL Worksheet Window oracle.sqldeveloper.sqlworksheet 11.1.1.54.40 Loaded
Search Bar oracle.ide.searchbar 11.1.1.0.0 Loaded
Snippet Window oracle.sqldeveloper.snippet 11.1.1.54.40 Loaded
Sybase 12 oracle.sqldeveloper.migration.sybase12 11.1.1.54.40 Loaded
Sybase 15 oracle.sqldeveloper.migration.sybase15 11.1.1.54.40 Loaded
Tuning oracle.sqldeveloper.tuning 11.1.1.54.40 Loaded
VHV oracle.ide.vhv 11.1.1.0.22.49.42 Loaded
Versioning Support oracle.jdeveloper.vcs 11.1.1.0.22.49.42 Loaded
Versioning Support for CVS oracle.jdeveloper.cvs 11.1.1.0.22.49.42 Loaded
Versioning Support for Subversion oracle.jdeveloper.subversion 11.1.1.0.22.49.42 Loaded
Web Browser and Proxy oracle.ide.webbrowser 11.1.1.0.22.49.42 Loaded
oracle.ide.dependency oracle.ide.dependency 11.1.1.0.22.49.42 Loaded
oracle.ide.indexing oracle.ide.indexing 11.1.1.0.22.49.42 Loaded -
Java.lang.NullPointerException in xRPM iView Preview from Portal Content
Hi all,
When I am trying to Preview the xRPM iViews from Content Administration>Portal Content> Portal Content> Content Provided by SAP> End User Content> Project Portfolio and Design Collaboration> iViews>Portfolio Manaagement> Item Dashboard
I am getting the following error
"500 Internal Server Error
Failed to process request. Please contact your system administrator.
While processing the current request, an exception occured which could not be handled by the application or the framework.
Root Cause
The initial exception that caused the request to fail, was:
java.lang.NullPointerException
at com.sap.xapps.cprxrpm.ui.portfolioitem.dashboard.component.ItemDashboard.execute__Rpm__Item_Getlist_Input(ItemDashboard.java:339)
at com.sap.xapps.cprxrpm.ui.portfolioitem.dashboard.component.ItemDashboard.wdDoInit(ItemDashboard.java:221)
at com.sap.xapps.cprxrpm.ui.portfolioitem.dashboard.component.wdp.InternalItemDashboard.wdDoInit(InternalItemDashboard.java:1559)
at com.sap.tc.webdynpro.progmodel.generation.DelegatingComponent.doInit(DelegatingComponent.java:108)
at com.sap.tc.webdynpro.progmodel.controller.Controller.initController(Controller.java:215)
... 27 more
But I can view the "Item dashboard" on the xRPM under Portfolio Management.
I don't know why I can't Preview the same from Portal Content. My objective is to pick this iView and add this to another Customised workset/Role.
Pls help me.
thanks and warm regards
PurnenduHi,
Have you had a chance to fix this issue, pelase let me know?!
Thanks,
Parthi -
RFC Import from own SAP XI results in java.lang.NullPointerException
Hi All,
I'm trying to do an import of a local RFC (developed in SAP XI) but this results in a java.lang.NullPointerException
RFC import from other SAP system is no problem.
Anyone an idea?
Cheers,
FrankHi,
But we are using custom RFCs from SAP XI only. We are using XI3.0 SP11.
Could you pls check the following sap notes..
SAP Notes 677732, 672745, 212011, and 718320.
Have a look at the following link...
http://help.sap.com/saphelp_nw04/helpdata/en/2b/a48f3c685bc358e10000000a11405a/frameset.htm
Thanks,
Sasi -
Returning ResultSet from servlet to jsp - java.lang.NullPointerException
Hey all, i've been stuck on this for too long now...just trying to return a ResultSet from a servlet to jsp page.
Had a bunch of problems earlier...which i think were fixed but...now i get a "java.lang.NullPointerException" in my jsp page when i try to get elements from the ResultSet object.
Here is the latest version of my code:
Servlet:
String QueryStr="select ProdName from products";
Statement stmt=conn.createStatement();
rs=stmt.executeQuery(QueryStr); //get resultset
sbean.setInventory(rs); //set ResultSet in bean
req.getSession(true).setAttribute("s_resbean",sbean); //create session/request variable, set to bean
Bean:
package beans;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.sql.*;
import javax.sql.*;
public class SearchBean extends HttpServlet{
private int searchFlag=0;
private ResultSet inventory;
public SearchBean(){
public int getSearchFlag(){
return searchFlag;
public ResultSet getInventory(){
return inventory;
public void setInventory(ResultSet rs){
this.inventory=rs;
public void setSearchFlag(){
this.searchFlag=1;
jsp:
<%@ page language="java" import="java.lang.*,java.sql.*,javax.sql.*,PopLists.PopInvLists,beans.SearchBean"%>
<jsp:useBean scope="session" id="s_resbean" class="beans.SearchBean" />
<% ResultSet categories=PopInvLists.getCat();
ResultSet manuf=PopInvLists.getManuf();
ResultSet supplier=PopInvLists.getSupplier();
ResultSet cars=PopInvLists.getCars();
ResultSet search=(ResultSet)request.getAttribute("s_resbean");
%>
<% while(search.next()){
String pname=search.getString("ProdName");
%>
It craps out when i try to loop through the "search" ResultSet.
I can loop through the rest of the ResultSets no problem....just this one doesn't work because it's set in a servlet, not a simple java class.
Just to clarify, i am populating some dropdown lists on entry to the screen, which the user will use to perform a search. Once the search btn is clicked, the servlet is called, gets the request info for the search, performs search, and returns the resultset to the original screen. I want to eventually display the result under the search criteria.
Someone....Please Please please tell me how to get this working...it should be very simple, but i just can't get it to work.
Thanks in advance,
Adityareq.getSession(true).setAttribute("s_resbean",sbean); //create session/request variable, set to beanHere you add an attribute to the session.
ResultSet search=(ResultSet)request.getAttribute("s_resbean");Here you try to get the attribute from the request. Naturally it isn't there because you added it to the session, not the request. Despite your comment in the first line of code, a session is not a request. And vice versa. -
Java.lang.NullPointerException returned from webservice
Hi I have an axis client which sends an image attachment to an axis webservice, however I am returned with a null pointer exception,
this is my client,
package chapter5;
import java.net.URL;
import org.apache.axis.client.Service;
import org.apache.axis.client.Call;
import org.apache.axis.encoding.XMLType;
import org.apache.axis.encoding.ser.JAFDataHandlerSerializerFactory;
import org.apache.axis.encoding.ser.JAFDataHandlerDeserializerFactory;
import javax.xml.rpc.ParameterMode;
import javax.xml.rpc.namespace.QName;
import javax.activation.DataHandler;
import javax.activation.FileDataSource;
public class AttachmentServiceClient{
public AttachmentServiceClient(){}
public static void main(String args[]){
try{
String filename = "D:\\images\\products\\r.jpg";
//create the data for the attached file
DataHandler dhSource = new DataHandler(new FileDataSource(filename));
String endpointURL = "http://localhost:8080/axis/services/AttachmentService";
String methodName = "addImage";
Service service = new Service();
Call call = (Call)service.createCall();
call.setTargetEndpointAddress(new URL(endpointURL));
call.setOperationName(new QName("AttachmentService",methodName));
call.addParameter("sku",XMLType.XSD_STRING,ParameterMode.PARAM_MODE_IN);
QName qname = new QName("AttachmentService","DataHandler");
call.addParameter("image",qname,ParameterMode.PARAM_MODE_IN);
//register the datahandler
call.registerTypeMapping(dhSource.getClass(),qname,JAFDataHandlerSerializerFactory.class,JAFDataHandlerDeserializerFactory.class);
call.setReturnType(XMLType.XSD_STRING);
Object[] params = new Object[]{"SKU-111",dhSource};
String result = (String)call.invoke(params);
System.out.println("The response: "+result);
; }catch(Exception e){
System.err.println(e.toString());
this is my webservice,
package chapter5;
import javax.activation.DataHandler;
import java.io.FileOutputStream;
import java.io.File;
import java.io.BufferedInputStream;
public class SparePartAttachmentService{
public SparePartAttachmentService(){}
public String addImage(String sku,DataHandler dataHandler){
System.out.println("trying");
try{
String filepath = "c:/wrox-axis/"+sku+"-image.jpg";
FileOutputStream fout = new FileOutputStream(new File(filepath));
BufferedInputStream in = new BufferedInputStream(dataHandler.getInputStream());
while(in.available()!=0){
fout.write(in.read());
}catch(Exception e){
return e.toString();
return "Image: "+sku+" has been added successfully!!";
I did a test by stripping out the attachment being sent by the client and just let it send the string,
then in the webservice I stripped out the lines for the attachment and just returned the string and it worked ok, so it has been deployed correctly.
I have the Java Activation framework both in tomcat commons and my webapps lib dir.
I'm pretty sure the error is being thrown here,
public String addImage(String sku,DataHandler dataHandler){
any help would be greatly appreciated,
thank you,
JP.Ok, I have now successfully got the stack trace to show where the exception bubbled, Im suprised its in the axis client as I assumed it was in the webservice, but this whole exercise has been extremely beneficial,
anyway this is the client code again and the stack trace error, I now think the problem lies within the JAF, possibly, however, im doing something incorrectly,
package chapter5;
import java.net.URL;
import org.apache.axis.client.Service;
import org.apache.axis.client.Call;
import org.apache.axis.encoding.XMLType;
import org.apache.axis.encoding.ser.JAFDataHandlerSerializerFactory;
import org.apache.axis.encoding.ser.JAFDataHandlerDeserializerFactory;
import javax.xml.rpc.ParameterMode;
import javax.xml.rpc.namespace.QName;
import javax.activation.DataHandler;
import javax.activation.FileDataSource;
import javax.activation.DataSource;
import java.io.File;
public class AttachmentServiceClient{
public AttachmentServiceClient(){}
public static void main(String args[]){
try{
String filename = "D:\\javaDev\\utilities\\coldfusionMX\\Java\\javapetstore\\r.jpg";
//create the data for the attached file
DataHandler dhSource = new DataHandler(new FileDataSource(new File(filename)));
String endpointURL = "http://localhost:8080/axis/services/AttachmentService";
String methodName = "addImage";
Service service = new Service();
Call call = (Call)service.createCall();
call.setTargetEndpointAddress(new URL(endpointURL));
call.setOperationName(new QName("AttachmentService",methodName));
call.addParameter("sku",XMLType.XSD_STRING,ParameterMode.PARAM_MODE_IN);
QName qname = new QName("AttachmentService","DataHandler");
call.addParameter("image",qname,ParameterMode.PARAM_MODE_IN);
//register the datahandler
call.registerTypeMapping(dhSource.getClass(),qname,JAFDataHandlerSerializerFactory.class,JAFDataHandlerDeserializerFactory.class);
call.setReturnType(XMLType.XSD_STRING);
Object[] params = new Object[]{"SKU-111",dhSource};
try{
String result = (String)call.invoke(params);
System.out.println("The response: "+result);
}catch(Exception f){
f.getStackTrace();
f.printStackTrace();
}catch(Exception e){
System.err.println("error");
stack trace
C:\wrox-axis>java chapter5.AttachmentServiceClient
java.lang.NullPointerException
at org.apache.axis.AxisFault.makeFault(Unknown Source)
at org.apache.axis.SOAPPart.getAsString(Unknown Source)
at org.apache.axis.SOAPPart.getAsBytes(Unknown Source)
at org.apache.axis.Message.getContentLength(Unknown Source)
at org.apache.axis.transport.http.HTTPSender.invoke(Unknown Source)
at org.apache.axis.strategies.InvocationStrategy.visit(Unknown Source)
at org.apache.axis.SimpleChain.doVisiting(Unknown Source)
at org.apache.axis.SimpleChain.invoke(Unknown Source)
at org.apache.axis.client.AxisClient.invoke(Unknown Source)
at org.apache.axis.client.Call.invoke(Unknown Source)
at org.apache.axis.client.Call.invoke(Unknown Source)
at org.apache.axis.client.Call.invoke(Unknown Source)
at org.apache.axis.client.Call.invoke(Unknown Source)
at chapter5.AttachmentServiceClient.main(AttachmentServiceClient.java:45
Caused by: java.lang.NullPointerException
at org.apache.axis.encoding.ser.JAFDataHandlerSerializer.serialize(Unkno
wn Source)
at org.apache.axis.encoding.SerializationContextImpl.serializeActual(Unk
nown Source)
at org.apache.axis.encoding.SerializationContextImpl.serialize(Unknown S
ource)
at org.apache.axis.encoding.SerializationContextImpl.outputMultiRefs(Unk
nown Source)
at org.apache.axis.message.SOAPEnvelope.outputImpl(Unknown Source)
at org.apache.axis.message.MessageElement.output(Unknown Source)
... 13 more -
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 -
Getting java.lang.NullpointerException while closing resultset aft using it
Hi,
I kindly request to share your ideas reg. my problem.
I am opening a database connection using connection pool and i am using two or more resultsets and statement objects.I am closing these objects at the end of their usage.But i am getting java.lang.NullpointerException when i close them(if i don't close them it works fine). what might be the reason. Had i did any thing wrong in the code.
please view the code
public String storeNewConnection(String CIRCLE,String DIVISION,String SUB_DIVISION,String SECTION,String CONSUMER_NAME,String FATHER_NAME,String STREET_NAME,String DOOR_NO,String TOWN_CITY,String LAND_MARK,String PINCODE,String STDCODE,String PHONE_NO,String EMAIL,String NEIGHBOUR_SCNO,String DOCUMENT_CODE,String LT_APR_NO,String year1,String month1,String day1,String PCBNO,String CONSUMER_STATUS,String SOCIAL_GROUP,String CATEGORY_SUPPLY,String LOCATION_PREMISES,String PURPOSE_OF_SUPPLY,String DURATION,String LOAD_TYPE,String CONNECTED_LOAD,String CONTRACTED_LOAD,String APPLICATION_FEE,String DEVELOPMENT_CHARGES,String SECURITY_DEPOSIT,String ADDL_SECURITY_DESPOSIT,String DEPOSITED_THRU,String DD_CHEQUE_DETAILS,String year2,String month2,String day2,String REMARKS,String POLE_NO)
int count=0;
Statement st=null;
ResultSet rs=null,rs1=null,rs2=null,rs3=null;
PreparedStatement pst=null;
String result="",query="",sysDate="",sysDate2="";
String reg_no = "";
try
st=con.createStatement();
//Check dates with sys date
String date1 =null;
String date2 =null;
if(! (year1.equals("") || month1.equals("") || day1.equals("")) )
date1=day1+"-"+month1+"-"+year1;
rs2=st.executeQuery("select round(to_date('"+date1+"','dd-Mon-yyyy')-to_date(sysdate,'dd-Mon-yy')) from dual");
rs2.next();
if(rs2.getInt(1) != 0)
return "false";
if(! (year2.equals("") || month2.equals("") || day2.equals("")) )
date2=day2+"-"+month2+"-"+year2;
rs3=st.executeQuery("select round(to_date('"+date2+"','dd-Mon-yyyy')-to_date(sysdate,'dd-Mon-yy')) from dual");
rs3.next();
if(rs3.getInt(1) != 0)
return "false";
rs1=st.executeQuery("select to_char(sysdate,'yyyyMONdd'),to_char(sysdate,'dd-Mon-yyyy') from dual");
rs1.next();
sysDate=rs1.getString(1);
sysDate2=rs1.getString(2);
rs=st.executeQuery("select max(SERIAL_NO) from NEW_CONNECTIONS where to_char(sysdate,'yyyy') = to_char(REG_DATE,'yyyy') and to_char(sysdate,'mm') = to_char(REG_DATE,'mm') and SUB_DIVISION_CODE = "+SUB_DIVISION+" and DIVISION_CODE = "+DIVISION+" and CIRCLE_CODE = "+CIRCLE+" ");
if(rs.next())
count = rs.getInt(1);
count++;
else
count=1;
query="insert into NEW_CONNECTIONS ( "+
" REG_NO,SERIAL_NO,REG_DATE,CIRCLE_CODE,DIVISION_CODE,SUB_DIVISION_CODE,SECTION_CODE, "+
" CONSUMER_NAME,FATHER_NAME,STREET_NAME,DOOR_NO,TOWN_CITY,LAND_MARK,PINCODE, "+
" STDCODE,PHONE_NO,EMAIL,NEIGHBOUR_SCNO,DOCUMENT_CODE,LT_APR_NO,LT_APR_DATE, "+
" PCBNO,CONSUMER_STATUS,SOCIAL_GROUP,CATEGORY_SUPPLY,LOCATION_PREMISES,PURPOSE_OF_SUPPLY,"+
" DURATION,LOAD_TYPE,CONNECTED_LOAD,CONTRACTED_LOAD,APPLICATION_FEE,DEVELOPMENT_CHARGES, "+
" SECURITY_DEPOSIT,ADDL_SECURITY_DEPOSIT,DEPOSITED_THRU,DD_CHEQUE_DETAILS,DD_CHEQUE_DATE,REMARKS,APPLICATION_STATUS,POLE_NO) "+
" values(?,?,'"+sysDate2+"',?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
pst = con.prepareStatement(query);
String cnt ="";
if(count <= 9)
cnt="0000";
else if(count <= 99)
cnt="000";
else if(count <= 999)
cnt="00";
else if(count <= 9999)
cnt="0";
cnt+=Integer.toString(count);
reg_no = CIRCLE+DIVISION+SUB_DIVISION+SECTION+"N"+cnt+sysDate;
int serial_no =count;
int pin = 0;
if(!PINCODE.equals(""))
pin =Integer.parseInt(PINCODE);
int std = 0;
if(!STDCODE.equals(""))
std = Integer.parseInt(STDCODE);
int status = Integer.parseInt(CONSUMER_STATUS);
int social_group = Integer.parseInt(SOCIAL_GROUP);
int supply = Integer.parseInt(CATEGORY_SUPPLY);
int location = Integer.parseInt(LOCATION_PREMISES);
int purpose = Integer.parseInt(PURPOSE_OF_SUPPLY);
int duration = Integer.parseInt(DURATION);
int laod_type = Integer.parseInt(LOAD_TYPE);
float conn_load = Float.parseFloat(CONNECTED_LOAD);
int cont_load = 0;
if(!CONTRACTED_LOAD.equals(""))
cont_load =Integer.parseInt(CONTRACTED_LOAD);
int app_fee = Integer.parseInt(APPLICATION_FEE);
int dev_chg = Integer.parseInt(DEVELOPMENT_CHARGES);
int sec_dep = Integer.parseInt(SECURITY_DEPOSIT);
int addl_sec_dep = 0;
if(!ADDL_SECURITY_DESPOSIT.equals(""))
addl_sec_dep =Integer.parseInt(ADDL_SECURITY_DESPOSIT);
int dep_thru = Integer.parseInt(DEPOSITED_THRU);
pst.setString(1,reg_no);
pst.setInt(2,serial_no);
pst.setString(3,CIRCLE);
pst.setString(4,DIVISION);
pst.setString(5,SUB_DIVISION);
pst.setString(6,SECTION);
pst.setString(7,CONSUMER_NAME);
pst.setString(8,FATHER_NAME);
pst.setString(9,STREET_NAME);
pst.setString(10,DOOR_NO);
pst.setString(11,TOWN_CITY);
pst.setString(12,LAND_MARK);
pst.setInt(13,pin);
pst.setInt(14,std);
pst.setString(15,PHONE_NO);
pst.setString(16,EMAIL);
pst.setString(17,NEIGHBOUR_SCNO);
pst.setString(18,DOCUMENT_CODE);
pst.setString(19,LT_APR_NO);
pst.setString(20,date1);
pst.setString(21,PCBNO);
pst.setInt(22,status);
pst.setInt(23,social_group);
pst.setInt(24,supply );
pst.setInt(25,location);
pst.setInt(26,purpose);
pst.setInt(27,duration);
pst.setInt(28,laod_type);
pst.setFloat(29,conn_load );
pst.setInt(30,cont_load);
pst.setInt(31,app_fee);
pst.setInt(32,dev_chg);
pst.setInt(33,sec_dep);
pst.setInt(34,addl_sec_dep);
pst.setInt(35,dep_thru );
pst.setString(36,DD_CHEQUE_DETAILS);
pst.setString(37,date2);
pst.setString(38,REMARKS);
pst.setInt(39,1);
pst.setString(40,POLE_NO);
pst.executeUpdate();
result=reg_no;
rs.close();
rs=null;
rs1.close();
rs1=null;
rs2.close();
rs2=null;
rs3.close();
rs3=null;
st.close();
st=null;
pst.close();
pst=null;
catch(Exception e)
e.printStackTrace();
result="false";
return result;
finally
if (rs != null)
try
rs.close();
catch (SQLException e)
rs = null;
if (rs1 != null)
try
rs1.close();
catch (SQLException e)
rs1 = null;
if (rs2 != null)
try
rs2.close();
catch (SQLException e)
rs2 = null;
if (rs3 != null)
try
rs3.close();
catch (SQLException e)
rs3 = null;
if (st != null)
try
st.close();
catch (SQLException e)
st = null;
if (pst != null)
try
pst.close();
catch (SQLException e)
pst = null;
return result;
Also plz help me to improve the code if necessary so that it will work fine for multiple users
thaks & regards
Prasanth.CThanks a lot.
i replaced the code below
if (rs != null)
try
rs.close();
catch (SQLException e)
rs = null;
if (rs1 != null)
try
rs1.close();
catch (SQLException e)
rs1 = null;
if (rs2 != null)
try
rs2.close();
catch (SQLException e)
rs2 = null;
if (rs3 != null)
try
rs3.close();
catch (SQLException e)
rs3 = null;
if (st != null)
try
st.close();
catch (SQLException e)
st = null;
if (pst != null)
try
pst.close();
catch (SQLException e)
pst = null;
instead of blindly closing the resultsets and statements
now it works fine.
One more thing, is my code structurally correct, i mean the variables, try...catch blocks,results,statements,database connections and overall coding. whether it looks like professional code.
thaks & regards,
Prasanth.C -
Java.lang.NullPointerException in Message Monitoring-RWB
Hi Experts,
I am getting java.lang.NullPointerException in Message monitoring.Here is the detail trace of the error message.
Stack trace for the above error message is:
java.lang.NullPointerException
at com.sap.aii.mdt.util.SelectModel.getComponentLabel(SelectModel.java:192)
at jsp_monitor_new1226507446052._jspService(jsp_monitor_new1226507446052.java:174)
at com.sap.engine.services.servlets_jsp.server.jsp.JspBase.service(JspBase.java:112)
at com.sap.engine.services.servlets_jsp.server.servlet.JSPServlet.service(JSPServlet.java:544)
at com.sap.engine.services.servlets_jsp.server.servlet.JSPServlet.service(JSPServlet.java:186)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.runtime.RequestDispatcherImpl.doWork(RequestDispatcherImpl.java:321)
at com.sap.engine.services.servlets_jsp.server.runtime.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:377)
at com.sapportals.htmlb.page.PageProcessorServlet.handleRequest(PageProcessorServlet.java:68)
at com.sapportals.htmlb.page.PageProcessorServlet.doGet(PageProcessorServlet.java:29)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.runtime.RequestDispatcherImpl.doWork(RequestDispatcherImpl.java:321)
at com.sap.engine.services.servlets_jsp.server.runtime.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:427)
at com.sap.engine.services.servlets_jsp.server.runtime.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:358)
at com.sap.aii.rwb.web.messagemonitoring.viewcontroller.MmDynPage.doProcessBeforeOutput(MmDynPage.java:69)
at com.sapportals.htmlb.page.PageProcessor.handleRequest(PageProcessor.java:123)
at com.sapportals.htmlb.page.PageProcessorServlet.handleRequest(PageProcessorServlet.java:62)
at com.sapportals.htmlb.page.PageProcessorServlet.doGet(PageProcessorServlet.java:29)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.runtime.RequestDispatcherImpl.doWork(RequestDispatcherImpl.java:321)
at com.sap.engine.services.servlets_jsp.server.runtime.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:377)
at jsp_FC_Secure1226507436137._jspService(jsp_FC_Secure1226507436137.java:24)
at com.sap.engine.services.servlets_jsp.server.jsp.JspBase.service(JspBase.java:112)
at com.sap.engine.services.servlets_jsp.server.servlet.JSPServlet.service(JSPServlet.java:544)
at com.sap.engine.services.servlets_jsp.server.servlet.JSPServlet.service(JSPServlet.java:186)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
Wait...
Query being processed
Please help me how to resolve the issue.
Thanks,
Bharath.Hi Bharath,
Check SAP note no.1250954 for solution. It has the solution to the problem you are facing might be ralated to the SP levels you have, you need to installl some patch from this note.
Thanks! -
Problem about "Exception in thread "main" java.lang.NullPointerException"
This is t error message once i run the file
Exception in thread "main" java.lang.NullPointerException
at sendInterface.<init>(sendInterface.java:64)
at sendInterface.main(sendInterface.java:133)
* @(#)sendInterface.java
* @author
* @version 1.00 2008/7/18
import java.awt.BorderLayout;
import java.awt.Image;
import java.awt.GridLayout;
import java.awt.Panel;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.DefaultListModel;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JRadioButton;
import javax.swing.JScrollPane;
import javax.swing.ListModel;
import javax.swing.UIManager;
import javax.swing.SwingConstants;
import java.io.*;
import java.sql.*;
import java.net.*;
public class sendInterface /*implements ActionListener*/{
JFrame frame = new JFrame();
private Panel topPanel;
private Panel sendMessagePanel;
private Panel sendFilePanel;
private JLabel senderID;
private JLabel receiverID;
private JLabel senderDisplay;
private DefaultListModel receiverListModel = new DefaultListModel();
private JList receiverID_lst = new JList(receiverListModel);
private JRadioButton sendType;
String userName;
String[] userList = null ;
int i=0;
Connection con;
public sendInterface() {
String ListName;
try
JFrame.setDefaultLookAndFeelDecorated( true );
catch (Exception e)
System.err.println( "Look and feel not set." );
frame.setTitle( "Send Interface" );
topPanel.setLayout( new GridLayout( 2 , 1 ) ); //line 64*************************
senderID = new JLabel( "Sender:", SwingConstants.LEFT );
senderDisplay = new JLabel( "'+...+'", SwingConstants.LEFT );
receiverID = new JLabel( "Receiver:", SwingConstants.LEFT);
// receiverID_lst = new JList( ListName );
frame.add(senderID);
frame.add(senderDisplay);
frame.add(receiverID);
// frame.add(receiverListModel);
frame.add(new JScrollPane(receiverID_lst), BorderLayout.CENTER);
frame.setLocation(200, 200);
frame.setSize(250, 90);
frame.setVisible(true);
public void setListName(String user)
try{
userName = user;
Class.forName("com.mysql.jdbc.Driver");
String url = "jdbc:mysql://localhost:3306/thesis";
con = DriverManager.getConnection(url, "root", "");
Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
ResultSet rs = stmt.executeQuery("select * from user where User_ID!= '" + userName + "'");
System.out.println("Display all results:");
while(rs.next()){
String user_id = rs.getString("User_ID");
System.out.println("\tuser_id= " + user_id );
// receiverListModel.addElement(user_id);
userList=user_id;
i++;
}//end while loop
receiverListModel.addElement(userList);
catch(Exception ex)
ex.printStackTrace();
finally
if (con != null)
try
con.close ();
System.out.println ("Database connection terminated");
catch (Exception e) { /* ignore close errors */ }
public String getUserName()
return userName;
public String[] getUserList()
return userList;
public static void main(String[] args) {
new sendInterface(); //line 133******************************************
thank ur reply:D
Edited by: ocibala on Aug 3, 2008 9:54 AMAnd where do you instantiate topPanel before you invoke setLayout?
db
Maybe you are looking for
-
ITunes is getting my brother's 2nd generation iPod mixed up with mine!
I got a 1st Generation iPod Nano for Christmas last year. It has been working great, and I've experienced few problems. For Christmas this year, my brother got the 2nd Generation iPod Nano. We both have seprate iTunes libraries in our seprate account
-
Order blocked by user / Workflow error handling
Hi Folks, I am getting this requirement quite often. Time to address it in a more efficient way than that I know. The following is the requirement: Workitem goes to approver. If the approver approves/rejects the workitem, there is a subsequent change
-
The website is operated by the Australian Government. The instructions say the form will open in a separate Tab, using Adobe.
-
Hello could you please help me. The Menubar at the top of the screen does not display the Spotlight Icon, Accounts Icon, Volume and Time Info anymore and instead remains blank at the top right. I've gone into System Preferences and turned on the Data
-
Vertex integration with CRM 5.0 - Need Configuration document
Hi CRM Gurus I need to interface Vertex to SAP CRM 5.0. I am implementing E Commerce (B2B / B2C). We have R/3 - 4.7 and has Vertex. 1) Do i have to interface the Vertex with TTE for the tax determination in the web shop? (If yes, how to do this, need