Cipher.getInstance("DES") gives a Servlet Error!

Hi - I'm working on Sun ONE Identity Server 6.1 using Sun ONE Web Server 6.1 using J2SDK 1.4.1_05
I've modified one of the files to perform DES Encryption prior to getting some data.
The code works fine when compiled separately - even works fine as a console program - but when I try running it as a servlet - I get a WHOLE bunch of errors when the program hits this line:
cipher = Cipher.getInstance("DES");Here is the complete code:
public String encryptPassword(String Password, String AppName)
     Key key;
     Cipher cipher;
     String Data = Password;
     String ApplicationName = AppName;
     String result = new String("hi");
     try
                ObjectInputStream in = new ObjectInputStream(new FileInputStream("PrivateKey.ser"));
              key = (Key)in.readObject();
             in.close();
             Security.addProvider(new com.sun.crypto.provider.SunJCE());
          cipher = Cipher.getInstance("DES"); // This LINE GIVES THE ERROR
          cipher.init(Cipher.ENCRYPT_MODE, key);
          byte[] stringBytes = Data.getBytes("UTF8");
          byte[] raw = cipher.doFinal(stringBytes);                    
          BASE64Encoder encoder = new BASE64Encoder();
          String result = encoder.encode(raw);
     catch (Exception e)
          // Print some error
return result;
}Here is the error log from the webserver:
[20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: Handler method "handleBtnSubmitRequest" threw an exception
[20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: java.lang.ExceptionInInitializerError
[20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at javax.crypto.Cipher.a(DashoA6275)
[20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at javax.crypto.Cipher.getInstance(DashoA6275)
[20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at com.iplanet.am.console.user.UMChangeUserPasswordViewBean.encryptPassword(UMChangeUserPasswordViewBean.java:244)
[20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at com.iplanet.am.console.user.UMChangeUserPasswordViewBean.handleBtnSubmitRequest(UMChangeUserPasswordViewBean.java:172)
[20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at java.lang.reflect.Method.invoke(Method.java:324)
[20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at com.iplanet.jato.view.command.DefaultRequestHandlingCommand.execute(DefaultRequestHandlingCommand.java:183)
[20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at com.iplanet.jato.view.RequestHandlingViewBase.handleRequest(RequestHandlingViewBase.java:299)
[20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at com.iplanet.jato.view.ViewBeanBase.dispatchInvocation(ViewBeanBase.java:811)
[20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at com.iplanet.jato.view.ViewBeanBase.invokeRequestHandlerInternal(ViewBeanBase.java:749)
[20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at com.iplanet.jato.view.ViewBeanBase.invokeRequestHandler(ViewBeanBase.java:596)
[20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at com.iplanet.jato.ApplicationServletBase.dispatchRequest(ApplicationServletBase.java:772)
[20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at com.iplanet.jato.ApplicationServletBase.processRequest(ApplicationServletBase.java:446)
[20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at com.iplanet.jato.ApplicationServletBase.doPost(ApplicationServletBase.java:324)
[20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at javax.servlet.http.HttpServlet.service(HttpServlet.java:807)
[20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
[20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:771)
[20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:322)
[20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
[20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
[20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
[20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:209)
[20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
[20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:161)
[20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at com.iplanet.ias.web.WebContainer.service(WebContainer.java:586)
[20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: Caused by: java.lang.SecurityException: Cannot set up certs for trusted CAs
[20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at javax.crypto.SunJCE_b.<clinit>(DashoA6275)
[20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: ... 27 more
[20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: Caused by: java.security.PrivilegedActionException: java.security.InvalidKeyException: publicKey is not a PKCS #11 public key
[20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at java.security.AccessController.doPrivileged(Native Method)
[20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: ... 28 more
[20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: Caused by: java.security.InvalidKeyException: publicKey is not a PKCS #11 public key 
[20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at org.mozilla.jss.pkcs11.PK11Signature.engineInitVerify(PK11Signature.java:172)
[20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at org.mozilla.jss.crypto.Signature.initVerify(Signature.java:95) 
[20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at org.mozilla.jss.provider.Signature.engineInitVerify(Signature.java:94)
[20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at org.mozilla.jss.provider.DSASignature.engineInitVerify(DSASignature.java:70)
[20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at java.security.Signature.initVerify(Signature.java:297)
[20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at sun.security.x509.X509CertImpl.verify(X509CertImpl.java:394)
[20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at sun.security.x509.X509CertImpl.verify(X509CertImpl.java:363)
[20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at javax.crypto.SunJCE_b.e(DashoA6275)
[20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at javax.crypto.SunJCE_v.run(DashoA6275)
[20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: ... 29 more
[20/Oct/2003:16:58:01] failure ( 6417):  for host 10.42.7.235 trying to POST /amconsole/user/UMChangeUserPassword, service-j2ee reports: StandardWrapperValve[UMServlet]: WEB2792: Servlet.service() for servlet UMServlet threw exception   com.iplanet.jato.CompleteRequestException   at com.iplanet.am.console.base.ConsoleServletBase.onUncaughtException(ConsoleServletBase.java:331)   at com.iplanet.jato.ApplicationServletBase.fireUncaughtException(ApplicationServletBase.java:1023)   at com.iplanet.jato.ApplicationServletBase.processRequest(ApplicationServletBase.java:469)   at com.iplanet.jato.ApplicationServletBase.doPost(ApplicationServletBase.java:324)   at javax.servlet.http.HttpServlet.service(HttpServlet.java:807)   at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)   at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:771)   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:322)   at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)   at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:209)   at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)   at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:161)   at com.iplanet.ias.web.WebContainer.service(WebContainer.java:586)   

Hi - I'm working on Sun ONE Identity Server 6.1 using
Sun ONE Web Server 6.1 using J2SDK 1.4.1_05
I've modified one of the files to perform DES
Encryption prior to getting some data.
The code works fine when compiled separately - even
works fine as a console program - but when I try
running it as a servlet - I get a WHOLE bunch of
errors when the program hits this line:Actually, I think the errors are telling you the problem - you're just getting tangled up in the stacktraces. Let's get rid of everything except the "causes" lines:Handler method "handleBtnSubmitRequest" threw an exception
java.lang.ExceptionInInitializerError
Caused by: java.lang.SecurityException: Cannot set up certs for trusted CAs
CORE3283: stderr: at javax.crypto.SunJCE_b.<clinit>(DashoA6275)
Caused by: java.security.PrivilegedActionException: java.security.InvalidKeyException: publicKey is not a PKCS #11 public key
at java.security.AccessController.doPrivileged(Native Method)
Caused by: java.security.InvalidKeyException: publicKey is not a PKCS #11 public key 
failure ( 6417):  for host 10.42.7.235 trying to POST amconsole/user/UMChangeUserPassword, service-j2eeLooks to me like the ctor for Cipher is unhappy because it's finding a key that isn't a PKCS#11 public key while it's trying to set up.
What trust-store is your installation using? Have you run keytool -list on it? Possibly there's a bad key/cert in there.
What do you expect "key" to be, in your code? How certain are you that it's really a DES key? If someone asked me to guess from the filename "PrivateKey.ser", I'd guess it was the private half an RSA keypair, which will NOT work for DES - but that may be just an unfortunate choice of filenames.
The net is, you need to figure out where the installation is finding the thing that's causing the InvalidKeyException. Haven't used SunONE, so I'm not much help on exactly where to look - you might post on a SunONE list, to get help from admin-mavens...
Good luck!
Grant

Similar Messages

  • Cipher.getInstance("DES") not working in servlet!

    Hi - I'm working on Sun ONE Identity Server 6.1 using Sun ONE Web Server 6.1 using J2SDK 1.4.1_05
    I've modified one of the files to perform DES Encryption prior to getting some data.
    The code works fine when compiled separately - even works fine as a console program - but when I try running it as a servlet - I get a WHOLE bunch of errors when the program hits this line:
    cipher = Cipher.getInstance("DES");Here is the complete code:
    public String encryptPassword(String Password, String AppName)
         Key key;
         Cipher cipher;
         String Data = Password;
         String ApplicationName = AppName;
         String result = new String("hi");
         try
                    ObjectInputStream in = new ObjectInputStream(new FileInputStream("PrivateKey.ser"));
                  key = (Key)in.readObject();
                 in.close();
                 Security.addProvider(new com.sun.crypto.provider.SunJCE());
              cipher = Cipher.getInstance("DES"); // This LINE GIVES THE ERROR
              cipher.init(Cipher.ENCRYPT_MODE, key);
              byte[] stringBytes = Data.getBytes("UTF8");
              byte[] raw = cipher.doFinal(stringBytes);                    
              BASE64Encoder encoder = new BASE64Encoder();
              String result = encoder.encode(raw);
         catch (Exception e)
              // Print some error
    return result;
    }Here is the error log from the webserver:
    [20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: Handler method "handleBtnSubmitRequest" threw an exception
    [20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: java.lang.ExceptionInInitializerError
    [20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at javax.crypto.Cipher.a(DashoA6275)
    [20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at javax.crypto.Cipher.getInstance(DashoA6275)
    [20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at com.iplanet.am.console.user.UMChangeUserPasswordViewBean.encryptPassword(UMChangeUserPasswordViewBean.java:244)
    [20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at com.iplanet.am.console.user.UMChangeUserPasswordViewBean.handleBtnSubmitRequest(UMChangeUserPasswordViewBean.java:172)
    [20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    [20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    [20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at java.lang.reflect.Method.invoke(Method.java:324)
    [20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at com.iplanet.jato.view.command.DefaultRequestHandlingCommand.execute(DefaultRequestHandlingCommand.java:183)
    [20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at com.iplanet.jato.view.RequestHandlingViewBase.handleRequest(RequestHandlingViewBase.java:299)
    [20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at com.iplanet.jato.view.ViewBeanBase.dispatchInvocation(ViewBeanBase.java:811)
    [20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at com.iplanet.jato.view.ViewBeanBase.invokeRequestHandlerInternal(ViewBeanBase.java:749)
    [20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at com.iplanet.jato.view.ViewBeanBase.invokeRequestHandler(ViewBeanBase.java:596)
    [20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at com.iplanet.jato.ApplicationServletBase.dispatchRequest(ApplicationServletBase.java:772)
    [20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at com.iplanet.jato.ApplicationServletBase.processRequest(ApplicationServletBase.java:446)
    [20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at com.iplanet.jato.ApplicationServletBase.doPost(ApplicationServletBase.java:324)
    [20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at javax.servlet.http.HttpServlet.service(HttpServlet.java:807)
    [20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
    [20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:771)
    [20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:322)
    [20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
    [20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
    [20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
    [20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:209)
    [20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
    [20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:161)
    [20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at com.iplanet.ias.web.WebContainer.service(WebContainer.java:586)
    [20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: Caused by: java.lang.SecurityException: Cannot set up certs for trusted CAs
    [20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at javax.crypto.SunJCE_b.<clinit>(DashoA6275)
    [20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: ... 27 more
    [20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: Caused by: java.security.PrivilegedActionException: java.security.InvalidKeyException: publicKey is not a PKCS #11 public key
    [20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at java.security.AccessController.doPrivileged(Native Method)
    [20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: ... 28 more
    [20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: Caused by: java.security.InvalidKeyException: publicKey is not a PKCS #11 public key 
    [20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at org.mozilla.jss.pkcs11.PK11Signature.engineInitVerify(PK11Signature.java:172)
    [20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at org.mozilla.jss.crypto.Signature.initVerify(Signature.java:95) 
    [20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at org.mozilla.jss.provider.Signature.engineInitVerify(Signature.java:94)
    [20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at org.mozilla.jss.provider.DSASignature.engineInitVerify(DSASignature.java:70)
    [20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at java.security.Signature.initVerify(Signature.java:297)
    [20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at sun.security.x509.X509CertImpl.verify(X509CertImpl.java:394)
    [20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at sun.security.x509.X509CertImpl.verify(X509CertImpl.java:363)
    [20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at javax.crypto.SunJCE_b.e(DashoA6275)
    [20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: at javax.crypto.SunJCE_v.run(DashoA6275)
    [20/Oct/2003:16:58:01] warning ( 6417):  CORE3283: stderr: ... 29 more
    [20/Oct/2003:16:58:01] failure ( 6417):  for host 10.42.7.235 trying to POST /amconsole/user/UMChangeUserPassword, service-j2ee reports: StandardWrapperValve[UMServlet]: WEB2792: Servlet.service() for servlet UMServlet threw exception   com.iplanet.jato.CompleteRequestException   at com.iplanet.am.console.base.ConsoleServletBase.onUncaughtException(ConsoleServletBase.java:331)   at com.iplanet.jato.ApplicationServletBase.fireUncaughtException(ApplicationServletBase.java:1023)   at com.iplanet.jato.ApplicationServletBase.processRequest(ApplicationServletBase.java:469)   at com.iplanet.jato.ApplicationServletBase.doPost(ApplicationServletBase.java:324)   at javax.servlet.http.HttpServlet.service(HttpServlet.java:807)   at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)   at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:771)   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:322)   at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)   at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:209)   at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)   at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:161)   at com.iplanet.ias.web.WebContainer.service(WebContainer.java:586)    

    Hey.
    Not certain, but I think you need to make sure that your ciphers/certificates are installed on your server. Check the docs on the Sun server, and see what they say about installing certificates.
    Hope this helps.
    Vic

  • Jsp give me this error javax.servlet.ServletException: oracle.jdbc.driver.O

    Hi master
    Sir I use orace 9i easily in java class with following code
    ===========
    import java.sql.*;
    public class ttst {
    public ttst() {
    public static void main (String args [])
    try{
    Class.forName("oracle.jdbc.driver.OracleDriver");
    Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@fahim:1521:aamir","muhammad","mfa786");
    Statement stmt = conn.createStatement();
    ResultSet rset = stmt.executeQuery("select accid from accbal where accid='K1101'");
    System.out.println ("going for connection");
    while (rset.next())
    s= rset.getString("accid");
    System.out.println (s);
    catch(Exception e){
    e.printStackTrace();
    system give me right result
    and when I use jsp with this code
    <HTML>
    <%@ page import="java.sql.*,java.util.*" %>
    <% String url="jdbc:oracle:thin:@fahim:1521:aamir";
    Connection con;
    Statement stmt;
    ResultSet rs;
    Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
    con = DriverManager.getConnection(url,"muhammad","mfa786");
    stmt=con.createStatement();
    %>
    <%
    %>
    <select name="ltpid">
    <%
    try{
    rs= stmt.executeQuery("select accid,title from chartofacc");
    while (rs.next()){
    %>
    <option Value=<%=rs.getString(1)%>> <%=rs.getString(2) %> </option>
    <%
    catch(Exception e){}
    %>
    </select>
    <br>
    TEST DONE!
    </HTML>
    sir I have class12.zip and class11.zip I same folder
    but system give me this error
    Apache Tomcat/4.0.6 - HTTP Status 500 - Internal Server Error
    type Exception report
    message Internal Server Error
    description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: oracle.jdbc.driver.OracleDriver
    at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:471)
    at org.apache.jsp.bistest$jsp._jspService(bistest$jsp.java:128)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet$JspServletWrapper.service(IDEJspServlet.java:173)
    at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.serviceJspFile(IDEJspServlet.java:246)
    at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.service(IDEJspServlet.java:339)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
    at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:226)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.netbeans.modules.web.monitor.catalina.MonitorValve.invoke(MonitorValve.java:148)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
    at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
    at java.lang.Thread.run(Thread.java:534)
    root cause
    java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1406)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1254)
    at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:198)
    at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:132)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:141)
    at org.apache.jsp.bistest$jsp._jspService(bistest$jsp.java:70)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet$JspServletWrapper.service(IDEJspServlet.java:173)
    at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.serviceJspFile(IDEJspServlet.java:246)
    at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.service(IDEJspServlet.java:339)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
    at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:226)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.netbeans.modules.web.monitor.catalina.MonitorValve.invoke(MonitorValve.java:148)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
    at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
    at java.lang.Thread.run(Thread.java:534)
    but jsp page not run
    please give me idea how I how my oracle data in jsp page
    thank
    aamir

    sir i post my problem but they reply me it java problem not oracle problem
    *** oracle reply**********
    You metioned that you use
    jdbc:oracle:thin:@<ip or hostname of machine where your db is installed>: 1521:aamir , description to connect the remote database. So, I think it's not related to your tnsname.ora problem. It's only java oracle thin connection string. Please check this string, make sure the ip and database service name is right.
    one more thing, use sqlplus check your tnsname.ora, if ok, then try to check jdbc and make sure the jdbc driver match to oracle server.
    sir please give me idea how i show my oracle data in clinet browser
    thank's
    aamir 

  • Cipher.getInstance  Error

    i got following error when assigning value to Cipher
    Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.javacard.impl.NativeMethods.getCurrentContext()B
         at com.sun.javacard.impl.NativeMethods.getCurrentContext(Native Method)
         at com.sun.javacard.impl.PrivAccess.getCurrentAppID(PrivAccess.java:454)
         at javacard.framework.CardRuntimeException.<init>(CardRuntimeException.java:46)
         at javacard.security.CryptoException.<init>(DashoA10*..:25)
         at javacard.security.CryptoException.throwIt(DashoA10*..:37)
         at javacardx.crypto.Cipher.getInstance(DashoA10*..:49)
    Edited by: Sajjad on Oct 15, 2011 6:36 AM

    Hi,
    Are you trying to run your applet code in a standard desktop JVM or in an emulator such as JCWDE? JC code can only run in a JCRE as the API's are not available elsewhere. It looks like you are trying to execute in a standard JRE with the libs from the JCDK. These are not a complete implementation (as you can see the native methods are not there).
    Cheers.,
    Shane

  • OEM app server interface - Renderer failed:  servlet error and NoClassDefFoundError

    Hello, I am having problems accessing my OEM (running on Sun Solaris) in an XSession/ssh terminal window on my Windows machine. It was working fine for months, and now I get the following errors on the OEM web browser interface page. I was wondering if anyone has had this problem, or if someone from Oracle can suggest a fix for us? We are currently unable to re-start our live app server while this connection option is not working.
    Thanks!
    -Eva
    11/11/02 12:50 PM emd: javax.servlet.ServletException: Renderer failed: java.lang.NoClassDefFoundError
    at oracle.cabo.servlet.ui.UINodePageRenderer.renderPage(Unknown Source)
    at oracle.cabo.servlet.AbstractPageBroker.renderPage(Unknown Source)
    at oracle.cabo.servlet.PageBrokerHandler.handleRequest(Unknown Source)
    at oracle.cabo.servlet.BajaServlet.doGet(Unknown Source)
    at oracle.sysman.emSDK.eml.svlt.EMServlet.doGet(EMServlet.java:240)
    at oracle.sysman.eml.app.ConsoleSN.doGet(ConsoleSN.java:71)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:244)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
    at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:59)
    at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:283)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:523)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:269)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:735)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:243)
    at com.evermind.util.ThreadPoolThread.run(ThreadPoolThread.java:64)
    11/11/02 12:50 PM emd: Servlet error
    javax.servlet.ServletException: Renderer failed: java.lang.NoClassDefFoundError
    at oracle.cabo.servlet.ui.UINodePageRenderer.renderPage(Unknown Source)
    at oracle.cabo.servlet.AbstractPageBroker.renderPage(Unknown Source)
    at oracle.cabo.servlet.PageBrokerHandler.handleRequest(Unknown Source)
    at oracle.cabo.servlet.BajaServlet.doGet(Unknown Source)
    at oracle.sysman.emSDK.eml.svlt.EMServlet.doGet(EMServlet.java:240)
    at oracle.sysman.eml.app.ConsoleSN.doGet(ConsoleSN.java:71)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:244)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
    at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.jav
    a:59)
    at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:283)
    at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.invoke(ServletRequestDispat
    cher.java:523)
    at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.forwardInternal(ServletRequ
    estDispatcher.java:269)
    at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.HttpRequestHandler.processRequest(HttpRequestHandler
    .java:735)
    at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.HttpRequestHandler.run(HttpRequestHandler.java:243)
    at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].util.ThreadPoolThread.run(ThreadPoolThread.java:64)
    11/11/02 12:50 PM emd: java.lang.NoClassDefFoundError
    at oracle.sysman.emSDK.eml.chart.ChartDataSource.setKey(ChartDataSource.java:720)
    at oracle.sysman.emSDK.eml.chart.ChartDataSource.setKey(ChartDataSource.java:702)
    at oracle.sysman.emSDK.eml.chart.EmChartDataSourceBean.addColumn(EmChartDataSourceBean.java:227)
    at oracle.sysman.emSDK.eml.chart.EmChartDataSourceBean.addColumn(EmChartDataSourceBean.java:171)
    at oracle.sysman.emSDK.eml.chart.EmChartBean.processChildren(EmChartBean.java:384)
    at oracle.sysman.emSDK.eml.chart.EmChartBean.setAttributes(EmChartBean.java:294)
    at oracle.sysman.emSDK.eml.chart.EmChartBean.initializeFromTag(EmChartBean.java:212)
    at oracle.sysman.emSDK.eml.chart.EmChartBean.<init>(EmChartBean.java:182)
    at oracle.sysman.emSDK.eml.chart.EMChartRenderer.getRenderingUINode(EMChartRenderer.java:65)
    at oracle.cabo.ui.composite.UINodeRenderer.render(Unknown Source)
    at oracle.cabo.ui.BaseUINode.render(Unknown Source)
    at oracle.cabo.ui.BaseUINode.render(Unknown Source)
    at oracle.cabo.ui.BaseRenderer.renderChild(Unknown Source)
    at oracle.cabo.ui.BaseRenderer.renderNamedChild(Unknown Source)
    at oracle.cabo.ui.BaseRenderer.renderNamedChild(Unknown Source)
    at oracle.cabo.ui.laf.base.SwitcherRenderer.renderContent(Unknown Source)
    at oracle.cabo.ui.BaseRenderer.render(Unknown Source)
    at oracle.cabo.ui.BaseUINode.render(Unknown Source)
    at oracle.cabo.ui.BaseUINode.render(Unknown Source)
    at oracle.cabo.ui.BaseRenderer.renderChild(Unknown Source)
    at oracle.cabo.ui.BaseRenderer.renderIndexedChild(Unknown Source)
    at oracle.cabo.ui.BaseRenderer.renderIndexedChild(Unknown Source)
    at oracle.cabo.ui.BaseRenderer.renderContent(Unknown Source)
    at oracle.cabo.ui.BaseRenderer.render(Unknown Source)
    at oracle.cabo.ui.laf.xhtml.XhtmlLafRenderer.render(Unknown Source)
    at oracle.cabo.ui.BaseUINode.render(Unknown Source)
    at oracle.cabo.ui.BaseUINode.render(Unknown Source)
    at oracle.cabo.ui.BaseRenderer.renderChild(Unknown Source)
    at oracle.cabo.ui.laf.xhtml.RowLayoutRenderer.renderChild(Unknown Source)
    at oracle.cabo.ui.BaseRenderer.renderIndexedChild(Unknown Source)
    at oracle.cabo.ui.BaseRenderer.renderIndexedChild(Unknown Source)
    at oracle.cabo.ui.BaseRenderer.renderContent(Unknown Source)
    at oracle.cabo.ui.BaseRenderer.render(Unknown Source)
    at oracle.cabo.ui.laf.xhtml.XhtmlLafRenderer.render(Unknown Source)
    at oracle.cabo.ui.BaseUINode.render(Unknown Source)
    at oracle.cabo.ui.BaseUINode.render(Unknown Source)
    at oracle.cabo.ui.BaseRenderer.renderChild(Unknown Source)
    at oracle.cabo.ui.BaseRenderer.renderIndexedChild(Unknown Source)
    at oracle.cabo.ui.BaseRenderer.renderIndexedChild(Unknown Source)
    at oracle.cabo.ui.BaseRenderer.renderContent(Unknown Source)
    at oracle.cabo.ui.BaseRenderer.render(Unknown Source)
    at oracle.cabo.ui.laf.xhtml.XhtmlLafRenderer.render(Unknown Source)
    at oracle.cabo.ui.BaseUINode.render(Unknown Source)
    at oracle.cabo.ui.BaseUINode.render(Unknown Source)
    at oracle.cabo.ui.BaseRenderer.renderChild(Unknown Source)

    We also see this error message in the OEM webpage interface:
    Servlet error: Renderer failed: java.lang.InternalError: Can't connect to X11 window server using '64.52.70.36:0.0' as the value of the DISPLAY variable
    I am hoping this extra info might help someone who would like to give us a suggestion of how we can get the OEM to appear in our browser again. Thanks!!

  • Problem with cipher.getInstance

    hello,
    I am working with JavaCard 2.2.2 on windows with JDK1.5.
    I have this fallowing part of code on my card (in fact I use JCWDE):
    public void initialisation(){
    key = (DESKey)KeyBuilder.buildKey(KeyBuilder.TYPE_DES_TRANSIENT_DESELECT,KeyBuilder.LENGTH_DES, false);
    // try{
              ecipher = Cipher.getInstance(Cipher.ALG_DES_CBC_NOPAD,true);
              dcipher = Cipher.getInstance(Cipher.ALG_DES_CBC_NOPAD,true);
              ecipher.init(key, Cipher.MODE_ENCRYPT);
              dcipher.init(key, Cipher.MODE_DECRYPT);
    //} catch (javacard.security.CryptoException e) {
    When I launch it, I have this error:
    Java Card 2.2.2 Workstation Development Environment, Version 1.3
    Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
    jcwde is listening for T=1 Apdu's on TCP/IP port 9 025.
    Exception from the invoked install() method:public static void fr.sogeti.Izy.tes.Test.install(byte[],short,byte) throws javacard.framework.ISOException
    javacard.framework.ISOException
    I dont know why, when i use the debugger mode, this application stop at this line:
    ecipher = Cipher.getInstance(Cipher.ALG_DES_CBC_NOPAD,true);
    Could you help me?
    Regards
    Alexis

    I try but it doesn't work... (same error)
    if you want I can put my full code?
    my new code:
    private byte[] Crypto = {(byte)0xA0, (byte)0x00,
         (byte)0x00, (byte)0x00, (byte)0x62, (byte)0x03, (byte)0x01, (byte)0x0C,
         (byte)0x0f, (byte)0x01, (byte)0x01};
         public void initialisation(){
    key = (DESKey)KeyBuilder.buildKey(KeyBuilder.TYPE_DES_TRANSIENT_DESELECT,KeyBuilder.LENGTH_DES, false);
    key.setKey(Crypto, (short)0);
    // try{
              ecipher = Cipher.getInstance(Cipher.ALG_DES_CBC_NOPAD,false);
              dcipher = Cipher.getInstance(Cipher.ALG_DES_CBC_NOPAD,false);
              ecipher.init(key, Cipher.MODE_ENCRYPT);
              dcipher.init(key, Cipher.MODE_DECRYPT);
    //} catch (javacard.security.CryptoException e) {
    -----

  • If image file not exist in image path crystal report not open and give me exception error problem

    Hi guys my code below show pictures for all employees
    code is working but i have proplem
    if image not exist in path
    crystal report not open and give me exception error image file not exist in path
    although the employee no found in database but if image not exist in path when loop crystal report will not open
    how to ignore image files not exist in path and open report this is actually what i need
    my code below as following
    DataTable dt = new DataTable();
    string connString = "data source=192.168.1.105; initial catalog=hrdata;uid=sa; password=1234";
    using (SqlConnection con = new SqlConnection(connString))
    con.Open();
    SqlCommand cmd = new SqlCommand("ViewEmployeeNoRall", con);
    cmd.CommandType = CommandType.StoredProcedure;
    SqlDataAdapter da = new SqlDataAdapter();
    da.SelectCommand = cmd;
    da.Fill(dt);
    foreach (DataRow dr in dt.Rows)
    FileStream fs = null;
    fs = new FileStream("\\\\192.168.1.105\\Personal Pictures\\" + dr[0] + ".jpg", FileMode.Open);
    BinaryReader br = new BinaryReader(fs);
    byte[] imgbyte = new byte[fs.Length + 1];
    imgbyte = br.ReadBytes(Convert.ToInt32((fs.Length)));
    dr["Image"] = imgbyte;
    fs.Dispose();
    ReportDocument objRpt = new Reports.CrystalReportData2();
    objRpt.SetDataSource(dt);
    crystalReportViewer1.ReportSource = objRpt;
    crystalReportViewer1.Refresh();
    and exception error as below

    First: I created a New Column ("Image") in a datatable of the dataset and change the DataType to System.Byte()
    Second : Drag And drop this image Filed Where I want.
    private void LoadReport()
    frmCheckWeigher rpt = new frmCheckWeigher();
    CryRe_DailyBatch report = new CryRe_DailyBatch();
    DataSet1TableAdapters.DataTable_DailyBatch1TableAdapter ta = new CheckWeigherReportViewer.DataSet1TableAdapters.DataTable_DailyBatch1TableAdapter();
    DataSet1.DataTable_DailyBatch1DataTable table = ta.GetData(clsLogs.strStartDate_rpt, clsLogs.strBatchno_Rpt, clsLogs.cmdeviceid); // Data from Database
    DataTable dt = GetImageRow(table, "Footer.Jpg");
    report.SetDataSource(dt);
    crv1.ReportSource = report;
    crv1.Refresh();
    By this Function I merge My Image data into dataTable
    private DataTable GetImageRow(DataTable dt, string ImageName)
    try
    FileStream fs;
    BinaryReader br;
    if (File.Exists(AppDomain.CurrentDomain.BaseDirectory + ImageName))
    fs = new FileStream(AppDomain.CurrentDomain.BaseDirectory + ImageName, FileMode.Open);
    else
    // if photo does not exist show the nophoto.jpg file
    fs = new FileStream(AppDomain.CurrentDomain.BaseDirectory + ImageName, FileMode.Open);
    // initialise the binary reader from file streamobject
    br = new BinaryReader(fs);
    // define the byte array of filelength
    byte[] imgbyte = new byte[fs.Length + 1];
    // read the bytes from the binary reader
    imgbyte = br.ReadBytes(Convert.ToInt32((fs.Length)));
    dt.Rows[0]["Image"] = imgbyte;
    br.Close();
    // close the binary reader
    fs.Close();
    // close the file stream
    catch (Exception ex)
    // error handling
    MessageBox.Show("Missing " + ImageName + "or nophoto.jpg in application folder");
    return dt;
    // Return Datatable After Image Row Insertion
    Mark as answer or vote as helpful if you find it useful | Ammar Zaied [MCP]

  • Web-Disk on OSX 10.9 Give me this error: "Finder got an error: Network file permission error."

    Previously I was using OSX 10.8 and Web Disk was working great.
    Since I upgraded to OSX 10.9 Web Disk Dont Attach to my compputer and give me this ERROR:
    FInder got an error: Network file permission error.
    When I got this ERROR first time I searched GOOGLE and found this link: http://cammodude.blogspot.no/
    And I did:
    To force all connections to be SMB1:
    Open A terminal window
    paste in the following line followed by the return key(should be all on one line): 
    echo "[default]" >> ~/Library/Preferences/nsmb.conf; echo "smb_neg=smb1_only" >> ~/Library/Preferences/nsmb.conf
    What the command does:
    Creates a file called nsmb.conf  in your  home directory at the path ~/Library/Preferences/nsmb.conf.
    Adds directives to force SMB connections to use the SMB1 protocol.  This is slower but stable.
    Then I could use Web Disk on OSX 10.9 after executing this command in Terminal.
    But now I restarted my Macbook and now Im NOT able to connect to Web Disk and get the same ERROR.
    FInder got an error: Network file permission error
    After trying 100 times it attaches 1 time but then show this ERROR:
    Can't get <<class cdis>> "my.server.com/2078" of application "Finder".
    If this happen then I can see the files in Finder and see the Contents and Size of files but if I open a PHP file in BBEdit then it shows BLANK.. But actually it is NOT blank.
    Now Im stuck How can I solve this? All help is highly appericated..
    Thank you so much...

    Hi,
    Make sure to chmod the app, something like this :
    chmod -Rf 777  secure_site_WebDisk.app
    (in my case the CPanel provided the app for my OSx version.)

  • My Microsoft Word gives me an error report as soon as I try to open Word Document

    I have the Microsoft Word for Mac 2011 and I've had it for almost 3 years now. I didn't have any problems until I decided to update it since I haven't done so when I installed Microsoft on my Macbook pro. After about 3 or 4 updates I started having difficulties when it suddenly gives me an error once I tried creating a new document that says: "Microsoft Word has encountered a problem and needs to close. We are sorry for the inconvenience." and underneath it says More Information so I clicked on it and this is what it gave me:
    Microsoft Error Reporting log version: 2.0
    Error Signature:
    Exception: EXC_BAD_ACCESS
    Date/Time: 2015-02-16 05:22:55 +0000
    Application Name: Microsoft Word
    Application Bundle ID: com.microsoft.Word
    Application Signature: MSWD
    Application Version: 14.2.0.120402
    Crashed Module Name: libobjc.A.dylib
    Crashed Module Version: unknown
    Crashed Module Offset: 0x000010a7
    Blame Module Name: Microsoft Word
    Blame Module Version: 14.2.0.120402
    Blame Module Offset: 0x0021002b
    Application LCID: 1033
    Extra app info: Reg=en Loc=0x0409
    Crashed thread: 0
    I clicked on check for updates just in case I missed any, but it says there's no updates available. Also, I restarted my computer twice and it still doesn't work. Did the updates messed it up? I really need to fix this problem soon because I'm going to need Word for school. Please and thank you!
    Edit: I'll be moving this question over the other forum, but can anyone at least solve this problem for me here?

    Microsoft Word is a Microsoft app. You should post your question to a Microsoft forum.
    Cheers,
    GB

  • Installing a trial version of the Illustrator and InDesign App in Creative Cloud on my Mac is impossible. Keep getting 'Installation failed' notices. More information gives 0 fatal error(s), 0 error(s). Already repaired disk permissions in Disk Utility bu

    Installing a trial version of the Illustrator and InDesign App in Creative Cloud on my Mac is impossible. Keep getting 'Installation failed' notices. More information gives 0 fatal error(s), 0 error(s). Already repaired disk permissions in Disk Utility but nothing seems to work. Exit code: 7.

    Hi Maarton,
    Please follow the link to resolve the issue: Errors "Exit Code: 6," "Exit Code: 7" | CS5, CS5.5
    -Ankit

  • Why is it that when I am trying to install an adobe product, I get 33% of the way through and then it gives me an error "unable to load metafile"??  It happened with Reader and now with Flashplayer.  With the Reader, I was able to find a different install

    Why is it that when I am trying to install an adobe product, I get 33% of the way through and then it gives me an error "unable to load metafile"??  It happened with Reader and now with Flash player.  With the Reader, I was able to find a different installation link using the troubleshooting guide.  I cannot find the same with flash player.  Please tell me how to install Flash player because there is a website that I cannot even view without it.  BTW That is annoying that I cannot even see the website without flash player
    my system is XP

    Use these installers:
    Flash Player for ActiveX (Internet Explorer)
    Flash Player Plug-in (All other browsers)
    Flash Player for Mac OS X
    For Adobe Reader go to http://get.adobe.com/reader/enterprise/

  • My old laptop crashed, and took my iTunes account with it.  I got a new laptop, and want to sync my iTouch to my new iTunes account.  It gives me an error message stating that I can't sync to multiple iTunes accounts, but I can't access my old one!  Help!

    My old laptop crashed, and took my iTunes account with it.  I got a new laptop, and want to sync my iTouch to iTunes.  It gives me an error message stating that I can't sync to multiple iTunes accounts, but I can't access my old one! 
    How can I get my new iTunes account to allow me to Sync my iTouch?  The only option it gives me is to "transfer purchases" from my iTouch to iTunes, but that is only about 25% of my iTunes library-most of it is CDs I have uploaded.  How can I Sync without losing all my music from my iTouch???
    Also, I have lectures and photos, etc. on my iTouch that I don't want to lose.
    I've tried a few of the iPod copy programs-the free ones and the ones you have to pay for, but I can't find one that will work for ALL my content on an iTouch.
    Right now, I can't get anything from my iTouch to iTunes, and I can't update my iTouch with my new iTunes purchases, so I'm stuck!  Help!

    Also-I tried to use my backup hard drive, but I wasn't able to drag/transfer/send/move any of my muic files onto my iTouch when the iTouch was connected to my computer.  I can't figure out why it won't let me do that. 
    The only thing I can see when I open my iTouch on my computer is my file with photos.  I can't see videos, music, or anything else.  What's going on?

  • Apex Listener : Servlet error

    Hello,
    I have installed Apex Listener.1.0.2.238.15.24 on Oracle Containers for J2EE 10g standalone (10.1.3.1.1)
    I have got this error whn trying to cofgure listener and create connection to database
    12/12/31 14:39:27.625 apex: Servlet error
    ava.lang.IllegalAccessError: class oracle.jdbc.driver.$Proxy6 cannot access its superinterface oracle.jdbc.driver.ScrollRsetStatement
         at java.lang.reflect.Proxy.defineClass0(Native Method)
         at java.lang.reflect.Proxy.getProxyClass(Proxy.java:504)
         at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:581)
         at oracle.ucp.jdbc.proxy.CallableStatementProxyFactory.createCallableStatementProxy(CallableStatementProxyFactory.java:64)
         at oracle.ucp.jdbc.proxy.ConnectionProxyFactory.proxyInvokeAfterTargetInvoke(ConnectionProxyFactory.java:154)
         at oracle.ucp.jdbc.proxy.JDBCConnectionProxyFactory.invoke(JDBCConnectionProxyFactory.java:266)
         at $Proxy0.prepareCall(Unknown Source)
         at oracle.dbtools.apex.OWA.getStatement(OWA.java:425)
         at oracle.dbtools.apex.OWA.resetSession(OWA.java:181)
         at oracle.dbtools.apex.ModApex.close(ModApex.java:143)
         at oracle.dbtools.apex.ModApex.doGet(ModApex.java:88)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.1) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:712)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.1) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:369)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.1) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:865)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.1) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:447)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.1) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:215)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.1) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:117)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.1) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:110)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
         at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
         at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.1) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:298)
         at java.lang.Thread.run(Thread.java:619)
    Any idea ???

    Hello,
    sorry for the late reply.
    I have installed Apex Listener.1.0.2.238.15.24 on Oracle Containers for J2EE 10g standalone (10.1.3.1.1) That's a pretty old version of OC4J, and a pretty old one of APEX Listener, too. Is there any reason for not choosing a more recent release?
    Despite that, your OC4J might also be using an unsupported (and outdated) Java version. APEX Listener needs at least a JDK 1.6 Update 20.
    Please check whether your OC4J is using an appropriate JDK.
    -Udo

  • My itunes will not open and gives me an error message

    My itunes will not open and give me an error message of 126... PLEASE HELP

    Hello, sarahehines. 
    Thank you for visiting Apple Support Communities.
    Here are the steps I would recommend going through as they should resolve the issue.
    iTunes 11.1.4 for Windows: Unable to install or open
    http://support.apple.com/kb/TS5376
    Cheers,
    Jason H.

  • So I download photoshop cc (2014) and when I go to open the program, it gives me an error message and shuts the program down. It says," A problem cause the program to stop working correctly. Windows will close the program." Can someone help me please?

    So I download photoshop cc (2014) and when I go to open the program, it gives me an error message and shuts the program down. It says," A problem cause the program to stop working correctly. Windows will close the program." Can someone help me please?

    I've got the same issue and it affects all my adobe software.  You are not alone as I have seen several postings looking for the answer to this help request.

Maybe you are looking for

  • Tracking a stolen (deactivated) iphone

    So I used to have a first generation iPhone but eventually got the 3GS a year ago. I still used my old iPhone for it's apps and iPod, but I think someone stole it while I was up at college. Is there any way to track an iPhone even if it's not activat

  • Edit Custom base calendar

    I created a custom base calendar to use with local holidays, which I use for a number of projects. This works fine, but I need to add holidays. That again works fine for each project. But is it possible to edit this base calendar so that the changes

  • Options won't twirl down...

    In the effects panel, my options won't twirl down. The triangle moves to the down pointing position but the options aren't showing. it was working a few minutes ago and I can't see anything that I might have done to stop it working ! Does anyone know

  • Resizing stage to fit imported jpg file

    Hi, is there a straight-forward way to resize the stage e.g. from portrat to landscape for pictures that have different height and width dimensions? thanks!

  • Procurement for Cost Center

    Hi Guys, Is it Necessary to maintain the G/L A/c while procuring for Cost center?? Or Cost Center is Sufficient ?? Please guide me??