Commons DBCP problem

Hi friends,
I am implementing the Commons DBCP package in one of my JSP pages.
This is the scenario :
In my CATALINA_HOME/common/lib I have the files :
commons-dbcp-1.1.jar
commons-pool-1.1.jar
commons-collections.jar
I have set the CLASSPATHS in my Environment variables to the appropriate JARs.
I have added a Context to my server.xml file as :
<!-- Context for Connection Pooling -->
<Context path="/CPool" docBase="CPool" debug="5" reloadable="true" crossContext="true">
<Logger className="org.apache.catalina.logger.FileLogger" prefix="localhost_CPool_Log." suffix=".txt" timestamp="true"/>
<Resource name="jdbc/test_dsn" auth="Container" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/test_dsn">
<parameter>
          <name>factory</name>
          <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
     </parameter>
     <parameter>
          <name>maxActive</name> <!-- To set maximum number of active users -->
          <value>0</value> <!-- 0 is for no limit -->
     </parameter>
     <parameter>
          <name>maxIdle</name> <!-- Set maximum number of idle connections retained in the pool -->
          <value>0</value> <!-- 0 is for no limit -->
     </parameter>
     <parameter>
     <name>maxWait</name> <!-- Maximum time(ms) to wait for a dB connection to become available -->
          <value>10000</value> <!-- Set -1 to wait indefinitely : here 10 seconds. -->
     </parameter>
     <!-- MySQL dB username and passwords -->
     <parameter>
          <name>username</name>
          <value></value>
          <name>password</name>
          <value></value>
     </parameter>
<!-- Class name for mm.mysql JDBC driver -->
     <parameter>
          <name>driverClassName</name>
          <value>org.gjt.mm.mysql.Driver</value>
     </parameter>
     <!-- JDBC connection url for the MySQL Database -->
     <parameter>
          <name>url</name>
          <value>jdbc:mysql://localhost:8080/omamconsultants_com?autoreconnect=true</value>
     </parameter>
     </ResourceParams>
</Context>
and I have made a new web.xml file in my CPool/WEB-INF directory as :
<web-app>
<description> MySQL Test Application for Connection Pooling.</description>
<!-- Resource reference added by Sherbir to implement Connection Pooling -->
<resource-ref>
     <description>Connection Pooling</description>
     <res-ref-name>jdbc/test_dsn</res-ref-name>
     <res-type>javax.sql.DataSource</res-type>
     <res-auth>Container</res-auth>
</resource-ref>
</web-app>
Finally, I have made a JSP to access the database table as :
<%
int i=0;
try
Context ctx = new InitialContext();
     if (ctx == null)
          throw new Exception("No Context available");
     DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/test_dsn");
     if (ds != null)
          Connection con = ds.getConnection();
          if (con != null)
               System.out.println("Connection " + con.toString() + " established.");
               Statement stmt = con.createStatement();
               ResultSet rs = stmt.executeQuery("SELECT * FROM t_sherbir");
               while (rs.next())
                    System.out.println("Fetching record " + (i+1) + " from table...");
               con.close();
catch(Exception e) {}
%>
But when I run the program, I am getting this error :
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 18 in the jsp file: /CPool/pool2.jsp
Generated servlet error:
[javac] Compiling 1 source file
C:\jakarta-tomcat-4.1.29\work\Standalone\localhost\examples\CPool\pool2_jsp.java:76: cannot resolve symbol
symbol : class DataSource
location: class org.apache.jsp.pool2_jsp
     DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/test_dsn");
^
An error occurred at line: 18 in the jsp file: /CPool/pool2.jsp
Generated servlet error:
C:\jakarta-tomcat-4.1.29\work\Standalone\localhost\examples\CPool\pool2_jsp.java:76: cannot resolve symbol
symbol : class DataSource
location: class org.apache.jsp.pool2_jsp
     DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/test_dsn");
^
2 errors
     at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:130)
     at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:293)
     at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:353)
     at org.apache.jasper.compiler.Compiler.compile(Compiler.java:370)
     at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:473)
     at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:190)
     at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
     at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
     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.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
     at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:494)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
     at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
     at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
     at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:193)
     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)
     at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)
     at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:589)
     at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:666)
     at java.lang.Thread.run(Thread.java:536)
So any1 has an idea where I'm going wrong ?
Please help immediately.

It seems to be a simple issue :). You need to import the relevant classes in your JSP file. To access the data source the following classes need to be imported.
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.sql.DataSource;
You also need to import JDBC related classes - ResultSet, Statement etc.

Similar Messages

  • Tomcat 4.1 Oracle Blob problem using apache commons DBCP

    Hi all,
    We are using Tomcat 4.1.12, Java 1.4.x and trying to take advantage of the connection pooling that comes with Tomcat(the apache commons DBCP).
    We are connecting to a oracle database.
    Works fine for everything EXCEPT Blobs. We have a servlet that serves images from Oracle, that works fine when it doesn't use the connection pooling, but throws an exception when we call the
    ERROR: Class:DisplayGraphic Method:processRequest(HttpServletRequest request, Ht
    tpServletResponse response)
    Exception: org.apache.commons.dbcp.DelegatingResultSet
    DataSource ds = (DataSource)ctx.lookup("jdbc/db_connection");
    Connection conn = ds.getConnection();
    PreparedStatement pstmt = null;
    ResultSet rs = null;
    pstmt = conn.prepareStatement("SELECT graphic FROM graphics WHERE graphic_id = 1");
    rs = pstmt.executeQuery();
    if(rs.next())
        oracle.sql.BLOB oBlob = ((OracleResultSet) oRS).getBLOB("GRAPHIC");
        InputStream oIS =  oBlob.getBinaryStream();
        ... etc etc...
    }Any ideas?
    Cheers,
    Alex.

    solved the problem.. i was using getBLOB instead of
    getBlob
    doh..Hi Alex,
    your problem is very interesting for me because I have a similar problem and your identical configuration...
    the instruction
    oracle.slq.BLOB aBlob = ((OracleResultSet)super.mRs).getBLOB("BLOBBONE")
    causes this:
    java.lang.ClassCastException: org.apache.commons.dbcp.DelegatingResultSet
    To resolve this, I changed, in server.xml , the factory
    <parameter>
                        <name>factory</name>
                        <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
                   </parameter>
    with:
    <parameter>
    <name>factory</name>
    <value>oracle.jdbc.pool.OracleDataSourceFactory</value>
    </parameter>          
    and magically all works fine...
    But the question is... Why doesn't it work with the standard factory???
    There is a problem in the CLASSPATH that I don't see?
    Any suggestions is welcome!
    Thanks in advance!
    Giselda

  • Does anyone have a link to common bugs/problems encountered with flex 3?

    Hi,
    does anyone have a link to common bugs/problems encountered
    with flex 3, just so i can try and familarise myself before I go
    asking etc? thanks folks!!

    flex warnings:
    http://livedocs.macromedia.com/flex/2/langref/compilerWarnings.html
    flex errors
    http://livedocs.macromedia.com/flex/2/langref/compilerErrors.html

  • Answers to common Bridge problems.

    Here are user-submitted answers to common Bridge problems.
    I invite all suggestions to addition/corrections/improvements.

    Bumped. I'll convert to document once it will be possible to do so. I have great addendum by CurtY:
    Windows and Mac FAQ and Translation Key
    Keystrokes
    ALT on a Pc = Option on a Mac (On some keyboards (UK), the Option key is labeled with Alt. )
    CTRL (Control) on Pc = Cmd (Command) on a Mac, the key has the following symbol: ⌘
    Right-click on a Pc = Right-click on a Mac, or Control+Click on machines without a mouse.
    Menu differences
    Preferences (CMD+K) are found on the Photoshop menu on a Mac, at the bottom of the Edit menu on a PC, and the shortcut is (CTRL+K).
    On the same Photoshop menu on a Mac, one can find About Plug-ins... and About Photoshop, while they are located on the Help menu on a PC.
    Quit Photoshop (CMD+Q) is also on that Photoshop menu on a Mac, while Exit (CTRL+Q) can be found at the end of the File menu on a PC.
    Preferences location on the hard drive. There is a full document on that topic: http://kb2.adobe.com/cps/828/cpsid_82893.html
    but basically: The main preference file, is on both plaform  Adobe Photoshop CSx Prefs.psp it is located, alongside most other preferences on:
    Mac location: Users/[user name]/Library/Preferences/Adobe Photoshop CSx Settings
    Windows XP: Documents and Settings/[user name]/Application Data/Adobe/Adobe Photoshop CSx/Adobe Photoshop CSx Settings
    Windows 7 and Vista: Users/[user name]/AppData/Roaming/Adobe/Adobe Photoshop CS5/Adobe Photoshop CSx
    Settings Keywords
    pc = C:/Users/user name/AppData/Roaming/Adobe/BridgeCSx/  (note: to view AppData  turn on hidden file option)
    Mac = (your computer name)/ Library / App Support / Adobe / Bridge CSx / Adobe
    Camera Raw location  NOTE:  Should be only one file here.
    PC = Program Files/COMMON Files/Adobe/Plug-ins/CSx/File Formats which gives you Camera Raw.8bi
    Mac = /Library/Application Support/Adobe/Plug-ins/CSx/File Formats/
    Photoshop Actions
    Mac -  Actions (not saved) Actions panel.psp  Users/[user name]/Library/Preferences/Adobe Photoshop CSx Settings
    Mac -  Actions (saved) Actions panel.atn   Program Files/Adobe Photoshop CSx(64bit)/presets/actions
    PC -  Actions (not saved) Actions panel.psp  Users/[user name]/AppData/Roaming/Adobe/Adobe Photoshop CS5/Adobe Photoshop CS5 Settings
    PC -   Actions (saved) Actions panel.atn   Program Files/Adobe Photoshop CSx(64bit)/presets/actions

  • Common newbie problems

    This list might help some people:
    What is a common newbie problem/question and what is a simple solution?
    Example:
    Q. Why do I get a java.lang.NoClassDefFoundError when I try to run my app from the command prompt?
    A. Use java -cp . MyClass

    The topics named at http://pjt33.f2g.net/javafaq/ are the ones which seemed to me to crop up most often. (Which reminds me - I really should get on with finishing that FAQ).

  • Using commons dbcp in SOA 8 for connection pool?

    Hi there,
    It is possible to use commons dbcp in SOA 8 for connection pool ing?
    At far I tried SOA 8 does not work either Mckoi and AS400 databases jdbc drivers in a connection pool.
    So having the experience with Tomcat and commons-dbcp with successfull connection pools, I am trying to use a alternative database connection pool, or use SOA8 connection pool using commons-dbcp and it with our AS400 db.
    Do you think it is possible?
    Thanks for your input!
    Lorenzo Jimenez

    I am really lost.
    All I know i that I used this jtopen driver on tomcat with and without connection pool.
    I used the same parameters, but SOA implementation or program is different. Maybe is the 1.4 api, maybe is the jdbc expected.
    Really don't know.
    What I know I as400 and mckoi drivers don't work where in Tomcat work ok.
    Please check this thread with the error that SOA gave to me
    http://forum.java.sun.com/thread.jsp?forum=136&thread=524472&tstart=0&trange=15
    Thanks,
    Lorenzo

  • Apache Commons DBCP issue

    Hi,
    I am using commons-dbcp.1.2.jar file in my web application. but whenever I start the soa suite, I get the following exception.
    java.lang.NoSuchMethodError: org.apache.commons.dbcp.BasicDataSource.setInitialSize(I)V
    After researching some, I saw two different versions of dbcp jar files in soa suite installation and orabpel.jar also contains all the classes from commons dbcp.
    Can some body tell me which version of dbcp it uses because it does not contain the above method.
    I tried changing the shared libraries in the server.xml and include the new jar file but I guess it is loading the orabpel.jar before any thing else.
    How do I use newer version of dbcp?
    Thanks

    I would strictly isolate your web appplication classes from other classes. Put your commons-dbcp.1.2.jar into WEB-INF/lib and set prefer-web-inf-classes element to true in weblogic.xml. prefer-web-inf-classes will ensure that your application libraries precede system libraries (orabpel.jar in this case) while SOA Suite should not see your commons-dbcp.1.2.jar and should start properly.
    http://download-llnw.oracle.com/docs/cd/E13222_01/wls/docs100/webapp/weblogic_xml.html#wp1059286

  • HP Printer Support Videos for Common Printer Problems

    The HP Support Forum shows many questions about print quality issues, paper jams, carriage jams, paper pick-up issues, and test page questions. The videos in the linked playlists below were created to show the steps to fix common printing problems for your HP printer. Each playlist contains multiple videos that pertain to the topic. Be sure to choose the video that applies to your topic and model number if applicable. The printer models are included in the title of the videos. Fixing Print Quality IssuesFixing Paper JamsFixing Carriage JamsFixing Paper Pick-Up IssuesPrinting a Test Page If you have further questions, please visit our YouTube Channel, HP Printer Support. The creators of these videos are the subject matter experts. I am just sharing the videos to help solve common printing problems.

    What does "hard error" mean?  How can I fix it.  My HP 4500 Officejet wireless printer is not printing when it says "printing" and further inquiry tells me there is a "hard error".  I have tried the usual plug and unplug.  

  • Common screen problem while playing games in Windows 7 x64

    When I start games like Red Alert2 and alot others, the game doesn't show properly as some times the screen goes black or the buttons or menues doesn't show at all
    Some other forums adviced to make these steps
    Right click on Desktop
    Select Screen Resolution
    Click Detect (with no additional monitor connected)
    Next to your first display, you'll see a grey square with the text "Another display not detected" Click on the grey square
    Next to "Multiple displays" it will say "No display detected"
    Click on "No display detected"
    A drop-down menu will appear
    Select "Try to connect anyway on: VGA"
    Click on your primary display (the square with the big "1" in it)
    Next to "Multiple displays" select "Extend these displays"
    I tried these steps and every thing is going fine,  but the annoying problem is that I have to change the display settings each time I run a game and when I'm done playing I have to change them back, since of "Extended displays" order
    In earlier windows versions it worked totally with no problems and even on Windows 8.1 x64
    What would be the error here?
    What should I do instead of all this jam? Is there any Hotfixes?
    Note: I have two video cards running Intel HD graphics and Nvidia Geforce
    ***Update :The problem also exists in Windows 8.1 x64

    Hi Maen Abdulhaq,
    “When I start games like Red Alert2 and a lot others”, ” I don't think that this is a manufacturer problem since it's very common to all those having windows 7 x64 and trying to play such games”
    Did this issue occur in the whole games or just the Red Alert2 in your machines ?
    “unfortunalety windows compatibility settings”
    Have you tried in windows 98 or lower compatibility mode, please ensure you have choose run as an administrator?
    Apart from this ,I recommend you to try this method.
    create a shortcut of "Yuri.exe" (or "Game.exe" if running normal RA2), and place it on the desktop. Open the properties, and in the target line add "-dxlevel 8" to the end. It should look like this (or similar if you're directories
    are different).
     "C:\Program Files (x86)\EA Games\Command & Conquer The First Decade\Command & Conquer Red Alert(tm) II\RA2\YURI.exe" -dxlevel 8
    Meanwhile,  entering Intel HD Graphics control panel (via Windows Control Panel or right-clicking the desktop) and enter Power section. Choose "High performance" mode.
    If the issue persists, I recommend you to disable one graphic card from the device manager to have a check considering you have two graphic cards.
    Best regards

  • File upload using apache Commons FileUpload problem

    Hi All,
    I have used Commons FileUpload for uploading files from windows to unix machine. I'm able to upload files but I have a problem about the contents of file copied in unix. When i upload files few files containing special characters are not copied correctly in unix instead ascii codes are getting copied/written. Seems to be a problem with character encoding.
    For example symbol "�" is not getting copied correctly in unix. So as new line character to. If anyone has faced such issues kindly provide few pointers on this. Appreciate your guidance.
    Thanks,
    -Aj

    Thanks for the reply.
    I'm using the Commons FileUpload class "FileItem" which holds the filestream data and using function
    code snippet of file upload
    ServletFileUpload servletFileUpload = new ServletFileUpload(new DiskFileItemFactory());
    List fileItemsList = servletFileUpload.parseRequest(request);
    Iterator it = fileItemsList.iterator();
    while (it.hasNext())
         FileItem fileItemTemp = (FileItem)it.next();
         File saveToFile = new File("newFile");
          fileItem.write(saveToFile ); // write fileItem data to saveToFile.
    } FileItem object takes care of writing data to disk.No idea,how it does internally.
    Thanks,
    -Aj.

  • Struts, log4j, commons-logging problems in 9.0.4 too??

    ok... I have a J2EE project that uses struts, log4j, a couple ejbs. I can successfully deploy and run on JBoss. However, our client insists that we use the 10g App Server, so I tried to deploy on 10g v10.1.2 (after making the appropriate changes to the deployment descriptors); the ear file deployed without problems, but when using the application, I encountered the following error when the app got to part of my code that tries to create a log file using the commons-logging framework:
    java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
    I see from these forums that there is a known problem regarding commons-logging and log4j with v10.1.2 (Help: 10g, struts, commons-logging and log4j doesn't work in 10g!? 9i fine! )..... so, I installed v9.0.4 of the 10g AppServer, deployed and ...... drum roll please.... I get the same error.
    The commons-logging.jar file IS in the [application dir]/WEB-INF/lib directory so the app should be finding the org.apache.commons.logging.LogFactory class file. And - struts is working based on page navigation prior to hitting the error (which I've heard indicates that the commons-logging.jar library is being invoked at some point).
    So... am I missing something? or does v9.0.4 also have the bug (related to classloaders)???
    sure hope someone can help....
    Scott

    I don't know why it's not working either, unless it's related to that classloader issue.... I have the following files in my WEB-INF/lib directory:
    commons-beanutils.jar
    commons-collections.jar
    commons-digester.jar
    commons-logging.jar
    commons-validator.jar
    jakarta-oro.jar
    log4j-1.2.9.jar
    struts.jar
    ScottsTester-ejb.jar (my ejb classes)
    ScottsTester-web.jar (my struts-related classes)
    I'm running into problems when the app tries to create an instance of my ejb (which has as a member variable an org.apache.commons.logging.Log object which is created by the org.apache.commons.logging.LogFactory object - the Oracle App Server is telling me it can't find the LogFactory class despite the fact that the commoons-logging.jar file is in the WEB-INF/lib directory.... and, as other postings have noted, this appears to be a problem with the classloaders. Unfortunately, the workaround suggesting by Qiang causes problems with my ejbs - when I try to get a home object, I encounter a ClassCastException somewhere in the PortableRemoteObject.narrow(o, DbConnectionHome.class); call..... maybe Oracle should stick to databases.....

  • Commons lang problems

    Hi there!
    Sorry if I post this in the wrong section. But I was unsure of which to choose so I took the most general.
    To my problem. I want to use commons lang (http://commons.apache.org/lang/) but I cant make it work. I made a simple testclass to show you the problem:
    import org.apache.commons.lang.builder.ToStringBuilder;
    public class Person
      private String name;
      private int age;
      public Person(String name, int age)
        this.name = name;
        this.age = age;
      public String getName()
        return name;
      public void setName(String newName)
        this.name = newName;
      public int getAge()
        return age;
      public void setAge(int newAge)
        this.age = newAge;
      public String toString()
        return new ToStringBuilder(this)
          .append("name", name)
          .append("age", age)
          .toString();
      public static void main(String[] args)
        Person p = new Person("Peter", 23);
        System.out.println(p);
    }And this is the output from when I run it:
    *$ javac -classpath /usr/share/java/commons-lang.jar Person.java && java Person*
    Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/lang/builder/ToStringBuilder
         at Person.toString(Person.java:36)
         at java.lang.String.valueOf(String.java:2615)
         at java.io.PrintStream.print(PrintStream.java:616)
         at java.io.PrintStream.println(PrintStream.java:753)
         at Person.main(Person.java:45)

    *$ javac -classpath /usr/share/java/commons-lang.jar Person.java && java -classpath /usr/share/java/commons-lang.jar Person*
    Exception in thread "main" java.lang.NoClassDefFoundError: PersonI have also tried with:
    CLASSPATH="/usr/share/java/commons-lang.jar" javac Person.java && java Person

  • Common Queue Problem

    Hi all,
    I have a messaging queue on my server side. I am using this queue for an asynchronous operation on server side. My problem starts when I want to listen this queue on client side. I am getting the following exception when i try to listen same queue;
    javax.jms.JMSException: A message listener is already registered
    Yes its right i assigned a listener by creating a MD bean
    How can i listen this common queue from client side too ?
    Thank you for your attention,
    My Regards

    Hi,
    Hanging PL/SQL jobs and hanging external jobs need to be treated differently.
    - hanging pl/sql jobs are typically associated with a real background session which is hanging and issues can be tracked down using normal tools/methods to track down oracle hangs (see what sql statement is being run, see what locks are being held/waited on etc).
    - hanging external jobs may be the result of a hanging script or may be hanging because the external job never returned results. Both of these issues are covered in the post on running external jobs here
    Guide to External Jobs on 10g with dbms_scheduler e.g. scripts,batch files
    First check whether the script is running (look through the process list for the name of the script or the commands that the script runs).
    If it is, then you need to debug the script itself or you may be running into the bug where the scheduler hangs on large amounts of stderr (fixed in version 10.2.0.2) in which case you should redirect stderr to a file.
    If nothing is running then you should check your permissions, in particular, the user that the job runs as must have execute access on $ORACLE_HOME/bin and all parent directories. So for e.g. if your $ORACLE_HOME is /opt/oracle/db then you would have to make sure that
    chmod a+rx /opt
    chmod a+rx /opt/oracle
    chmod a+rx /opt/oracle/db
    chmod a+rx /opt/oracle/db/bin
    Hope this helps,
    Ravi.

  • Common GL problems & solutions

    Hello SAP Gurus,
    Can you please tell me common help desk problems in the following transactions and their simple solutions:
    1) FB03
    2) FBS1
    3) F-02
    4) FB50
    5) FBL3N
    6) F.81
    7) FB08
    I would award points generously for every help
    Many thanks

    Hi,
    I’m writing some common error messages and solutions, as you told it is required for training the Level1 helpdesk support team. Hope it is useful.
    1) For FB03  - Document number,Company code and fiscal year is a unique combination. So, if either of this is not matching it might give error as
    i) Doc No.xxx does not exist in fisc. yr.
    ii) Doc No. xxx does not exist in Comp code, etc.
    2) For FBS1 –
    i)  It might give error message as “Reason xx does not permit a later reversal”. Ans- In that case, Reversal reason has to be changed which allows reversal at a later date.
    ii) “Account type K does not exist for Doc type Dx” Ans- In that case the Doc type has to be changed to Kx type.
    iii) “G/L account xxxxxxx does not exist” Ans- The existing G/L account should be entered, OR a new G/L a/c to be created using FS00 depending on the client requirements with due approvals.
    3) For F-02 –
    i) “G/L account xxxxxxx does not exist” Ans- The existing G/L account should be entered, OR a new G/L a/c to be created using FS00 depending on the client requirements with due approvals.
    ii) “Reference field is not filled”. Ans- some reference no. has to be given.
    4) For FB08 –
    i) “Doc No. xxx does not exist in Co. code xxxx”. Ans- Doc. No existing in correct co. code and fiscal yr. is to be selected.
    ii) “Make an entry in all required fields” Ans- Might be Reversal Reason is not entered.
    5) For F.81-
    i) “Make an entry in all required fields” Ans- Might be Reversal Reason is not entered.
    ii) “Doc No. does not exist in Co. code xxxx”. Ans- Correct doc no. to be entered.
    Please award points if you find it to be useful.
    Thanks and regards,
    Prithwiraj
    [email protected]

  • Commons FileUpload problem

    Hello. I want the user to be able to upload a file, and then I want to read the file and do some stuff with it.
    I searched around and found out that to do this I needed to use a third party library. I found the Commons FileUpload, but I cant seem to make it work. I tried to use the mailing list, but I have gotten no respons.
    In the jsp
    ***uploadPhoto.jsp ***
    <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
    <%@ page import="org.apache.commons.fileupload.*"%>
    <%@ page import="org.apache.commons.fileupload.servlet.*"%>
    <%@ page import="org.apache.commons.fileupload.portlet.*"%>
    <%@ page import="org.apache.commons.collections.*"%>
    <%@ page import="java.util.*"%>
    <%
         boolean isMultipart = ServletFileUpload.isMultipartContent(request);
         out.println("" + isMultipart);
    //      Parse the request
         FileItemIterator iter = upload.getItemIterator(request);
         while (iter.hasNext()) {
             FileItemStream item = iter.next();
             String name = item.getFieldName();
             InputStream stream = item.openStream();
             if (item.isFormField()) {
                 out.println("Form field " + name + " with value "
                     + StreamUtil.asString(stream) + " detected.");
             } else {
                 out.println("File field " + name + " with file name "
                     + item.getName() + " detected.");
                 // Process the input stream
    %>The first line returns true. So I know I have a file. But the next one I get an error saying "Cannot find type FileItemIterator.
    I tried to include as much libraries as I thought needed, but still the same error.
    I have put the commons fileupload jar in my WEB-INF/lib directory, and also in my application.jar file.
    Can someone help me please?
    Message was edited by:
    asgshe

    Yes I found this out right before you posted it.
    I think the documentation is very poor. No where did
    it say that I needed this. Luckily I read a post here
    that someone had suggested this.I have to disagree on that! It is mentioned here: http://jakarta.apache.org/commons/fileupload/using.html and here: http://jakarta.apache.org/commons/fileupload/dependencies.html
    Where else should they mention it?

Maybe you are looking for