Unreported exception java.lang.Exception; must be caught or declared

I've got a piece of code that's causing an error during compilation.
W:\Java\Covenant\src\covenant\Login.java:174: unreported exception java.lang.Exception; must be caught or declared to be thrownThe line of code it is refering to is:
new Overview().setVisible(true);And it is part of a try/catch statement:
    private void logincheck(java.awt.event.ActionEvent evt) {                           
        try {
            char[] PasswordInput = Password.getPassword();
            String PasswordRaw = new String(PasswordInput);
            String Passwordmd5 = md5(PasswordRaw);
            String UsernameInput = Username.getText();
            URL theUrl = new URL("http://www.phoenixrising.at/iris/validate.php?login=1&u=" + UsernameInput + "&p=" + Passwordmd5 +"");
            BufferedReader in = new BufferedReader(
                    new InputStreamReader(
                    theUrl.openStream()));
            String inputLine = in.readLine();
            if (inputLine.equals("valid")) {
                new Overview().setVisible(true);
                this.setVisible(false);
                System.out.println( "You have entered the correct password" );
            } else {
                System.out.println(theUrl);
            in.close();
        } catch (MalformedURLException ex) {
            ex.printStackTrace();
        } catch (IOException ex) {
            ex.printStackTrace();
    }      Can anyone see what might be causing this error?

Can anyone see what might be causing this error? That line of code declares that it throws exception java.lang.Exception, so you must either catch it ("must be caught" - like you do the more specific Exceptions) or declare your logincheck method to throw it ("or declared to be thrown").

Similar Messages

  • Unreported exception java.rmi.RemoteException; must be caught or declared t

    I am receiving an:
    unreported exception java.rmi.RemoteException; must be caught or declared to be thrown
    error when I attempt to compile the Client.java file.
    The Client.java file implements the ATMListener.java interface.
    As you will see below, I've stripped them down by taking out all of the code, yet I still receive this error.
    Any ideas...
    ATMListener.java
    import java.rmi.*;
    import java.rmi.server.UnicastRemoteObject;
    * @author Eddie Brodie
    * @version %I%, %G%
    public interface ATMListener extends java.rmi.Remote
    Client.java
    import java.net.MalformedURLException;
    import java.rmi.Naming;
    import java.rmi.NotBoundException;
    import java.rmi.RemoteException;
    import java.rmi.UnknownHostException;
    public class Client extends java.rmi.server.UnicastRemoteObject implements ATMListener

    Well first off unless I am missing something in the API java.rmi.Remote is an interface not a class so implements not inherits, but I do not really know these classes so I cannot be sure I am not missing something.
    As for the unreported exception. What could be causing something like this would be an exception thrown by the constructor of the parent class. Even if you have no constructor written for your class it still has a default constructor which will by default call the super constrcutpor meaning an exception could be thrown from the super constrcutor down to your default constructor where you would not know what to do with it.

  • Unreported exception; java.sql.SQLException; must be caught or declared to

    Hi everyone,
    For my Java course assignment we need to make a small application that uses a MS Access database. But de code below gives me a "Unreported exception; java.sql.SQLException; must be caught or declared to be thrown at line xx" error.
    public class ConnectieBeheer
      private static Connection con;
      private static Statement stmt;
      private static ResultSet res;
      private static ResultSetMetaData md;
      private ConnectieBeheer(){}
      public static void openDB() {
        Driver driver = new JdbcOdbcDriver();
        Properties info = new Properties();
        String url = "jdbc:odbc:theater";
        con = driver.connect(url, info);       <--- Error here
        if (con != null)
          stmt =  con.createStatement();      <--- Error here
          DatabaseMetaData dma = con.getMetaData();      <--- Error here
      }So I tried this :
    public static void openDB() throws SQLException {Now I do not get an error.
    The OpenDB method is called from a different class like this :
      public static void test1(){
        ConnectieBeheer.openDB();
        System.out.println("DB opened");
      }But now it gives the same "Unreported exception; java.sql.SQLException; must be caught or declared to be thrown at line xx" error but now at the line ConnectieBeheer.openDB();
    Why is this? And what can I do to correct this?
    Thanks!
    Steven.

    you should read the sun tutoriel about exceptions handling ;
    there are two ways to handle an exception : either you redirects it (using "throws" statement, what you did for the openDB method), or you catch it using a try { ... } catch (Exception exc) {}
    if you want to get rid of the error what you can do is :
      public static void test1(){
        try {
            ConnectieBeheer.openDB();
        } catch (java.sql.SQLException sqle) {
            sqle.printStackTrace();
        System.out.println("DB opened");
      }

  • Unreported exception java.sql.SQLException; must be caught or declared to b

    I dont know much about java Please help.
    I have created following class
    import java.sql.*;
    public class Updatedb{
         private String cofeename ;
         private int supid;
         public void getfields(String COFNAM , int SUP_ID){
              cofeename = COFNAM;
              supid = SUP_ID;
         public void indb()
         throws SQLException {
              Connection con = null;
    PreparedStatement pstmt = null;
         try {
         con = DriverManager.getConnection("jdbc:odbc:myDataSource");
         pstmt = con.prepareStatement(
    "UPDATE COFFEES SET SUP_ID = " + supid + "WHERE COF_NAME =" + cofeename );
    //pstmt.setInt(1, SUP_ID);
    //pstmt.setInt(2, COFNAM);
    pstmt.executeUpdate();
    finally {
    if (pstmt != null) pstmt.close();
    Now I am calling above class when button is clicked
    private void UPDATEActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_UPDATEActionPerformed
    // TODO add your handling code here:
    String input = INPUTFIELD.getText();
    Updatedb updateclass = new Updatedb();
    updateclass.getfields(input , 20);
    updateclass.indb( );
    INPUTFIELD.setText( "" );
    I am getting above error. Please help me to solve it.
    Thanks in advance

    A word of honest advice: If you don't understand much of Java, and specifically, if you don't understand how checked exceptions work, you're in over your head looking at JDBC. Step away from it for now, and learn the basics a bit better. Seriously, if you soldier on this way, you'll never really understand what you're doing

  • (error code = 200; message="Java error"; exception = [java.lang.Exception])

    Hi, I have several times tried to install ABAP Trial, but failed.
    So I need your help.
    As soon as I set up XP, I download and install the newest Java, then started installation of ABAP Trial.
    But at the end I just get an error message as belows.
    I hope you will guide me correct direction.
    Thanks for reading & Have a good day!
    (Jul 11, 2008 7:38:06 AM), Install, com.sap.installshield.sdcstepswrapper.StepWrapperInstallFiles, err, An error occurred and product installation failed.  Look at the log file C:\SAP\NSP\log.txt for details.
    (Jul 11, 2008 7:38:06 AM), Install, com.sap.installshield.sdcstepswrapper.StepWrapperInstallFiles, err, ProductException: (error code = 200; message="Java error"; exception = [java.lang.Exception])
    STACK_TRACE: 15
    ProductException: (error code = 200; message="Java error"; exception = [java.lang.Exception])
         at com.sap.installshield.sdcstepswrapper.StepWrapperInstallFiles.execute(StepWrapperInstallFiles.java:254)
         at com.sap.installshield.sdcstepswrapper.StepWrapperInstallFiles.executeAllSteps(StepWrapperInstallFiles.java:224)
         at com.sap.installshield.sdcstepswrapper.StepWrapperInstallFiles.executeAllInstallationSteps(StepWrapperInstallFiles.java:177)
         at com.sap.installshield.sdcstepswrapper.StepWrapperInstallFiles.install(StepWrapperInstallFiles.java:268)
         at com.installshield.product.service.product.PureJavaProductServiceImpl.installProductAction(Unknown Source)
         at com.installshield.product.service.product.PureJavaProductServiceImpl$InstallProduct.getResultForProductAction(Unknown Source)
         at com.installshield.product.service.product.InstallableObjectVisitor.visitComponent(Unknown Source)
         at com.installshield.product.service.product.InstallableObjectVisitor.visitInstallableComponents(Unknown Source)
         at com.installshield.product.service.product.InstallableObjectVisitor.visitProductBeans(Unknown Source)
         at com.installshield.product.service.product.PureJavaProductServiceImpl$InstallProduct.install(Unknown Source)
         at com.installshield.product.service.product.PureJavaProductServiceImpl$Installer.execute(Unknown Source)
         at com.installshield.wizard.service.AsynchronousOperation.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    (Jul 11, 2008 7:43:08 AM), Install, com.installshield.product.service.product.PureJavaProductServiceImpl$InstallProduct, err, An error occurred and product uninstallation failed.  Look at the log file C:\SAP\NSP\log.txt for details.
    (Jul 11, 2008 7:43:08 AM), Install, com.sap.installshield.sdcstepswrapper.StepWrapperInstallFiles, err, ProductException: (error code = 200; message="Java error"; exception = [java.lang.Exception])
    STACK_TRACE: 15
    ProductException: (error code = 200; message="Java error"; exception = [java.lang.Exception])
         at com.sap.installshield.sdcstepswrapper.StepWrapperInstallFiles.execute(StepWrapperInstallFiles.java:254)
         at com.sap.installshield.sdcstepswrapper.StepWrapperInstallFiles.executeAllSteps(StepWrapperInstallFiles.java:224)
         at com.sap.installshield.sdcstepswrapper.StepWrapperInstallFiles.executeAllUninstallationSteps(StepWrapperInstallFiles.java:192)
         at com.sap.installshield.sdcstepswrapper.StepWrapperInstallFiles.uninstall(StepWrapperInstallFiles.java:313)
         at com.installshield.product.service.product.PureJavaProductServiceImpl.uninstallProductAction(Unknown Source)
         at com.installshield.product.service.product.PureJavaProductServiceImpl$InstallProduct.processActionsFailed(Unknown Source)
         at com.installshield.product.service.product.InstallableObjectVisitor.visitComponent(Unknown Source)
         at com.installshield.product.service.product.InstallableObjectVisitor.visitInstallableComponents(Unknown Source)
         at com.installshield.product.service.product.InstallableObjectVisitor.visitProductBeans(Unknown Source)
         at com.installshield.product.service.product.PureJavaProductServiceImpl$InstallProduct.install(Unknown Source)
         at com.installshield.product.service.product.PureJavaProductServiceImpl$Installer.execute(Unknown Source)
         at com.installshield.wizard.service.AsynchronousOperation.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)

    Hi YUN SEOK,
    I got the same error than you when I tried to install SAP NetWeaver ABAP Trial Version. 
    Could you help me in giving exactly the link you wrote.
    https://www.sdn.sap.com/irj
    Where is located exactly the answer ?
    I looked at this link but I did not find the answer.
    So could you give me exactly the location in this link ?
    Thanks in advance.
    STD,

  • Error: java.sql.SQLException; must be caught or declared to be thrown.

    in a servlet, I have a class like:
    class mydb
    public static Connection conn;
    public static void init() throws SQLException
    // Load the Oracle JDBC driver
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    conn = DriverManager.getConnection ("jdbc:oracle:oci8:@baby", "scott", "tiger");
    public static String getValue() throws SQLException
    String curValue="";
    // Create a Statement
    Statement stmt = conn.createStatement ();
    // Select the ENAME column from the EMP table
    ResultSet rset = stmt.executeQuery ("select ENAME from EMP");
    // Iterate through the result and print the employee names
    if (rset.next ())
    curValue = rset.getString (1);
    // Close the RseultSet
    rset.close();
    // Close the Statement
    stmt.close();
    return(curValue);
    public static void destroy() throws SQLException
    // Close the connection
    conn.close();
    but when it is called, errors "java.sql.SQLException; must be caught or declared to be thrown." encountered, how to solve this problem? please help.

    This is part of the Java language.
    If a method throws an exception, then
    it is telling you that the exception is
    something that you should be aware of.
    If you call a method which throws this exception, then the method must either catch this exception, or you may decide that this exception should be caught by the calling method.
    So, your choices are:
    1. Wrap the method call in a try{...} catch block
    -or-
    2. Change the (calling) method's signature to reflect the fact that this method can cause this exception to be thrown (add a 'throws SQLException' ) at end of signature.
    -John
    null

  • Mailing attachments; java.io.IOException; must be caught or declared to be

    I seem to be having trouble setting up to attach a file and I'm getting the error message
    java.io.IOException; must be caught or declared to be
    //other related code
        String bookingFilename = "what ever filename";
    // create some properties and get the default Session
         Properties props = new Properties();
         props.put("mail.smtp.host", host);
         Session session = Session.getInstance(props, null);
         //session.setDebug(debug);
         try {
             // create a message
             MimeMessage msg = new MimeMessage(session);
             msg.setFrom(new InternetAddress(from));
             InternetAddress[] address = {new InternetAddress(to)};
             msg.setRecipients(Message.RecipientType.TO, address);
             msg.setSubject(subject);
             msg.setSentDate(new Date());
             // create and fill the first message part
             MimeBodyPart mbp1 = new MimeBodyPart();
             mbp1.setText(msgText1);
             // create and fill the second message part
             MimeBodyPart mbp2 = new MimeBodyPart();
                //PROBLEM LINE
                mbp2.setFilename(bookingFilename);
             // create the Multipart and its parts to it
             Multipart mp = new MimeMultipart();
             mp.addBodyPart(mbp1);
             mp.addBodyPart(mbp2);
             // add the Multipart to the message
             msg.setContent(mp);
             // send the message
             Transport.send(msg);
         } catch (MessagingException mex) {
             mex.printStackTrace();
             Exception ex = null;
             if ((ex = mex.getNextException()) != null) {
              ex.printStackTrace();the following is the problem code
    mbp2.setFilename(bookingFilename);am I putting the filename in the wrong format?
    I'm hoping to specify the exact filename using "if" statements so the current
    String bookingFilename = "what ever filename";is just a placeholder
    I'd be very grateful for any assitance
    eventually I intend to email out 3 seperate attachments at the same time,
    from a bank of about 10 files which are either pdf's or word doc's
    Dioxin

    Lets not go into my lack of Java training just yet :-P
         } catch (IOException ioex) {
             ioex.printStackTrace();was the block I was missing
    I'd also miswritten the problem code...cos I'd been fiddling with other commands
    mbp2.attachFile(bookingFilename);well it appears to compile... now to fire off a test email!
    cheers
    Dioxin

  • RecoverJob (Default Recover Job) failed.(Exception:java.lang.Exception

    Hello,
    I have received oft  bellow error recently :
    Failed to execute recover job. Reason: java.lang.Exception: Failed to restart message ef61dd40-01cd-4356-042a-e2a3598e51be(OUTBOUND) remotely on cluster node 759942581. Reason: com.sap.engine.messaging.runtime.ClusterException: Could not trigger cluster event RESEND_MESSAGE for node 759942581. Reason: com.sap.engine.frame.cluster.message.RemoteClusterException: Service "com.sap.aii.af.ms.svc" on cluster element 759,942,581 thrown an exception in receiveWait(), invoked by a request by cluster element 737,640,831.
    I checked  this message id (ef61dd4001cd4356042ae2a3598e51) in SXMB_MONI. It is not failed. And interface to belong with this message id  has daily automatically  adapter (it is configured in advance time planning in CCM)
    Can you help me please?
    Nurhan

    Did you get answer to this? what was the problem?
    We are having the same problem and it looks like the messages have got stuck up on the node which we have taken down. How did you recover those messages?
    For us we have to restart the node but we dont want to do that because there are resource problems and creating more failures.

  • Unreported Exception java.lang.InstantiationException

    Dear Friends,
    I am developing javabean connectivty for inserting records to mysql database from jsp. when i try to compile java bean program. It gives an error like unreported Exception java.lang.InstantiationException: Must be caught or declared to be thrown*. This is my mode. Please anyone help to solve this error. if you find any error in my code, please suggest me. Thanks in advance.
    package com.webdeveloper.servlets;
    import java.sql.*;
    import java.io.*;
    public class InsertBean {
    private String dbURL = "jdbc:mysql://localhost:3306/test";
    private Connection dbCon;
    private Statement st;
    String dbuser = "root";
    String dbpass = "admin";
    String Name = null;
    String Address = null;
    String Zip = null;
    public InsertBean() {
    super();
    public String getName() {
    return this.Name;
    public String getAddress() {
    return this.Address;
    public String getZip() {
    return this.Zip;
    public void setName(String pname) {
    this.Name = pname;
    public void setAddress(String paddress) {
    this.Address = paddress;
    public void setZip(String pzip) {
    this.Zip = pzip;
    public void doInsert() throws ClassNotFoundException, SQLException {
    Class.forName("com.mysql.jdbc.Driver").newInstance();//it gives error in this line
    dbCon = DriverManager.getConnection(dbURL,dbuser,dbpass);
    Statement s = dbCon.createStatement();
    String sql = "Insert into Person values ('" + this.Name;
    sql = sql + "', '" + this.Address + "', " + this.Zip;
    sql = sql + ")";
    int insertResult = s.executeUpdate(sql);
    dbCon.close();
    }

    Dear BalusC,
    Thanks for your suggestion. I used try catch block also. But it still gives same error. I have modified my following code. Is there any thing wrong in my code? Please give me your suggestion. Thankyou.
    // Java Document
    package com.webdeveloper.servlets;
    import java.sql.*;
    import java.io.*;
    public class InsertBean {
    private String dbURL = "jdbc:mysql://localhost:3306/test";
    private Connection dbCon;
    private Statement st;
    String dbuser = "root";
    String dbpass = "admin";
    String Name = null;
    String Address = null;
    String Zip = null;
    public InsertBean() {
    super();
    public String getName() {
    return this.Name;
    public String getAddress() {
    return this.Address;
    public String getZip() {
    return this.Zip;
    public void setName(String pname) {
    this.Name = pname;
    public void setAddress(String paddress) {
    this.Address = paddress;
    public void setZip(String pzip) {
    this.Zip = pzip;
    public void doInsert() throws ClassNotFoundException, SQLException {
         try{
         Class.forName("com.mysql.jdbc.Driver").newInstance();
    dbCon = DriverManager.getConnection(dbURL,dbuser,dbpass);
    Statement s = dbCon.createStatement();
    String sql = "Insert into Person values ('" + this.Name;
    sql = sql + "', '" + this.Address + "', " + this.Zip;
    sql = sql + ")";
    int insertResult = s.executeUpdate(sql);
         catch(Exception e){
         System.out.println("error occured :" + e);
         dbCon.close();
    }

  • Must be caught or declared to be thrown...

    how would i go about something like that?
    import java.util.*;
    public class GameLauncher{
    public static void main( String [] args) {
         SellGame game = new SellGame();
              game.startGame();
    ____________________________________________________________________

    how would i go about something like that?I am guessing that your program will not compile... something like this:
    % cat HelloWorld.java
    public class HelloWorld {
        public static void main(String args[]) {
            System.out.println("Hello, world!");
            java.lang.Thread.sleep(500);
    % javac -g HelloWorld.java
    HelloWorld.java:5: unreported exception java.lang.InterruptedException; must be caught or declared to be thrown
            java.lang.Thread.sleep(500);
                                  ^
    1 errorRefer to this section of the Tutorial for an explanation:
    Exception Handling Statements
    http://java.sun.com/docs/books/tutorial/java/nutsandbolts/exception.html
    Hope this helps.
    "Troubleshooting Guide for J2SE 5.0",
    http://java.sun.com/j2se/1.5/pdf/jdk50_ts_guide.pdf

  • My function must be caught or declared to be thrown?

    hi again.
    so here's what's going on.
    i'm writing a class that contains a function that will be used as a part of a program. only one parameter will be passed, in this case, BAC.
    to test my program, i'm trying to write a simple main function to call the class. here's what it looks like:
    public static void main(String[] args) {
    String BAC = "teststring";
    findbac bac = new findbac();
    bac.findbac(BAC);
    the function i'm trying to call is findbac(String BAC) in class findbac.
    when i compile, i get the error message
    29: unreported exception java.io.IOException; must be caught or declared to be thrown
    bac.findbac(BAC);
    i just started java a few days ago so im not 100% familiar with the throw and catch terms.
    what should i do to make this work? thanks.

    thanks a bunch for the help. still a little confusing, but im gonna sit down and figure it all out tonight after i get home.
    and i tried putting in the code Valavet suggested, and it compiles now! but when i run it, i get a new error:
    java.lang.ArrayIndexOutOfBoundsException: 2
    at findit.findbac.findbac(findbac.java:108)
    at findit.findbackclass.main(findbackclass.java:37)
    Exception in thread "main"
    Java Result: 1
    the two lines of code are
    experiments[experimentnumber-1] = dataline.substring(beginningIndex, endIndex);
    and
    bac.findbac(BAC);
    respectively.
    what do they mean by array index out of bounds? i know my array index is correct.
    do {            //this do-while loop writes each experiment's result (as a string) to the experiments[] matrix.
                                    foundIndex = dataline.indexOf(comma, fromIndex);
                                    if (foundIndex >= 0) {
                                        experimentnumber++;
                                        fromIndex = foundIndex + 1;
                                    endIndex = fromIndex;
                                    if (experimentnumber >= 1){
                                        experiments[experimentnumber-1] = dataline.substring(beginningIndex, endIndex);
                                    beginningIndex = fromIndex;
                                } while (foundIndex >= 0);

  • Conn.rollback() must be caught or declared to be thrown

    Hi, I'm having problems compiling the following code
    private void toInsert(String insert_foo, int insert_bar) {
              InitialContext context = null;
              Connection conn = null;
              PreparedStatement pstmt= null;     
              try {
                   context = new InitialContext();
                   DataSource ds = (DataSource) context.lookup("java:comp/env/jdbc/TestDB");
                   conn = ds.getConnection();
                   conn.setAutoCommit(false);
                   pstmt = conn.prepareStatement("INSERT into testdata values(?, ?)");
                   pstmt.setString(1, insert_foo);
                   pstmt.setInt(2, insert_bar);
                   pstmt.executeUpdate();
                   conn.commit();
                   conn.setAutoCommit(true);
                   pstmt.close();
                   pstmt = null;
                   conn.close();
                   conn = null;
                   context.close();
                   context = null;
              catch (Exception e) {
                   conn.rollback();
              finally {
                   if (pstmt != null) {
                        try { pstmt.close(); }          
                        catch (SQLException e) {;}     
                        pstmt = null;               
                   if (conn != null) {
                        try { conn.close(); }          
                        catch (SQLException e) {;}     
                        conn = null;               
                   if (context != null) {
                        try { context.close(); }     
                        catch (NamingException e) {;}     
                        context = null;               
         }I got this error when I try to compile the above;
    unreported exception java.sql.SQLException; must be caught or declared to be thrown
    conn.rollback();
    I search and read through a lot of posts here that rollback() could be used in the catch block but why I can't I compile it?
    Please help me out, thank you.
    puzzled....

    Is it similiar to factory methods? No.
    I've read up on this:
    http://www.javaworld.com/javaworld/javaqa/2001-05/02-qa-0511-factory.html?
    "small boy with a pattern" syndrome strikes again.
    Could you assist to help me in giving me guidelines
    for writing the database utilites class?
    Appreciated...
    public final class DatabaseUtils
        public static void close(Connection c)
            if (c != null)
                try
                    c.close();
                catch (SQLException e)
                      // print stack trace or, better yet, log the exception with Log4J
        // same for other close operations on ResultSet and Statement
        public void rollback(Connection c)
            if (c != null)
                try
                    c.rollback();
                catch (SQLException e)
                      // print stack trace or, better yet, log the exception with Log4J
    }%

  • Java.lang.Exception problem .. help needed

    I have a class and i am trying to access a method of another class that is reading an object.
    public void read(String filename) throws Exception {
    String fn = filename;
    ObjectInputStream out = null;
    Object object = null;
    try {
    FileInputStream file = new FileInputStream(fn);
    out = new ObjectInputStream(file);
    object = out.readObject();
    out.close();
    } catch (java.io.IOException IOE) {
    if (out != null)
    try {
    out.close();
    } catch (Exception ex) {}
    throw IOE;
    When i am compiling the program it is giving me this error
    unreported exception java.lang.Exception; must be caught or declared to be thrown
    I'm quite new to java ... could you tell me how to catch this exception
    its in this part
    scoreTable.read("scores.txt");
    Thanks

    Try this :
        private void someMethod(){
            try{
                read("c:\\bank\\testobject.txt");
            }catch(IOException ex){
                ex.printStackTrace();
            }catch(ClassNotFoundException ex){
                ex.printStackTrace();
    //        you can use the object here
        Object object;
        public void read(final String filename)  throws IOException, ClassNotFoundException{
            ObjectInputStream out = null;
            object = null;
            try{
                out = new ObjectInputStream(new FileInputStream(filename));
                object = out.readObject();
            }finally{
                if( out != null ){
                    out.close();
        }

  • Java.lang.Exception: User : principals=[admin] is not allowed to shutdown the server

    Hi,
    When i shut down my managed and admin servers through the console i am getting
    the following exception.Any one have an idea on this?
    Exception :
    java.lang.Exception: User : principals=[admin] is not allowed to shutdown the
    server.
         at weblogic.server.ServerLifeCycleRuntime.shutdown(ServerLifeCycleRuntime.java:299)
         at java.lang.reflect.Method.invoke(Native Method)
         at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl.java:750)
         at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:732)
         at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1557)
         at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1525)
         at weblogic.management.internal.RemoteMBeanServerImpl.invoke(RemoteMBeanServerImpl.java:928)
         at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:472)
         at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:200)
         at $Proxy105.shutdown(Unknown Source)
         at java.lang.reflect.Method.invoke(Native Method)
         at weblogic.management.console.actions.mbean.DoMBeanOperationAction.performOnSingle(DoMBeanOperationAction.java:206)
         at weblogic.management.console.actions.mbean.DoMBeanOperationAction.perform(DoMBeanOperationAction.java:188)
         at weblogic.management.console.actions.internal.ActionServlet.doAction(ActionServlet.java:171)
         at weblogic.management.console.actions.internal.ActionServlet.doPost(ActionServlet.java:85)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1075)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:418)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:306)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:5517)
         at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:685)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3156)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2506)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:234)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:210)

    I have the exact same problem. It is for a WLI 7.0 SP-5 domain. I started admin and managed servers using the startWeblogic and startManagedWebLogic scripts, but trying to stop them from the console is throwing this exception:
    java.lang.Exception: User : principals=[admin] is not allowed to shutdown the server.
         at weblogic.server.ServerLifeCycleRuntime.shutdown(ServerLifeCycleRuntime.java:299)
         at java.lang.reflect.Method.invoke(Native Method)
         at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl.java:736)
         at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:718)
         at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1557)
         at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1525)
         at weblogic.management.internal.RemoteMBeanServerImpl.invoke(RemoteMBeanServerImpl.java:1107)
         at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:472)
         at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:200)
         at $Proxy105.shutdown(Unknown Source)
         at java.lang.reflect.Method.invoke(Native Method)
         at weblogic.management.console.actions.mbean.DoMBeanOperationAction.performOnSingle(DoMBeanOperationAction.java:206)
         at weblogic.management.console.actions.mbean.DoMBeanOperationAction.perform(DoMBeanOperationAction.java:188)
         at weblogic.management.console.actions.internal.ActionServlet.doAction(ActionServlet.java:171)
         at weblogic.management.console.actions.internal.ActionServlet.doPost(ActionServlet.java:85)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1094)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:437)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:319)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:5626)
         at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:685)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3213)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2555)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:251)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:219)
    I upgraded from WLI7.0 SP-1 to SP-5, and since then I am getting this error.
    Please help!

  • Java.lang.Exception: Couldn't find a matching Java operation for WSDD

    Hi all,
    i used Eclipse to create a web service. actually i created a class with the following code:public class Add2Num {
         public int Add2Numbers(int x,int y)
              return x+y;
    }then i tried to generate wsdl file for this class, after i generate the wsdl file, i tried to run it but the following exception appear:
    org.apache.axis.InternalException <init>
    SEVERE: Exception:
    java.lang.Exception: Couldn't find a matching Java operation for WSDD operation "add2Numbers" (2 args)
         at org.apache.axis.InternalException.<init>(InternalException.java:71)
         at org.apache.axis.description.JavaServiceDesc.loadServiceDescByIntrospection(JavaServiceDesc.java:891)
         at org.apache.axis.providers.java.JavaProvider.initServiceDesc(JavaProvider.java:477)
         at org.apache.axis.handlers.soap.SOAPService.getInitializedServiceDesc(SOAPService.java:285)
         at org.apache.axis.deployment.wsdd.WSDDService.makeNewInstance(WSDDService.java:500)
         at org.apache.axis.deployment.wsdd.WSDDDeployableItem.getNewInstance(WSDDDeployableItem.java:274)
         at org.apache.axis.deployment.wsdd.WSDDDeployableItem.getInstance(WSDDDeployableItem.java:260)
         at org.apache.axis.deployment.wsdd.WSDDDeployment.getService(WSDDDeployment.java:427)
         at org.apache.axis.configuration.FileProvider.getService(FileProvider.java:231)
         at org.apache.axis.AxisEngine.getService(AxisEngine.java:311)
         at org.apache.axis.MessageContext.setTargetService(MessageContext.java:755)
         at org.apache.axis.handlers.http.URLMapper.invoke(URLMapper.java:50)
         at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
         at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
         at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
         at org.apache.axis.server.AxisServer.invoke(AxisServer.java:239)
         at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
         at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
         at java.lang.Thread.run(Thread.java:595)

    The cause is case mismatch.
         Your method signature : public int Add2Numbers(int x,int y) --- Upper Case
    But the signature produced is
    ouldn't find a matching Java operation for WSDD operation "add2Numbers" (2 args)
    ( from the error trace ) -- Lower case.
         Change the case of your method to add2number (lowercase ) as per conventions and you code will work.
    Rgdz,
    Saroj Kumar

Maybe you are looking for

  • Insert SQL does not work properly when called using CALL

    I have a stored procedure (TEST_SP) which is used to insert a record in this perticular case. The SQL statement is 2526 characters long. I'm using dim Params : Params=chr(1) & "Insert query" & Chr(1) & "=300" runsql=&"{call TEST_SP(?,?)}"&Params  dim

  • Error while saving as draft the outgoing payment

    Hi All, My client is getting an error message "This entry already exists in payment draft OPDF (ODBC)" while saving as draft the outgoing payment. Please advice any solution. Regards, Siddiq

  • InDesign CS6 on Mac and Websense

    Hi there. We have Websense Endpoint deployed but Macs using InDesign, loading the Websense Endpoint client causes InDesign to crash on opening. We have raised this with Websense but have not got a satisfactory solution (in over a month) but I wondere

  • Adhoc Query data not getting displayed on Portal

    Hi, I have a problem with custom Adhoc query data not getting displayed on the portal. It was getting displayed initially but after a user made some changes to the query its not getting displayed. The query is displaying data perfectly on R/3 but on

  • Apex_util.get_print_document with bind

    All, I'm trying to create a process to bulk print a report to the file system using the API apex_util.get_print_document. Is there a way to pass bind variables to the report query when using this API? If not, has anyone come up w/another solution on