IO exception when encrypting

hi guys,
i am trying to convert an image to a byte[] and then encypt. i have been able to convert to a byte array and have been able to get the private key to be encoded with base64 and output to the file. the problem is that when i run the program i get the following error.
Exception: java.io.IOException: closed
at javax.imageio.stream.ImageInputStreamImpl.checkClosed(ImageInputStreamImpl.java:90)
at javax.imageio.stream.FileImageInputStream.read(FileImageInputStream.java:85)
at javax.imageio.stream.ImageInputStreamImpl.read(ImageInputStreamImpl.java:135)
at Security.imageConvert(Security.java:37)
at Security.main(Security.java:147)
Please see the code below, any help would be great!
C4rter
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.PrintStream;
import javax.imageio.stream.FileImageInputStream;
import java.security.*;
import java.io.*;
import javax.crypto.*;
import sun.misc.*;
import java.lang.*;
public class Security{
public static void imageConvert( ) throws Exception {
try{
System.out.println("please select the file to encrypt");
BufferedReader fileInput = new BufferedReader(new InputStreamReader(System.in));
String filetoread = null;
filetoread = fileInput.readLine();
System.out.println("please select the file to save to");
BufferedReader fileOutput = new BufferedReader(new InputStreamReader(System.in));
String filetostore = null;
filetostore = fileOutput.readLine();
    FileImageInputStream input = new FileImageInputStream(new File(filetoread));
ByteArrayOutputStream output = new ByteArrayOutputStream();
PrintStream stream = new PrintStream(output);
byte[] buffer = new byte[1024];
byte[] data = null;
int numberBytesRead = 0;
while ((numberBytesRead = input.read(buffer)) != -1)
output.write(buffer, 0, numberBytesRead);
System.out.println("going to encrypt");
encrypt(buffer);
System.out.println("back to imageconvert");
FileOutputStream imageOut = new FileOutputStream(new File(filetostore));
System.out.println("sent to file");
output.close();
input.close();
} catch(Exception ex) {
System.out.println("Exception: " + ex);
ex.printStackTrace();
//public byte[] byteConvert(){}
public static byte[] encrypt(byte[] imageBytes) throws Exception {
System.out.println("in encrypt");
Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding");
PublicKey pubk = keyGenerator();
System.out.println("read out" + pubk);
cipher.init(Cipher.ENCRYPT_MODE, pubk);
byte[] encrypted = new byte[imageBytes.length];
System.out.println("Imagebyte length: " + imageBytes.length);
byte[] temp = new byte[53];
byte[] temp2 = null;
int x, y, z = 0;
int repeats = imageBytes.length/53;
System.out.println("Iterations: " + repeats);
for (z=0; z<repeats; z++) {
System.out.println("Iteration number: " + z);
int offset = z*53;
for (x=0; x<53; x++) {
temp[x] = (byte) imageBytes[offset+x];
temp2 = cipher.doFinal(temp);
for (y=0; y<53; y++) {
encrypted[offset+y] = (byte) temp2[y];
temp2 = null;
return encrypted;
//return cipher.doFinal(imageBytes);
public void decrypt(){}
public static PublicKey keyGenerator()throws Exception {
//try{
KeyPairGenerator keyGen = KeyPairGenerator.getInstance("rsa");
keyGen.initialize(512);
KeyPair KeyPair = keyGen.generateKeyPair();
PublicKey pubk = KeyPair.getPublic();
PrivateKey prvk = KeyPair.getPrivate();
saveprvKey(prvk);
//} catch(Exception ex) {
//System.out.println("Exception: " + ex);
//ex.printStackTrace();
return pubk;
private static void saveprvKey(PrivateKey prvky)throws Exception {
byte[] byteSeed = prvky.getEncoded();
BASE64Encoder encoder = new BASE64Encoder();
String seed = encoder.encodeBuffer(byteSeed);
FileWriter fw = new FileWriter("c:/privkey.txt");
fw.write(seed);
fw.close();
public static void main (String[] unused) throws Exception {
System.out.println("***********************************************");
System.out.println("***    Biometric Encrytion Program          ***");
System.out.println("***********************************************");
System.out.println("Please select a process");
System.out.println("e for encryption ");
System.out.println("d for decrytion");
boolean choose = false;
BufferedReader userInput = new BufferedReader(new InputStreamReader(System.in));
String choice = null;
choice = userInput.readLine();
if (choose = choice.equals("e")){
imageConvert();
System.out.println("Encryption");
else
System.out.println("Decryption");
//byteConvert();
}

hi sabre,
After going against what you said, i tried to get the RSA to work with encryption and decryption.
i have now seen the light and the error of my ways, i was wondering if you could give a brief explanation of the hybrid approach that you mentioned. and how easy would it be to doctor my code to allow for this,
Also would you recomend AES or DES for the Symmetric encryption?
cheers
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.security.interfaces.RSAPrivateKey;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.RSAPrivateKeySpec;
import javax.crypto.spec.SecretKeySpec;
import javax.imageio.stream.FileImageInputStream;
import java.security.*;
import java.io.*;
import javax.crypto.*;
import sun.misc.*;
import java.lang.*;
public class Security{
public static void imageConvert( ) throws Exception {
try{
System.out.println("please select the file to encrypt");
BufferedReader fileInput = new BufferedReader(new InputStreamReader(System.in));
String filetoread = null;
filetoread = fileInput.readLine();
System.out.println("please select the file to save to");
BufferedReader fileOutput = new BufferedReader(new InputStreamReader(System.in));
String filetostore = null;
filetostore = fileOutput.readLine();
FileImageInputStream input = new FileImageInputStream(new File(filetoread));
ByteArrayOutputStream output = new ByteArrayOutputStream();
PrintStream stream = new PrintStream(output);
byte[] buffer = new byte[1024];
byte[] data = null;
int numberBytesRead = 0;
while ((numberBytesRead = input.read(buffer)) != -1)
output.write(buffer, 0, numberBytesRead);
data = output.toByteArray();
System.out.println("encrytped" + buffer);
System.out.println("going to encrypt");
byte[] imageOutput = encrypt(data);
System.out.println("back to imageconvert");
System.out.println("encrytped" + buffer);
FileOutputStream imageOut = new FileOutputStream(new File(filetostore));
imageOut.write(imageOutput,0,imageOutput.length);
imageOut.close();
BASE64Encoder encoder = new BASE64Encoder();
String enc = encoder.encodeBuffer(imageOutput);
FileWriter fw = new FileWriter(filetostore);
fw.write(enc);
fw.close();
System.out.println("sent to file");
output.close();
input.close();
} catch(Exception ex) {
System.out.println("Exception: " + ex);
ex.printStackTrace();
public static void byteConvert()throws Exception{
    try{
System.out.println("please select the file to decrypt");
BufferedReader fileInput = new BufferedReader(new InputStreamReader(System.in));
String filetoread = null;
filetoread = fileInput.readLine();
FileInputStream fis = new FileInputStream(filetoread);
byte[] decrypt = new byte[fis.available()];
fis.read(decrypt);
fis.close();
String dec = new String(decrypt);
BASE64Decoder decoder = new BASE64Decoder();
byte[] byteSeed = decoder.decodeBuffer(dec);
// FileInputStream input = new FileInputStream(new File(filetoread));
// ByteArrayOutputStream inStream = new ByteArrayOutputStream();
// PrintStream stream = new PrintStream(inStream);
// PrintStream stream = new PrintStream(input);
// BASE64Decoder decoder = new BASE64Decoder();
// String dec = decoder.decodeBuffer(stream);
// String dec = new String(stream);
// byte[] decryptionBytes = inStream;
// byte[] s = decrypt(dec);
// decryptionBytes =(byte [])stream.readStream();
// stream.close();
// for(int i=0; i < decryptionBytes.length; i++)
    // System.out.print(decryptionBytes);
byte[] imageOutput = decrypt(byteSeed);
//byte[] imageOutput = decrypt(decrypt);
    }catch(Exception ex) {
System.out.println("Exception: " + ex);
ex.printStackTrace();
public static byte[] encrypt(byte[] imageBytes) throws Exception {
System.out.println("in encrypt");
Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding");
PublicKey pubk = keyGenerator();
System.out.println("read out" + pubk);
cipher.init(Cipher.ENCRYPT_MODE, pubk);
byte[] encrypted = new byte[imageBytes.length];
System.out.println("Imagebyte length: " + imageBytes.length);
byte[] temp = new byte[53];
byte[] temp2 = null;
int x, y, z = 0;
int repeats = imageBytes.length/53;
System.out.println("Iterations: " + repeats);
for (z=0; z<repeats; z++) {
System.out.println("Iteration number: " + z);
int offset = z*53;
for (x=0; x<53; x++) {
temp[x] = (byte) imageBytes[offset+x];
temp2 = cipher.doFinal(temp);
for (y=0; y<53; y++) {
encrypted[offset+y] = (byte) temp2[y];
temp2 = null;
return encrypted;
//return cipher.doFinal(imageBytes);
public static byte[] decrypt(byte[] bytesIn) throws Exception{
System.out.println("in decrypt");
Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding");
PrivateKey prvk = loadPrvkey();
System.out.println("read out" + prvk);
cipher.init(Cipher.DECRYPT_MODE, prvk);
//byte[] decodeData= cipher.doFinal(bytesIn);
byte[] decrypted = new byte[bytesIn.length];
System.out.println("Imagebyte length: " + bytesIn.length);
byte[] temp = new byte[64];
byte[] temp2 = null;
int x, y, z = 0;
int repeats = bytesIn.length/64;
System.out.println("Iterations: " + repeats);
cipher.update(decrypted);
for (z=0; z<repeats; z++) {
cipher.update(decrypted);
System.out.println("Iteration number: " + z);
int offset = z*64;
cipher.update(decrypted);     
for (x=0; x<64; x++) {
temp[x] = (byte) bytesIn[offset+x];
//cipher.update(temp);
temp2 = cipher.doFinal(temp);
for (y=0; y<64; y++) {
decrypted[offset+y] = (byte) temp2[y];
temp2 = null;
return decrypted;
//return decodeData;
/*the keyGenerator method is the method that is used to create the private and
*publickeys that are used for the encryption and decryption.
public static PublicKey keyGenerator()throws Exception {
//try{
KeyPairGenerator keyGen = KeyPairGenerator.getInstance("rsa");
keyGen.initialize(512);
KeyPair KeyPair = keyGen.generateKeyPair();
PublicKey pubk = KeyPair.getPublic();
PrivateKey prvk = KeyPair.getPrivate();
System.out.println("privatekey" + prvk);
saveprvKey(prvk);
//} catch(Exception ex) {
//System.out.println("Exception: " + ex);
//ex.printStackTrace();
return pubk;
/*The saveprvKey method is used to save the private key to the system. the encoded
*privatekey is encoded into base64 before it is stored.
private static void saveprvKey(PrivateKey prvky)throws Exception {
byte[] byteSeed = prvky.getEncoded();
BASE64Encoder encoder = new BASE64Encoder();
String seed = encoder.encodeBuffer(byteSeed);
FileWriter fw = new FileWriter("c:/privkey.txt");
fw.write(seed);
fw.close();
/*The loadPrvkey method is used to load the private key that is stored on the
*system into the program. this then allows for the private key to be used
*to decrypt the image byte array. The private key is decoded using base64
*and then the decoded version is returned
public static PrivateKey loadPrvkey() throws Exception{
FileInputStream fis = new FileInputStream("c:/privkey.txt");
byte[] encKey = new byte[fis.available()];
fis.read(encKey);
fis.close();
String seed = new String(encKey);
BASE64Decoder decoder = new BASE64Decoder();
byte[] byteSeed = decoder.decodeBuffer(seed);
//PrivateKey prvKey = getPrivate(byteSeed);
//PrivateKey prvKey = new PrivateKey(byteSeed);
KeyFactory rsaKeyFac = KeyFactory.getInstance("RSA");
PKCS8EncodedKeySpec encodedKeySpec = new PKCS8EncodedKeySpec(byteSeed);
RSAPrivateKey prvKey = (RSAPrivateKey)rsaKeyFac.generatePrivate(encodedKeySpec);
return prvKey;
/* the main method is where the program is run from, this main method will
* allow the user to choose between encryption and decryption with the entry
*of an e or d in the user input console then the method chosen will be
*called. it will either be imageConvert or Byteconvert.
public static void main (String[] unused) throws Exception {
System.out.println("***********************************************");
System.out.println("***    Biometric Encrytion Program          ***");
System.out.println("***********************************************");
System.out.println("Please select a process");
System.out.println("e for encryption ");
System.out.println("d for decrytion");
boolean choose = false;
BufferedReader userInput = new BufferedReader(new InputStreamReader(System.in));
String choice = null;
choice = userInput.readLine();
if (choose = choice.equals("e")){
imageConvert();
System.out.println("Encryption");
else
System.out.println("Decryption");
byteConvert();
}

Similar Messages

  • [Microsoft][SQL Server Native Client 11.0][SQL Server]The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.  'Items' (OITM) (OITM)

    Dear Experts,
    i am getting the below error when i was giving * (Star) to view all the items in DB
    [Microsoft][SQL Server Native Client 11.0][SQL Server]The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.  'Items' (OITM) (OITM)
    As i was searching individually it is working fine
    can any one help me how to find this..
    Regards,
    Meghanath.S

    Dear Nithi Anandham,
    i am not having any query while finding all the items in item master data i am giving find mode and in item code i was trying to type *(Star) and enter while typing enter the above issue i was facing..
    Regards,
    Meghanath

  • Error in SQL Query The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator. for the query

    hi Experts,
    while running SQL Query i am getting an error as
    The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator. for the query
    select  T1. Dscription,T1.docEntry,T1.Quantity,T1.Price ,
    T2.LineText
    from OQUT T0  INNER JOIN QUT1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN
    QUT10 T2 ON T1.DocEntry = T2.DocEntry where T1.DocEntry='590'
    group by  T1. Dscription,T1.docEntry,T1.Quantity,T1.Price
    ,T2.LineText
    how to resolve the issue

    Dear Meghanath,
    Please use the following query, Hope your purpose will serve.
    select  T1. Dscription,T1.docEntry,T1.Quantity,T1.Price ,
    CAST(T2.LineText as nvarchar (MAX))[LineText]
    from OQUT T0  INNER JOIN QUT1 T1 ON T0.DocEntry = T1.DocEntry LEFT OUTER JOIN
    QUT10 T2 ON T1.DocEntry = T2.DocEntry --where T1.DocEntry='590'
    group by  T1. Dscription,T1.docEntry,T1.Quantity,T1.Price
    ,CAST(T2.LineText as nvarchar (MAX))
    Regards,
    Amit

  • Need help. I am running a 27 in imac with 16 gigs of ram. Photoshop runs really fast, except when opening files. It takes 5-10 minutes to open even a small file of 1 meg. I cleaned and validated all the fonts and removed all questionable fonts. Reset pref

    Need help. I am running a 27 in imac with 16 gigs of ram. Photoshop runs really fast, except when opening files. It takes 5-10 minutes to open even a small file of 1 meg. I cleaned and validated all the fonts and removed all questionable fonts. Reset preferences and still have problem. Slow to open and in force quit "Photoshop not responding" At this point should I uninstall and start over.

    What are the performance Preferences?

  • WPF report viewer throws exception when print button clicked when hosted on winform

    When hosted in a winform app the wpf report viewer control throws an exception when the print button is clicked.
    All the other buttons appear to work, any ideas on a work round?
    I have created a sample VS 2013 solution that shows this issue
    As I can't even attach a renamed zip file it can be downloaded directly from here: http://1drv.ms/QxUrZo
    The reason I am attempting to use this control is that the standard reportviewer causes occasional errors in citrix enviroments causing the citrix session to lock up.  This appears to be a relatively common issue and the usual issue of both sides (citrix & crystal) blaming the other for the cause and me the developer needs to find a work round.
    I've 'bodged' in an additional button on our app to export a loaded report to file as pdf then print it but this should not be the permanent resolution.
    BTW glad to see the x64 dynamic parameter issue has been fixed at last, think I reported this over two years ago and again ended up having to work round it.

    Hi Ludek
    A sample project that loads a simple report is available from here: http://1drv.ms/QxUrZo
    The project is called WPFReportHost
    This loads a simple report when run then you can test the basic functionality of the viewer and all will work until you press the print button and then you get the application crash.
    Have to improve my search technique when I googled for other people having this issue I didnt' find the link.
    We've noticed the WPF viewer loads considerably faster and has better functionality than the winform viewer and hope that it might solve the citrix preview issue (yet to be tested).
    So as a work round we've hidden the default print button added our own and call the report print directly as per below:
    using (PrintDialog dialog = new PrintDialog())           
         dialog.AllowCurrentPage = true;
         dialog.AllowSelection = true;    
         dialog.AllowSomePages = true;
         dialog.AllowPrintToFile = true;
         if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)                     {
              reportDocument.PrintToPrinter(                         
                   dialog.PrinterSettings,                         
                   new System.Drawing.Printing.PageSettings(dialog.PrinterSettings);
                    false);                   
    Would be nice to have a fix

  • NO_PERMISSION Exception when calling secured EJB-methods

    In WL6.1, I have an Ejb with secured methods. The (Swing) client application accesses the Ejb through rmi-iiop using the JDK1.3.1 Orb.
    Unfortunately, it seems that the caller identity (which was supplied in the InitialContext lookup) is not propagated
    to the server: any call to a secured method
    fails with a CORBA NO_PERMISSION Exception.
    Non secured methods work fine.
    Using the t3 protocol the program also works fine, but that would require
    the 25Mb weblogic.jar on all clients,
    which is unattainable for us.
    Any ideas how this situation can be corrected?
    -Allard Siemelink

    I am still getting the NO_PERMISSION Exception when using "weblogic.jndi.WLInitialContextFactory".
    We use Sun's JRE, version 1.3.1_01.
    Am I forgetting something?
    My code is as follows:
    InitialContext context = null;
    try {
    Hashtable ht = new Hashtable();
    ht.put(InitialContext.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
    ht.put(InitialContext.PROVIDER_URL, "iiop://localhost:80");
    ht.put(InitialContext.SECURITY_PRINCIPAL, "system");
    ht.put(InitialContext.SECURITY_CREDENTIALS, "system_password");
    context = new InitialContext(ht);
    Object objHome = context.lookup(EJB_NAME);
    MyHome myHome = (MyHome)PortableRemoteObject.narrow(objHome, MyHome.class);
    MyRemote myRemote = myHome.create();
    //NEXT LINE Crashes when method is secured:
    myRemote.securedMethod();
    finally {
    if (context!=null) context.close();
    Andy Piper <[email protected]> wrote:
    Allard Siemelink <[email protected]> writes:
    In WL6.1, I have an Ejb with secured methods. The (Swing) client applicationaccesses the Ejb through rmi-iiop using the JDK1.3.1 Orb.
    Unfortunately, it seems that the caller identity (which was suppliedin the InitialContext lookup) is not propagated
    to the server: any call to a secured method
    fails with a CORBA NO_PERMISSION Exception.Make sure you are using WLInitialContextFactory and not
    CNCtxFactory. Only the former will give you security.
    andy

  • How to catch exception when have max connection pool

    hi,
    i have define in oracle user that i could have max 10 sessions at the same time.
    I have jdbc datasource & connection pool defined at glassfish server(JSF application).
    now, if in application is too many queries to the database then i have error: nullpointer exception - becouse when i try to do:
    con = Database.createConnection(); - it generates nullpointer exception becouse there isn't free connection pool
    i try to catch exception like this:
    public List getrep_dws_wnioski_wstrzymane_graph() {     int i = 0;     try {     con = Database.createConnection();     ps =    (Statement) con.createStatement();     rs = ps.executeQuery("select data, klasa, ile_dni_wstrzymana, ile_wnioskow from stg1230.dwsww_wstrzymane_dws8 order by data, klasa, ile_dni_wstrzymana, ile_wnioskow");     while(rs.next()){       rep_dws_wnioski_wstrzymane_graph.add(i,new get_rep_dws_wnioski_wstrzymane_graph(rs.getString(1),rs.getString(2),rs.getString(3),rs.getString(4)));       i++;     }     } catch (NamingException e) {         e.printStackTrace();     } catch (SQLException e) {         e.printStackTrace();     } catch (NullPointerException e) {         e.printStackTrace();         throw new NoConnectionException();  // catch null 1     } finally {     try {         con.close();     } catch (SQLException e) {         e.printStackTrace();     } catch (NullPointerException e) {         e.printStackTrace();         throw new NoConnectionException();  // catch null 2     }     } return rep_dws_wnioski_wstrzymane_graph; }
    but at line:
    con.close();
    i have nullpointerexception
    and
    at line
    throw new NoConnectionException(); // catch null 2
    i have: caused by exception.NoConnectionException
    what's wrong with my exception class? how to resolve it?
    public class NoConnectionException extends RuntimeException{     public NoConnectionException(String msg, Throwable cause){       super(msg, cause);     }     public NoConnectionException(){       super();     } }
    at web.xml i have defined:
    <error-page>         <exception-type>exception.NoConnectionException</exception-type>         <location>/NoConnectionExceptionPage.jsp</location>     </error-page>

    thanks,
    i did it and i have error:
    java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: ORA-02391: exceeded simultaneous SESSIONS_PER_USER limit
    at com.sun.gjc.spi.base.DataSource.getConnection(DataSource.java:115)
    at logic.Database.createConnection(Database.java:37): conn = ds.getConnection();
    public class Database {
         public static Connection createConnection() throws NamingException,
                    SQLException {
                Connection conn = null;
                try{
                    Context ctx = new InitialContext();
              if (ctx == null) {
                   throw new NamingException("No initial context");
              DataSource ds = (DataSource) ctx.lookup("jdbc/OracleReports");
              if (ds == null) {
                   throw new NamingException("No data source");
              conn = ds.getConnection();  // here's exception when max connections to database
              if (conn == null) {
                   throw new SQLException("No database connection");
                } catch (NamingException e) {
                    e.printStackTrace();
                    throw new NoConnectionException(); 
             } catch (SQLException e) {
                 e.printStackTrace();
                    throw new NoConnectionException(); 
                catch (NullPointerException e) {
                 e.printStackTrace();
                    throw new NoConnectionException();  // obsluga bledy na wypadek jesli braknie wolnych polaczen do bazy
            return conn;
    }and at my ealier code i have error:
    at logic.GetDataOracle.getrep_dws_wnioski_wstrzymane_graph(GetDataOracle.java:192)
    at line: con = Database.createConnection();
    in code:
    public List getrep_dws_wnioski_wstrzymane_graph() {
        int i = 0;
        try {
        con = Database.createConnection();
        ps =    (Statement) con.createStatement();
        rs = ps.executeQuery("select data, klasa, ile_dni_wstrzymana, ile_wnioskow from stg1230.dwsww_wstrzymane_dws8 order by data, klasa, ile_dni_wstrzymana, ile_wnioskow");
        while(rs.next()){
          rep_dws_wnioski_wstrzymane_graph.add(i,new get_rep_dws_wnioski_wstrzymane_graph(rs.getString(1),rs.getString(2),rs.getString(3),rs.getString(4)));
          i++;
        } catch (NamingException e) {
            e.printStackTrace();
        } catch (SQLException e) {
            e.printStackTrace();
        } catch (NullPointerException e) {
            e.printStackTrace();
            throw new NoConnectionException();
        } finally {
        try {
            if(con != null)
            con.close();
        } catch (SQLException e) {
            e.printStackTrace();
        } catch (NullPointerException e) {
            e.printStackTrace();
            throw new NoConnectionException(); 
    return rep_dws_wnioski_wstrzymane_graph;
    }so what's wrong?
    i have limit max sessions 10 at oracle so i set at my connection pool 5 connections as max. But when i get max 5 sesssins and try to execute next query then i can't catch exception..

  • I just recently upgraded my itouch from 4.1 to ios5, and updated to itunes 10.5. when isynced my music files,ebooks and other apps, all is working except when im trying to sync my video files. it says, canot be synced as cannot be played on this ipod.help

    i just recently upgraded my itouch from 4.1 to ios 5, and updated to itunes 10.5. but when i synced my music files,ebooks and other apps, all is working except when im trying to sync my video files. it says, canot be synced as cannot be played on this ipod. but those are the same files that i have when i was using the old 4.1 version and its syncing just fine.. the itunes advanced tab "create iphone or ipod version" is not working either so i cant convert it to be xferred and synced. what can i do to have my video files synced?

    i had the same problem but i just got a new video converter and made it convert videos to ipod/iphone format and then put them into itunes. i would suggest GOM encoder as the encoder can convert them and then once they're finished converting, put them automatically into your itunes for you. from there you can just sync them to your ipod.

  • My toshiba external hard drive is not being recognized, except when I eject it. I have the preferences checked to show icon and have checked utilities folder. nothing. Help!

    I have a iMac, Yosemite 10.10 and my toshiba external hard drive is not being recognized, except when I eject it!. I have the preferences checked to show icons and have looked in the utilities folder..nothing. I have also changed ports. ??

    A few things to try:
    1-Repair permissions and restart your computer.
    2-Zap the PRAM
    3-Use Software Update/App Store to update your OS to OS 10.10.3.  Also, update everything SU/AS has to offer for your computer.  When done, repair permissions and restart your computer. 

  • Class not found exception when launching opencounterslogger.bat

    PORTAL_HOME=D:\bea\alui\ptportal\10.3.0
    Expected PORTAL_HOME=D:\bea\alui\ptportal\10.3.0
    claspath is D:\bea\alui\ptportal\10.3.0\lib\java\jakarta-oro-2.0.7.jar;D:\bea\alui\ptportal\10.3.0\lib\java\openfoundation.jar;D:\bea\alui\ptportal\10.3.0\lib\java\openlog-framework.jar;D:\bea\alui\ptportal\10.3.0\lib\java\openconfig.jar;D:\bea\alui\ptportal\10.3.0\lib\java\openkernel.jar;D:\bea\alui\ptportal\1
    0.3.0\lib\java\pmb.jar;D:\bea\alui\ptportal\10.3.0\lib\java\opencounters.jar
    Exception in thread "Main Thread" java.lang.NoClassDefFoundError: com/plumtree/openkernel/impl/counters/adaptor/logger/PTRemoteCounterLoggerMain
    Press any key to continue . . .
    The class PTRemoteCounterLoggerMain is not in any of the jars in the classpath. Also opencountersconsole.bat is not to be seen is the installation

    Hi Mark,
    I have seen your two posts and there are something you need to notice:
    Where the ClassNotFound exception you got? From deployment tool or
    application server kjs process?
    Of course, you need not to add supporting classes to each ejb jars or ears.
    1. If you use deployment tool to package your application, I'm sure you'll
    fail to resovle your classes without supporting classes added to jars.
    Please select Edit->Preference,in Classpath entry, enter the supporting
    classes(packaged to jar files) location. This should work.
    2. After deploy to ias, please edit the registry using kregedit which you
    described in your posts.
    Regards,
    Johnson
    "Mark Priest" <[email protected]> wrote in message
    news:9s6h33$[email protected]..
    When I deploy EJBs to the iPlanet app server I find that I need to include
    all supporting classes in each ejb jar file. According to the
    Administrator's manual I should be able to modify the kjs classpath bydoing
    the following:
    On Windows
    a.. Open iPlanet Registry Editor.
    (See About iPlanet Registry Editor)
    b.. Open the following key:
    SOFTWARE\iPlanet\Application Server\6.0\Java\
    c.. Modify the class path and restart the server for the change to take
    effect.
    However, when I add my supporting classes to a jar in this directory Istill
    get a class not found exception when I run the deployment tool.
    Adding the classes to each EJB jar is redundant and introduces lots of
    problems. How should I configure iPlanet so I only need to put my
    supporting classes in one place?
    Thanks,
    Mark

  • Exception when trying to acess a jsf application

    Im using eclipse 3.3 , tomcat 5.5.2x
    index.jsp
    ========
    <html>
    <body>
    <jsp:forward page="faces/ourJsf/enterAge.jsp" />
    </body>
    </html>
    ============
    enterAge.jsp
    =========
    <%@ page contentType="text/html; charset=Cp1252" %>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <html>
         <head>
              <meta http-equiv="Content-Type" content="text/html; charset=Cp1252"/>
              <title>Dog's Life</title>
         </head>
         <body>
              <f:view>
                   <h:form>
                   <h:outputText value="Enter your age please"/>
    <h:inputText value="#{dog.age}" />
    <h:commandButton value="Calculate Dog Years" action="#{dog.calcYears}" />
                   </h:form>
              </f:view>
         </body>
    </html>
    =========
    faces-config.xml
    ==========
    <?xml version="1.0"?>
    <!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN" "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
    <faces-config>
         <managed-bean>
              <managed-bean-name>dog</managed-bean-name>
              <managed-bean-class>beans.DogBean</managed-bean-class>
              <managed-bean-scope>session</managed-bean-scope>
         </managed-bean>
         <navigation-rule>
              <from-view-id>/ourJsf/enterAge.jsp</from-view-id>
         </navigation-rule>
         <navigation-rule>
              <from-view-id>/ourJsf/enterAge.jsp</from-view-id>
              <navigation-case>
                   <from-outcome>success</from-outcome>
                   <to-view-id>/ourJsf/result.jsp</to-view-id>
              </navigation-case>
              <navigation-case>
                   <from-outcome>failure</from-outcome>
                   <to-view-id>/ourJsf/error.jsp</to-view-id>
              </navigation-case>
         </navigation-rule>
    </faces-config>
    ================
    a portion of my web.xml
    =============
    <!-- Extensions Filter -->
    <filter>
    <filter-name>extensionsFilter</filter-name>
    <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
    <init-param>
    <param-name>uploadMaxFileSize</param-name>
    <param-value>100m</param-value>
    <description>Set the size limit for uploaded files.
    Format: 10 - 10 bytes
    10k - 10 KB
    10m - 10 MB
    1g - 1 GB
    </description>
    </init-param>
    <init-param>
    <param-name>uploadThresholdSize</param-name>
    <param-value>100k</param-value>
    <description>Set the threshold size - files
    below this limit are stored in memory, files above
    this limit are stored on disk.
    Format: 10 - 10 bytes
    10k - 10 KB
    10m - 10 MB
    1g - 1 GB
    </description>
    </init-param>
    <!-- <init-param>
    <param-name>uploadRepositoryPath</param-name>
    <param-value>/temp</param-value>
    <description>Set the path where the intermediary files will be stored.
    </description>
    </init-param>-->
    </filter>
    <filter-mapping>
    <filter-name>extensionsFilter</filter-name>
    <url-pattern>*.jsf</url-pattern>
    </filter-mapping>
    <filter-mapping>
    <filter-name>extensionsFilter</filter-name>
    <url-pattern>/faces/*</url-pattern>
    </filter-mapping>
    <!-- Faces Servlet -->
    <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <!-- Faces Servlet Mapping -->
    <!-- virtual path mapping -->
    <!-- virtual path mapping (uncommented by LG )-->
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    <!-- extension mapping -->
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>
    <!-- Welcome files -->
    <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>index.html</welcome-file>
    </welcome-file-list>
    </web-app>
    =============
    i'm getting an exception when i call my application :
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:476)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:371)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    root cause
    javax.servlet.ServletException
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:156)
         org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:691)
         org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:661)
         org.apache.jsp.index_jsp._jspService(index_jsp.java:46)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    root cause
    java.lang.NullPointerException
         org.apache.myfaces.application.jsp.JspStateManagerImpl.restoreTreeStructure(JspStateManagerImpl.java:240)
         org.apache.myfaces.application.jsp.JspStateManagerImpl.restoreView(JspStateManagerImpl.java:283)
         org.apache.myfaces.application.jsp.JspViewHandlerImpl.restoreView(JspViewHandlerImpl.java:255)
         org.apache.myfaces.lifecycle.LifecycleImpl.restoreView(LifecycleImpl.java:141)
         org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:66)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)
         org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:691)
         org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:661)
         org.apache.jsp.index_jsp._jspService(index_jsp.java:46)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.23 logs.
    Apache Tomcat/5.5.23
    Thank yoiu guys for helping me : this my very first jsf application

    Hello,
    Like you said it was the problem with url.
    The webservice I used is actually running on the local machine (where the NetWeaver developer studio is installed); so in the url I had specified localhost. But I deployed the application on another server(SAP J2EE Engine). That is why it didn't work. On changing the url as required, the application is working fine.
    Thanks !
    Regards,
    Loveline.

  • He XML message is going over to SRM from XI , but getting an application error (Exception)  when checking in sxmb_moni on the SRM side

    hi experts  ,
    we are using classic scenario (ECC 6.6 & SRM 7.0)
    we have are configured Procure-to-Pay Scenario ,Note 1263876 - SAP SRM: Configuration of Procure-to-Pay Scenario.
    but facing issue.
    The XML message is going over to SRM from XI , but getting an application error (Exception)  when checking in sxmb_moni on the SRM side. So we are not able to see the PR in the Sourcing cockpit in SRM.
    error as below
    <SAP:Category>Application</SAP:Category>  
    <SAP:Code area="ABAP">APPLICATION_ERROR</SAP:Code>  
    <SAP:P1 />  
    <SAP:P2 />  
    <SAP:P3 />  
    <SAP:P4 />  
    <SAP:AdditionalText />  
    <SAP:ApplicationFaultMessage namespace="http://sap.com/xi/SRM/SE/Global">ExchangeFaultData</SAP:ApplicationFaultMessage>  
    <SAP:Stack>Application has thrown an exception</SAP:Stack>  
    <SAP:Retry>M</SAP:Retry>  
    </SAP:Error>

    Hi Vijay,
    Can you tell us the interface name?
    If it is stuck in FEH (Application Error) in SRM then you can check the detail error by going into tcode /n/sappo/ppo2.
    You need to enter the Business Process, Order Assignment and Mode Of Postprocessing Order and then execute.
    It will show you all the messages stuck in application error for that interface and if you double click on any one of them you will get to see the detailed error with options to Discard, Repeat etc.
    Let us know if this helps you.
    Regards,
    Mayur

  • HT2188 I can hear caller but they can not hear me except when using speaker phone

    I can hear caller but they can not hear me except when using speaker phone

    First of all,  make sure that your iPhone as the most recent iOS available. Check in "Settings>General>Software Update".
    One other problem could be your microphone. Does it work for anything else other than a call?
    Good-Luck!
    kpower28
    Please mark this as "solved my problem" or "helped me"!

  • Socket Exception when closing the console

    Hi ,
    I'm running WLC & P Server 3.5/WL 6.1 in the following environment
    Weblogic Version: WebLogic Server 6.1 SP1
    JDK Vendor: Blackdown Java-Linux Team
    JDK Version: 1.3.1
    Operating System: Linux
    and I'm getting very often this exception when closing the console
    <Dec 30, 2001 2:21:48 PM EST> <Error> <HTTP> <Connection failure
    java.net.SocketException: Error in poll for fd: '60', revents: '24'
    at
    weblogic.socket.PosixSocketMuxer.deliverBadNews(PosixSocketMuxer.java:429)
    at
    weblogic.socket.PosixSocketMuxer.processSockets(PosixSocketMuxer.java:384)
    at
    weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:24)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    >
    I also get the same behaviour under WL 6.1 alone when closing the console.
    Does anybody know what this means?
    Thanks,
    Dan

    Ooops, sorry for the repost.
    I can see my first post on the newsgroup when I access it with the browser
    http://newsgroups.bea.com/cgi-bin/dnewsweb?cmd=article&group=weblogic.develo
    per.interest.personalization&item=1650&utag= )
    but I cannot see it when using my newsgroup reader (Outlook Express).
    Dan
    "Dan" <[email protected]> wrote in message news:[email protected]..
    Hi ,
    I'm running WLC & P Server 3.5/WL 6.1 in the following environment
    Weblogic Version: WebLogic Server 6.1 SP1
    JDK Vendor: Blackdown Java-Linux Team
    JDK Version: 1.3.1
    Operating System: Linux
    and I'm getting very often this exception when closing the console
    <Dec 30, 2001 2:21:48 PM EST> <Error> <HTTP> <Connection failure
    java.net.SocketException: Error in poll for fd: '60', revents: '24'
    at
    weblogic.socket.PosixSocketMuxer.deliverBadNews(PosixSocketMuxer.java:429)
    at
    weblogic.socket.PosixSocketMuxer.processSockets(PosixSocketMuxer.java:384)
    at
    weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:24)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    >
    I also get the same behaviour under WL 6.1 alone when closing the console.
    Does anybody know what this means?
    Thanks,
    Dan

  • "No more data to read from socket" exception when testing connections

    Hi,
    I will appriciate your help with the following problem.
    We have the follwoing errors in the weblogic.log (We are using weblogic 8.1.0.2 and Oracle 9.2.0.3)
    ####<Dec 20, 2006 10:47:49 AM EET> <Info> <JDBC> <ep> <mfserver> <Thread-14> <<WLS Kernel>> <> <BEA-001128> <Connection for pool "oraclePool" closed.>
    ####<Dec 20, 2006 10:47:49 AM EET> <Info> <JDBC> <ep > <mfserver> <Thread-14> <<WLS Kernel>> <> <BEA-001067> <Connection for pool "oraclePool" refreshed.>
    ####<Dec 20, 2006 10:47:51 AM EET> <Error> <JDBC> <ep > <mfserver> <Thread-14> <<WLS Kernel>> <> <BEA-001112> <Test "select count(*) from DUAL" set up for pool "oraclePool" failed with exception: "java.sql.SQLException: No more data to read from socket".>
    ####<Dec 20, 2006 10:47:51 AM EET> <Error> <JDBC> <ep > <mfserver> <Thread-14> <<WLS Kernel>> <> <BEA-001131> <Received an exception when closing a cached statement for the pool "oraclePool": java.sql.SQLException: Io exception: Broken pipe.>
    These exception occures every hour after the connection pool is being closed and refreshed.
    Also there are a lot of the follwoing warnning in the log :
    <BEA-001074><A JDBC pool connection leak was detected.
    Does these two problems connected? What can we do in order to solve it?
    Thanks
    Edited by RF123 at 01/28/2007 3:41 AM

    R F wrote:
    Hi,
    I will appriciate your help with the following problem.
    We have the follwoing errors in the weblogic.log (We are using weblogic 8.1.0.2 and Oracle 9.2.0.3)
    ####<Dec 20, 2006 10:47:49 AM EET> <Info> <JDBC> <ep> <mfserver> <Thread-14> <<WLS Kernel>
    <> <BEA-001128> <Connection for pool "oraclePool" closed.>
    ####<Dec 20, 2006 10:47:49 AM EET> <Info> <JDBC> <ep > <mfserver> <Thread-14> <<WLS Kernel>
    <> <BEA-001067> <Connection for pool "oraclePool" refreshed.>
    ####<Dec 20, 2006 10:47:51 AM EET> <Error> <JDBC> <ep > <mfserver> <Thread-14> <<WLS Kernel>
    <> <BEA-001112> <Test "select count(*) from DUAL" set up for pool "oraclePool" failed with exception:
    "java.sql.SQLException: No more data to read from socket".>
    ####<Dec 20, 2006 10:47:51 AM EET> <Error> <JDBC> <ep > <mfserver> <Thread-14> <<WLS Kernel>
    <> <BEA-001131> <Received an exception when closing a cached statement for the pool "oraclePool":
    java.sql.SQLException: Io exception: Broken pipe.>
    These exception occures every hour after the connection pool is being closed and refreshed.
    Also there are a lot of the follwoing warnning in the log :
    <BEA-001074><A JDBC pool connection leak was detected.
    Does these two problems connected? What can we do in order to solve it?Hi. The problems are not directly related, but may have the same cause.
    Something is killing your DBMS connections out from under the driver.
    Do you have a firewall between WLS and the DBMS, or a flakey network?
    Contact BEA support to get the 8.1sp2 patch for getting meaningful
    connection leak traces (CR209251_81sp2.jar). When that patch is installed
    the leak messages should show a full stack trace of the application code
    where the connection was obtained. It is that application code that
    somehow failed to close the pool connection, causing a pool leak. I
    suspect that the application code got an unexpected exception, such as
    when/if the DBMS/network/firewall killed a connection. In this case I
    believe the application went through an exception-handling path that
    forgot to close the connection.
    Joe

Maybe you are looking for