Connection has already been created in this tx context

Hi All,
I am experiencing this problem and I am not able to find the solution for this.
Please help.
I have stateless EJB ('REQUIRED') and within that I have many EJB's using 'SUPPORTS'
as transaction and in the flow I am also calling DAO object which invokes JDBC
( using TXDataSource) call from different Datasource from the one above EJB.
I get SQL EXception as
"SQLException while getting DB connection : Connection has already been created
in this tx context for pool named oraclePool. Illegal attempt to create connection
from another pool: sybPool "
I am not able to figure out why this error is coming. Any help will be appreciated!
Regards
SH

Hi all,
I am facing this same problem
i am using database for weblogic integrator
Pointbase
and oracle for my system.
I didn't get the what u meant by XA driver
Regards,
Cleophus Pereira
"Slava Imeshev" <[email protected]> wrote:
Hi Sanjeev,
Slava
"Sanjeev" <[email protected]> wrote in message
news:3d6f55bd$[email protected]..
Hi All,
I am experiencing this problem and I am not able to find the solutionfor this.
Please help.
I have stateless EJB ('REQUIRED') and within that I have many EJB'susing
'SUPPORTS'
as transaction and in the flow I am also calling DAO object which invokesJDBC
( using TXDataSource) call from different Datasource from the one aboveEJB.
I get SQL EXception as
"SQLException while getting DB connection : Connection has alreadybeen
created
in this tx context for pool named oraclePool. Illegal attempt to createconnection
from another pool: sybPool "
I am not able to figure out why this error is coming. Any help willbe
appreciated!
Regards
SH

Similar Messages

  • Simple Entity Bean JWS fails: Connection has already been created in this tx context

    I am new to Weblogic Workshop 8.1, and trying to create an EntityBean from a pre-existing
    database table.
    I get an error that indicates the JWS is using the default cgPool rather then
    my new pool for some transaction.
    I added my database (DB2) pool and data source, and then created an entity bean
    using "New Entity Bean from database table.
    I then wrapped this Entity Bean in a control and generated a JWS.
    When I run the JWS and execute FindByPrimaryKey, I get the following error:
    Submitted at Friday, April 2, 2004 11:07:30 AM CST
    <error>
    <faultcode>JWSError</faultcode>
    <faultstring>Couldn't get connection:
    java.sql.SQLException: Connection has already been created in this tx context
    for pool named cgPool. Illegal attempt to create connection from another pool:
    ATGW_POOL
    java.sql.SQLException: Connection has already been created in this tx context
    for pool named cgPool. Illegal attempt to create connection from another pool:
    ATGW_POOL
    at weblogic.jdbc.jts.Driver.getExistingConnection(Driver.java:410)
    at weblogic.jdbc.jts.Driver.connect(Driver.java:141)

    I am new to Weblogic Workshop 8.1, and trying to create an EntityBean from a pre-existing
    database table.
    I get an error that indicates the JWS is using the default cgPool rather then
    my new pool for some transaction.
    I added my database (DB2) pool and data source, and then created an entity bean
    using "New Entity Bean from database table.
    I then wrapped this Entity Bean in a control and generated a JWS.
    When I run the JWS and execute FindByPrimaryKey, I get the following error:
    Submitted at Friday, April 2, 2004 11:07:30 AM CST
    <error>
    <faultcode>JWSError</faultcode>
    <faultstring>Couldn't get connection:
    java.sql.SQLException: Connection has already been created in this tx context
    for pool named cgPool. Illegal attempt to create connection from another pool:
    ATGW_POOL
    java.sql.SQLException: Connection has already been created in this tx context
    for pool named cgPool. Illegal attempt to create connection from another pool:
    ATGW_POOL
    at weblogic.jdbc.jts.Driver.getExistingConnection(Driver.java:410)
    at weblogic.jdbc.jts.Driver.connect(Driver.java:141)

  • Java.sql.SQLException: Connection has already been created in this tx context for pool named adrxSYBDEV07

    I keep getting the following error when I try to use 2 different java.sql.Connections
    from 2 different database connection pools in my message ejb. The message ejb
    uses container managed transaction. The 2 connection pools point to different
    Sybase Servers.
    Any help will be much appreciated !!!
    java.sql.SQLException: Connection has already been created in this tx context
    for pool named adrxSYBDEV07. Illegal attempt to create connection from another
    pool: Sybbev07Pool JDBCUtil > getConnection()

    Hi Eddie,
    "Eddie Baue" <[email protected]> wrote in message
    news:3ddbf74f$[email protected]..
    I keep getting the following error when I try to use 2 differentjava.sql.Connections
    from 2 different database connection pools in my message ejb. The messageejb
    uses container managed transaction. The 2 connection pools point todifferent
    Sybase Servers.In order to access more then one database base within
    a TX you need to have TXDataSources backed by XA
    connection pools...
    Regards,
    Slava Imeshev

  • SQLException: Connection has already been created in this tx context for...

    I get this Exception when i try to do persistance in one Oracle database after i received data from another Oracle database
    2010-08-24 10:41:44,185 2497 [[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)'] ERROR com.btick.ejb.db.MauSqlMapClient - excepcion al intentar ejecutar statement [CLIENTS.RegistrarMovimientos]
    java.sql.SQLException: Connection has already been created in this tx context for pool named ConnPoolClient. Illegal attempt to create connection from another pool: ConnPoolStore
         at weblogic.jdbc.jts.Driver.getExistingConnection(Driver.java:608)
         at weblogic.jdbc.jts.Driver.connect(Driver.java:127)
         at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:339)
         at com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.init(JdbcTransaction.java:48)
         at com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.getConnection(JdbcTransaction.java:89)
         at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForObject(GeneralStatement.java:104)
         at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:566)
         at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:541)
         at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(SqlMapSessionImpl.java:106)
         at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForObject(SqlMapClientImpl.java:83)
         at com.btick.ejb.db.EntelSqlMapClient.queryForObject(MauSqlMapClient.java:150)
         at com.btick.ejb.archivos.SyniverseBean.persistData(SynBean.java:127)
         at com.btick.ejb.archivos.SyniverseBean.persist(SynBean.java:121)
    Can u help me how to solve this?
    I tried using differents drivers.
    Thanx in advance!

    Hi Mgaldames,
    Please refer to : http://weblogic-wonders.com/weblogic/forums/ejb-webservices-dev/#comment-1620
    Thanks
    Jay SenSharma

  • Connection has already been created in this tx context for pool named cgPoo

    Hi all,
    First of all apologies, as I know there have been multiple posts on the above issue but I have not as yet been able to resolve the issue.
    I am using weblogic 8.1 sp3 to develop a portal. As you are aware on the domain creation a connection pool cg pool is created. I am using an oracle driver (oraclei 8.1.7 thin ).
    I have to create another jdbc ( clin_live )connection pool, which I also use the oracle 8 (oraclei 8.1.7 thin) and when I create the data source ( clinPool) for this I check the "emulate 2 phase commit".
    The connection pool and the data source both deploy ok but when I use the clinPool datasource I get the following error.
    Failure=java.sql.SQLException: Connection has already been created in this tx context for pool named cgPool. Illegal attempt to create connection from another pool: clin_live [ServiceException]>
    From the previous posts I understand that weblogic will let you have only one non-xa connection pool and cgPool must be non-xa.
    In trying to resolve this I have created the pool using the oracle thin XA driver without much luck.
    If any one has a solution I would be very grateful.
    Many thanks,
    Niambh

    Niambh,
    you can have only one non-xa datasource participating in a transaction. Emulating or faking XA means only that WLS does first all the operations for the XA resources, then the one non xa, and based on the result of this either commit or rollback.
    So obviously only one resource can "emulate 2PC).
    But there can be as many non XA db connections as you want, as long as they are not participating in the transaction.
    Check your datasources.
    I think the reason to use non-XA driver and "emulate 2PC" for Oracle is mainly the poor performance of the XA driver prior to 10g.
    Check also, if your Oracle database is XA enabled at all. I have seen some issues with customers, where the necessary PL/SQL packages have not been installed and therefore the thin XA driver did not work.
    -Kai

  • Connection has already been created in this tx context for pool

    Hello
              I can´t use WLS 6.0 I must use WLS 5.1. So I can´t to use distributed
              transactions.
              So that, Can I to simulate this situation???
              Client code:
              method
              UserTransaction.begin
              class1.create
              class2.updateDatabaseOracle1
              this.comit();
              Exception
              this.rollback();
              method commit
              class1.commit();
              class2.commit();
              UserTransaction.commit
              methdo rollback
              class1.rollback;
              class2.rollback;
              UserTransaction.rollback
              class1
              create
              EJBCreate
              commit
              EJB.putData
              rollback
              EJB.remove
              I get this Error:
              "Connection has already been created in this tx context for pool
              named pool1. Illegal attempt to create connection from another
              pool: pool2"
              Please Help How can I do it?
              Miguel Lopez Montero
              Soluziona Servicios Internet,Spain
              

    Niambh,
    you can have only one non-xa datasource participating in a transaction. Emulating or faking XA means only that WLS does first all the operations for the XA resources, then the one non xa, and based on the result of this either commit or rollback.
    So obviously only one resource can "emulate 2PC).
    But there can be as many non XA db connections as you want, as long as they are not participating in the transaction.
    Check your datasources.
    I think the reason to use non-XA driver and "emulate 2PC" for Oracle is mainly the poor performance of the XA driver prior to 10g.
    Check also, if your Oracle database is XA enabled at all. I have seen some issues with customers, where the necessary PL/SQL packages have not been installed and therefore the thin XA driver did not work.
    -Kai

  • Connection has already been created in this tx ctxt for pool named cgPool

    Hi,
    I am getting the below error when I try to call a DB Control( pointing to DB2) when I run my Process in Weblogic WorkShop( BEA WeblogicWorkShop8.1.4)
    <b>Caused by: java.sql.SQLException: Connection has already been created in this tx context for pool named cgPool. Illegal attempt to create connection from another pool: Mypool</b>
    I even tried changing MyPool as XA- Connection Pool.
    I set the cgPool to Emulate 2phaseCommit- non XA.
    Still the error is occuring. I am not able to call any of my methods of the DB Control.
    MyPool is pointing to a DB2 Server.
    If Any of you guys have got a solution . Please post the solution on how to solve this problem!!
    Waiting for the Response
    Regards
    Ravi Upasi:O

    Hi,
    WebLogic Workshop uses a built-in connection pool, cgPool, to track conversation state. If you create a Database control that uses a data source created on a different connection pool, you may get an error that stating that you already have a transactional context created in the first pool (the one that Workshop is using to track state), and you cannot use data sources from two different connection pools within the same transaction. You can solve this problem by using a transactional (XA) driver.
    Solution: Please use a XA driver for your application pool and the error should go away.
    Thanks
    Vimala

  • Can't log in. Says account has already been created with this username.

    Try to log in and it says account has already been created with this username, and yes I am under the log in tab and not the create an account tab. I tried to reset the password then and it told me that the form has expired. Don't know what to do about this.

    Hi there welcome,
    Could you try to clean your browser cache? If that doesn't help, then try incognito mode or a different browser.

  • 'Connection has already been closed'. Random error connecting with a pool

    Hi all,
    I've got a problem I cannot solve, and really hope in someone's help...
    The fact is: I'm working on a webapp which doesn't made use of frameworks or patterns or similars. I introduced the DAO pattern in order to organize and speed up the work. At the core of the new classes there is the DBDAO, and this is the way it obtains the connection:
          protected Connection conn = null;           ...             protected Connection getConnection()       {           try           {             if (conn == null || conn.isClosed())             {                     Context ctx = new InitialContext();                 javax.sql.DataSource ds=null;                     ds =(javax.sql.DataSource) ctx.lookup( "agespPool" );                     conn = ds.getConnection();                 conn.setAutoCommit(false);             }           }           catch (Exception ne)     ...
    Every new class that needs to access the db extends DBDAO and retrieves the conn with this method. In order to make things work without changing all the code, I modified the old class named 'Connessione' and made it extend DBDAO. Here is its method:
        public class Connessione extends DBDAO{     ...             public static synchronized Connection getConnessione() throws Exception {             return new Connessione().getConnection();         }
    That's all. Finished with the code.
    Now, if someone uses the new classes extending DBDAO, all goes well. But for some old function that still work with Connessione.getConnessione(), connection closes suddenly with no reason.
    For example, calling a page with some combo box populated with a db connection, you catch a:
        java.sql.SQLException: Connection has already been closed.             at weblogic.jdbc.wrapper.PoolConnection.checkConnection(PoolConnection.java:63)             at weblogic.jdbc.wrapper.ResultSetMetaData.preInvocationHandler(ResultSetMetaData.java:37)             at weblogic.jdbc.wrapper.ResultSetMetaData_oracle_jdbc_driver_OracleResultSetMetaData.getColumnType(Unknown Source)             at it.praxis.tim.agesp.pub.sql.PagingList.populate(PagingList.java:98)             at it.praxis.tim.agesp.pub.sql.PagingList.executeSQL(PagingList.java:53)             at jsp_servlet._jsp._todolist_new._richiesta.__listarichieste._jspService(__listarichieste.java:353)             at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
    or sometimes:
        - 20080417141147: <E> HtmlSelect.createHtmlSelect(4) - Errore!     java.sql.SQLException: Result set already closed     - 20080417141147: <E> HtmlSelect.createHtmlSelect(7) - Errore!     java.sql.SQLException: Connection has already been closed.     - 20080417141147: <E> ERRORE:  ricercaRichieste :     java.sql.SQLException: Statement has already been closed
    That is, the conn is closed while used to populate the combo box. I don't understand who closes it.
    Moreover, that happens randomly: 1 or 2 times over 4 hits on the page. The other times, all goes well. Most of the other pages, all goes well. So I don't think I have to search for a bug in the code.
    Now, I'm working with BEA WL 8.1 sp 5 and Oracle 9.2.0.1.0 .
    The error turns out even if I work locally (with Tomcat 5.5.23).
    The webapp made use of a custom driver beforehand, and I replaced it with oracle's driver.
    I tried to set the Connection Pool with oracle.jdbc.driver.OracleDriver and oracle.jdbc.OracleDriver .
    I left the default for the connection pool, and then tried to set (BEA):
    Connection Reserve Timeout: -1
    Test Created Connections: On
    with no changes.
    The connection suddenly and randomly closes.
    Any help would be appreciated...
    Many thanks

    the thing that you are instantiating isn't a Connection object, it's a Connessione object. That's returning one that's either been stashed from a previous call, or
    acquires one from the data sourcea new Connessione object means a call to getConnection that means a new Connection object. That code is synchronized, it has to be a new object.
    It is entirely possible that conn is not null if other actions have taken place in your constructor. Even assuming it is null, we don't know anything about the
    connection pool you're trying to use, though it looks like it's probably weblogic's one.The contructor doesn't know of the connection. As for the pool, it is weblogic's one.
    And even assuming both of these cases, we have no particular reason to believe that you're calling the getConnessione() method instead of accidentally calling
    getConnection() and thus no reason to believe that you're definitely carrying out the actions that you believe you're carrying out.I wrote that the problem comes out in the old code that once worked fine. That code only uses Connessione.getConnessione() .
    Conversely we have an error message that says you're closing connections elsewhere. Clearly there's a bug. It's presumably in your assumptions. You're
    arguing instead of checking them.If I have a wrapper logging the close() calls, I have to see every call logged. Even if there's a bug (but remember that the code worked fine with a previous custom datasource), why do you think I shouldn't see that close() logged?
    I may be wrong, but I already searched in that code. I'm arguing after all the checks.
    There is no other thread that can see that connHow do you know? I have that Connessione.getConnessione() in a jsp. It's synchronized. That gives a new connection. I see it passed only to an utility class that queries the db and reads the resultset.
    Who do you think can access that connection?

  • Connection has already been closed

    We are on Weblogic 7.0 SP1 on HP UX 11i. Database is Oracle ver 9.0.1.3. Using
    thin driver for database access.
    Intermittently we get the error: "Connection has already been closed" from DAO
    programs. The stack trace shows that this error is preceded by java.sql.SQLException:
    java.lang.NullPointerException. The error is appearing in the finally block when
    we attempt to close the connection if it is not null. Here's the code piece:
    finally {
    try {
    if(connection != null)
    connection.close();
    connection = null;
    } catch (SQLException sqlException) {
    log4j.error(sqlException.toString());
    What we are not able to understand is, this piece of code can be executed only
    if connection object is not null and if so, why this error - 'Connection has already
    been closed'?
    We noticed a bug reported in SP1:
    Bug No: CR062827
    Description : Fixed a problem with prepared statement code that was provoking
    a null pointer exception; the prepared statement object was being set to null.
    Our error message is preceded by Nullpointer Exception and there is a possibility
    that it could be from PreparedStatement due to this bug. But, BEA has not given
    information on what happens to Connection when Prepared Statement throw this exception.
    Whether any of you facing the same kind of problem?
    Thanks in advance,

    chitra wrote:
    Here's the stack trace:
    2003-01-24 10:24:32,510 ERROR [ExecuteThread: '5' for queue: 'default'] (TestDao.java:203)
    - java.sql.SQLException: java.lang.NullPointerException
    2003-01-24 10:24:32,511 ERROR [ExecuteThread: '5' for queue: 'default'] (TestDao.java:228)
    - java.sql.SQLException: Connection has already been closed.
    Sometimes, we also get a different stack trace:
    2003-01-24 10:24:21,171 ERROR [ExecuteThread: '5' for queue: 'default'] (TestDao.java:203)
    - java.sql.SQLException: Closed Statement: next
    2003-01-24 10:24:21,180 ERROR [ExecuteThread: '5' for queue: 'default'] (TestDao.java:228)
    - java.sql.SQLException: Connection has alredy been closed
    ThanksHi, that's not a stacktrace. That's just the error message. Please turn on jdbc logging and show me
    the jdbc log
    file. A full stacktrace will pe printed for every SQLException, showing all the method calls.
    thanks,
    Joe
    >
    >
    Joseph Weinstein <[email protected]> wrote:
    chitra wrote:
    We are on Weblogic 7.0 SP1 on HP UX 11i. Database is Oracle ver 9.0.1.3.Using
    thin driver for database access.
    Intermittently we get the error: "Connection has already been closed"from DAO
    programs. The stack trace shows that this error is preceded by java.sql.SQLException:
    java.lang.NullPointerException. The error is appearing in the finallyblock when
    we attempt to close the connection if it is not null. Here's the codepiece:
    finally {
    try {
    if(connection != null)
    connection.close();
    connection = null;
    } catch (SQLException sqlException) {
    log4j.error(sqlException.toString());
    What we are not able to understand is, this piece of code can be executedonly
    if connection object is not null and if so, why this error - 'Connectionhas already
    been closed'?Let me see the full stacktrace of the NullPointerException and the
    'Connection is already closed' exception.
    As to the code above, I'm not saying you're doing this, but if any code
    above that finally block closed the connection, then you can get the
    'already closed' exception. In other words, connection.close() doesn't
    automatically make the reference null.
    Joe
    We noticed a bug reported in SP1:
    Bug No: CR062827
    Description : Fixed a problem with prepared statement code that wasprovoking
    a null pointer exception; the prepared statement object was being setto null.
    Our error message is preceded by Nullpointer Exception and there isa possibility
    that it could be from PreparedStatement due to this bug. But, BEAhas not given
    information on what happens to Connection when Prepared Statement throwthis exception.
    Whether any of you facing the same kind of problem?
    Thanks in advance,

  • FB, LinkedIn and Twitter Error: Account has already been created

    I just bought my BlackBerry Classic from AT&T.  When I tried to set up my social media accounts - FaceBook, LinkedIn and Twitter by signing in, each of them said there was an error completing the set up and I should try again later.  When I returned later I got error "This account has already been created" for each of them. I deleted FB app and reinstalled it but got the same error.  I made sure I updated each app to the latest version but no luck.
    Has anybody else had similar problems?

    No I don't see those accounts in settings >> accounts. I only see email accounts there.

  • APP-FND-01929: This responsibility has already been assigned to this user

    Dear All,
    While adding a new responsibility in the User Screen, I am getting the following Error:
    APP-FND-01929: This responsibility has already been assigned to this user. Please eneter a different responsibility.
    But in the list of responsibilities this particular responsibility is not added before..
    What will be the cause of this problem..
    How can I overcome this situation.. Please update...
    Many Thanks in advance.....

    Hi,
    As per your other thread, I believe you have restored couple of tables from your backup and this is not supported. In order to have everything running properly, then a full database restore should be done.
    Unable to login to application..
    Unable to login to application..
    Regards,
    Hussein

  • Apple ID has already been created

    When trying to download or update an app I already have I'm getting the prompt "An Apple ID for (my Apple ID) has already been created." Options given are "Cancel" or "Retry". Resulting in me not being able to download or update. Please help.
    Using same Apple ID on multiple devices.

    Did you try a Soft Reset of your iPhone ...holding Seep button and Home button at the same time until Apple logo appears then waiting for your Lock Screen?

  • Error occurred in deployment step 'Add Solution': A feature with ID '' has already been installed in this farm. Use the force attribute to explicitly re-install the feature.

    Hi I am getting the error
    Error occurred in deployment step 'Add Solution': A feature with ID 10495515-2482-41fd-98eb-3c87f739f54b has already been installed in this farm.  Use the force attribute to explicitly re-install the feature.
    when trying to deploy web parts
    question 1 - how do i use the force attribute when deploying from visual studio
    question 2 - am i deplying it to the right place, if i deply it to the
    url:port that points to my central admin tool it deploys but i cant seem to see it in any of my webs in my site collection, if i deploy it to the
    url:port that points to my site collection I get this error.
    im new to all this by the way :)
    thanks in advance

    If you are deploying from Visual Studio then please follow this post:
    http://sharepointfordeveloper.blogspot.com/2014/03/solved-visual-studio-issue-error.html
    Open the visual Studio and navigate to the feature XML file and add the bellow attribute.
    AlwaysForceInstall="TRUE"
    The <FeatureName>.Template.Xml output would be some think link this.
    <?xml
    version="1.0"
    encoding="utf-8"
    ?><Feature
    xmlns="http://schemas.microsoft.com/sharepoint/"
    AlwaysForceInstall="TRUE"></Feature>

  • GetOutputStream() has already been called for this response

    I have a problem with my servlet,
    i compiled my code,it works normally but there is an error occured when it works.
    The error is :
    java.lang.IllegalStateException: getOutputStream() has already been called for this response
    *     at org.apache.catalina.connector.Response.getWriter(Response.java:607)*
    *     at org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:196)*
    *     at org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java:125)*
    *     at org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:118)*
    *     at org.apache.jasper.runtime.PageContextImpl.release(PageContextImpl.java:179)*
    *     at org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext(JspFactoryImpl.java:116)*
    *     at org.apache.jasper.runtime.JspFactoryImpl.releasePageContext(JspFactoryImpl.java:76)*
    *     at org.apache.jsp.KaptchaExample_jsp._jspService(KaptchaExample_jsp.java:209)*
    *     at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)*
    *     at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)*
    *     at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)*
    *     at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)*
    *     at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)*
    *     at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)*
    *     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)*
    *     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)*
    *     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)*
    *     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)*
    *     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)*
    *     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)*
    *     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)*
    *     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)*
    *     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)*
    *     at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)*
    *     at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)*
    *     at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)*
    *     at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)*
    *     at java.lang.Thread.run(Thread.java:534)*
    here is my code :
    Iterator iter = ImageIO.getImageWritersByFormatName(imageFormat);
    *          if( iter.hasNext() ) {*
    *          ImageWriter writer = (ImageWriter)iter.next();*
    *          ImageWriteParam iwp = writer.getDefaultWriteParam();*
    *          if ( imageFormat.equalsIgnoreCase("jpg") || imageFormat.equalsIgnoreCase("jpeg") ) {*
    *          iwp.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);*
    *          iwp.setCompressionQuality(imageQuality);*
    *          //writer.setOutput(ImageIO.createImageOutputStream(response.getWriter()));*
    *          IIOImage imageIO = new IIOImage(bufferedImage, null, null);*
    *          writer.write(null, imageIO, iwp);*
    *          response.flushBuffer();*
    please help me,would u give me a solutions for my problem..i really appreciate if you want to give a solution.
    Regards,
    Dany Fauzi

    Actually the stack trace indicates the the error is happening in KaptchaExample.jsp, not in a Servlet. I'm guessing that the code you've presented is in a scriptlet (i.e. inside the JSP in <% %> brackets). This is altogether the wrong place for it. JSPs are purely for generating HTML and to try and generate image responses in one is doomed to failure. Write a servlet class to generate your image file. If you want to embed a dynamically generated image in an HTML page, then you need to generate HTML which accesses the Servlet through the <img src=... tag, i.e. the browser retrieves the image data as a separate transaction.
    The immediate source of the crash is that the JSP already opened the output stream in order to write HTML output, so it's too late to try and open it for the writing of image data.

Maybe you are looking for

  • DVDs to iTunes....is it possible??? Please help!!

    Is there anyway that you can put movies from dvds on to iTunes, and then on to your iPod?? As I have recieved several DVD's for christmas, and it would be great if I could put them on to my iPod. If you can't do it this way, is there any other ways t

  • I verified my email, then went to sign in and I can not get past the Sign In.

    I need some help. I made an account and verified my email. I then went to sign-in and a box pops up saying I need to review my account. I go back to review it and it takes me to the support page. In other words... I can not get past the Sign In.

  • Lightroom 5 crashes every time I click on Preferences.

    Lightroom 5 crashes every time I click on Preferences. Tried reinstalling LR5, also deleting preferences.wfprefs and regenerating LR5 catalogue. Never seen problem with LR4 or 3. OS Windows 7 French with LR5 installed as English. What's the problem?

  • UpdateXML query rewrite with unstructured data?

    Hi, I'm currently loading unstructured, non-schema based XML and am trying to address some performance issues when I merge changes to a document. I currently read the document from the table, merge the changes using XQuery and save the document back

  • FCP using Matrox Codec?

    Hello all. New FCP user here. We just upgraded our two old Matrox Digisuite MAX NLE's and are now working with two FCP Quad G5 systems. Anyone else out there make the switch from Matrox to FCP? If so, did you have any luck transferring your old Matro