Using quartz in OC4J

Hi all,
i have an application with some scheduled tasks.
We use the quartz library to perform the scheduling and so we need to add the -userThreads option to the command for starting the application server.
The use of this option is dangerous for the stability of the server?
Is there any official (Oracle) document that explain this features?
Thanks in advance,
Nick

Yes you will need the -userThreads options (add this to the OC4J options) and there is one more catch.
I have some experience with J2EE applications using quartz that fail to stop if quartz is still running (so in the end the container is forced). Also I have seen issues with OC4J containers with startup problemens if rows remain in the quartz tables (if quartz starts up automagically when the OC4J is started).

Similar Messages

  • Quartz in OC4J: javax.naming.NamingException

    We are running Quartz inside OC4J.
    We start OC4J with -userThreads turned on (e.g. java -jar oc4j.jar -userThreads).
    When the Quartz Job fires we do a Context lookup from the inside the Quartz execute() method to find a JMS QueueConnectionFactory and a JMS Queue.
    We are getting the following error on the Context lookup:
    06/02/15 06:40:30 Not in an application scope - start OC4J with the -userThreads switch if using user-created threads
    06/02/15 06:40:30 javax.naming.NamingException: Not in an application scope - start OC4J with the -userThreads switch if using user-created threads
    06/02/15 06:40:30 at com.evermind.server.PreemptiveApplicationContext.getContext(PreemptiveApplicationContext.java:30)
    06/02/15 06:40:30 at com.evermind.naming.FilterContext.lookup(FilterContext.java:126)
    06/02/15 06:40:30 at com.evermind.server.PreemptiveApplicationContext.lookup(PreemptiveApplicationContext.java:42)
    06/02/15 06:40:30 at javax.naming.InitialContext.lookup(InitialContext.java:351)
    06/02/15 06:40:30 at timers.JmsEndpoint.createQueue(JmsEndpoint.java:404)
    06/02/15 06:40:30 at timers.JmsEndpoint.createQueueSender(JmsEndpoint.java:82)
    06/02/15 06:40:30 at timers.TaskQueueScheduler.execute(TaskQueueScheduler.java:149)
    06/02/15 06:40:30 at org.quartz.core.JobRunShell.run(JobRunShell.java:195)
    06/02/15 06:40:30 at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
    We have tried the oracle.j2ee.rmi.RMIInitialContextFactory and the oracle.j2ee.naming.ApplicationClientInitialContextFactory naming factories and get the same error with both.
    Any ideas?
    Thanks, Ed

    Avi
    I tried the default Context factory as you suggested and that didn't work either. I think the problem is related to the fact that Quartz is running on it's own thread within the same JVM as OC4J and may not have scope to the same Context object(s) that OC4J has.
    I did find a way to make this work. Before calling the Quartz Scheduler I used the OC4J Context object to lookup a JMS Queue and put the JMS QueueSender object into the Quartz JobDataMap object. I then scheduled the Quartz timer passing in the JobDataMap object. When the timer fires and my Quartz Job execute() method is called I retrieve the JMS QueueSender object from the JobDataMap and use it to send a JMS message.
    Thanks for your help,
    Ed

  • How to use the same OC4j server with different port number

    How to use the same OC4j server with different port numbers..?
    I have to OC4J installed on my machine on different hard disk drives....
    I want to be able to run both the server simultaneously..?
    is it possible ..it yes then how..?
    for that i have changed the port number of one server...
    but when i am trying to start the other server with different port number..it says that JVM -Bind already...
    Is there any clues...?
    Nilesh G

    In the config directory:
    default-web-site.xml: Change the port the HTTP listener listens on
    jms.xml: Change the port the JMS service listens on
    rmi.xml: Change the port the ORMI listener listens on.
    Or, you can add another web-site.xml file, and deploy your applications to 1 server, and bind the web applications to the different web sites. This way you only have to deploy your applications to 1 place.
    Rob
    Oracle

  • No way to use CMP in OC4J?

    Hi, it seems we can never user CMP in OC4J.
    OC4J does not support EJB-QL. So how can we implement the finder methods?
    1) One way is to put finder methods in ejb home interface, and add implementation (using direct JDBC) in bean class. But the server could not find the correnspondent finder methods even we match them; Also, if we use findBy*** in home interface, and use ejbFindBy***, it still does not work.
    2) Another option is to put finder method as an odinary business method in remote interface, and add implementation (using direct JDBC) in bean class. But, before we call this method, we must instantiate the bean by calling create() (without arguments, because we do not want to create record to db). We will get an error: Primary key was null.
    So it seems we can never use CMP in OC4J, until it supports EJB-QL.
    Thanks,

    I use CMP all the time. OC4J (since it is based on Orion) should generate certain finder queries (except for perhaps the WHERE clause that you may have to add yourself to the orion-ejb-jar.xml file) for you just by entering them in the home interface. You can do advanced finders as well. What you need is the proper documentation:
    Checkout:
    http://kb.atlassian.com/content/orionsupport/articles/finders.html
    http://kb.atlassian.com/content/orionsupport/articles/ejbfinderquery.html
    as good places to start. No JDBC necessary!
    Cheers
    Ray
    Hi, it seems we can never user CMP in OC4J.
    OC4J does not support EJB-QL. So how can we implement the finder methods?
    1) One way is to put finder methods in ejb home interface, and add implementation (using direct JDBC) in bean class. But the server could not find the correnspondent finder methods even we match them; Also, if we use findBy*** in home interface, and use ejbFindBy***, it still does not work.
    2) Another option is to put finder method as an odinary business method in remote interface, and add implementation (using direct JDBC) in bean class. But, before we call this method, we must instantiate the bean by calling create() (without arguments, because we do not want to create record to db). We will get an error: Primary key was null.
    So it seems we can never use CMP in OC4J, until it supports EJB-QL.
    Thanks,

  • How to use JMX with oc4j

    is there any document about how to use JMX with OC4J? the intention is that I would like to create an application, using JMX to manage OC4J, such dynamiclly adding connection pool, create data source. potentially, restart server, application ...
    is there any document about this?
    Thanks

    In addition to that, the documentation also has a section on accessing OC4J JMX/MBeans:
    http://otndnld.oracle.co.jp/document/products/as10g/101300/B25221_03/web.1013/b14433/mbeans.htm#sthref163
    The blog below also has examples, albeit from a Groovy perspective, but nonetheless, examples of how it can be done easily translated into Java:
    http://buttso.blogspot.com/search?q=jmx
    -steve-

  • Using Maven with OC4J libraries?

    Well its my turn for a return question to the fine folks on this forum.
    Is anyone out there using Maven with OC4J? I've been using it lately, but there's one area that I'd like to see ideas on how to best approach.
    <p>When developing Ant scripts to build projects, I typically create a j2ee.classpath PATH and add to it various jar files from the OC4J distribution.
    </p>
    <p>However in Maven, I'm not sure how to best approach this with the OC4J JAR files since several of them have declared dependencies in their META-INF/MANIFEST.MF Class-Path fields -- so they aren't really standalone JAR files. </p>
    Take a look at the j2ee/home/admin_client.jar file and its manifest.mf:
    <p>
    Class-Path: lib/adminclient.jar oc4jclient.jar ../../webservices/lib/wsserver.jar lib/ejb.jar
    lib/mx4j-jmx.jar lib/jmxri.jar lib/jmx_remote_api.jar lib/jaas.jar ../../lib/xmlparserv2.jar
    ../../oracle/lib/xmlparserv2.jar lib/javax77.jar lib/javax88.jar ../../diagnostics/lib/ojdl.jar
    ../../oracle/lib/dms.jar ../../oracle/jlib/dms.jar ../../lib/dms.jar ../../jlib/dms.jar lib/jta.jar
    lib/jms.jar lib/connector.jar ../../opmn/lib/optic.jar ../../oracle/jlib/oraclepki.jar ../../jlib
    oraclepki.jar ../../oracle/jlib/ojpse.jar ../../oracle/jdbc/lib/ojdbc14dms.jar ../../oracle/jdbc/lib
    ocrs12.jar ../../oracle/rdbms/jlib/aqapi.jar ../../jlib/ojpse.jar</p>
    So if I want to make use admin_client.jar in a maven project, I really need all the other libraries it in turn references -- and they are all specified as relative paths. If I wanted to load admin_client.jar into a local Maven repository, how would it be done? How would these paths be expressed/maintained?
    -steve-

    Kristen:
    You can use iPhoto Library Manager to copy that album to one library so that all of the files will be in one library to use.
    with iPLM you can split libraries up by roll or album or both. Jusgt figure out which library which albums will belong to.
    Do you Twango?
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've written an Automator workflow application (requires Tiger), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.

  • How to use quartz to integrate a standalone application in a webserver

    Can anyone help me in using quartz where i need to integrate a java standalone application into the webserver..I am developing an application using jsp and as part of a task i had created a standalone application in java and now i need to integrate this standalone application into the webserver because it needs to run as a webapplication.

    Hai sam,You gave us many valuable suggestions in the past.We tried all of those methods to make our application run as per scheduled but we failed.We have not yet tried the servlet method,which you suggested in your last reply. Actually we tried to use the os scheduler for this purpose and couldn't do it at the end.So can you suggest the way in which we have to write the servlet and invoke it. We dont need all the details.Just give us the idea of what this servet contains actually and how it works.We will try to do it.Thank you,

  • How to use quartz in web applications

    Hi people,
    Can anyone please help me out how i can use quartz scheduler in web applications ? I want to utilize quartz to update databases periodically and automatically. Please help me its urgent ...:(

    Hi
    I have a requirement to implement Quartz in a we application.Technologies using as JSF, spring, hibernate and server is JBOSS. Here i am unable to decide how to implement quartz using these technologies.
    What is the methodology i have to use to implement quartz along with these technologies.

  • Error when use JAXB on OC4J

    I had encountered error when use JAXB on OC4J.
    Following error occur when executing following code :
    JAXBContext jc = JAXBContext.newInstance("itdoc");
    java.lang.IncompatibleClassChangeError: Implementing class
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
    3)
    at com.evermind.naming.ContextClassLoader.defineClass(ContextClassLoader
    .java:1102)
    at com.evermind.naming.ContextClassLoader.findClass(ContextClassLoader.j
    ava:365)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
    at com.evermind.naming.ContextClassLoader.loadClass(ContextClassLoader.j
    ava:135)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
    at com.sun.xml.bind.ContextFactory.createContext(ContextFactory.java:27)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
    java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:100)
    at javax.xml.bind.ContextFinder.searchcontextPath(ContextFinder.java:233
    at javax.xml.bind.ContextFinder.find(ContextFinder.java:153)
    at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:281)
    at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:238)
    at com.ctihk.itdoc.ListDocAction.execute(Unknown Source)
    at org.apache.struts.action.RequestProcessor.processActionPerform(Reques
    tProcessor.java:484)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja
    va:274)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:148
    2)
    at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletReque
    stDispatcher.java:721)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(Ser
    vletRequestDispatcher.java:306)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpReques
    tHandler.java:767)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.ja
    va:259)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.ja
    va:106)
    at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExec
    utor.java:797)
    at java.lang.Thread.run(Thread.java:536)
    --------------- linked to ------------------
    javax.xml.bind.JAXBException: Provider com.sun.xml.bind.ContextFactory could not
    be instantiated: java.lang.IncompatibleClassChangeError: Implementing class
    - with linked exception:
    [java.lang.IncompatibleClassChangeError: Implementing class]
    at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:118)
    at javax.xml.bind.ContextFinder.searchcontextPath(ContextFinder.java:233
    at javax.xml.bind.ContextFinder.find(ContextFinder.java:153)
    at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:281)
    at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:238)
    at com.ctihk.itdoc.ListDocAction.execute(Unknown Source)
    at org.apache.struts.action.RequestProcessor.processActionPerform(Reques
    tProcessor.java:484)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja
    va:274)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:148
    2)
    at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletReque
    stDispatcher.java:721)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(Ser
    vletRequestDispatcher.java:306)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpReques
    tHandler.java:767)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.ja
    va:259)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.ja
    va:106)
    at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExec
    utor.java:797)
    at java.lang.Thread.run(Thread.java:536)

    If you are using JDeveloper then remove the following file:
    <JDEV_HOME>\j2ee\home\jaxb-rt-1.0-ea.jar
    <JDEV_HOME> is the location where you have JDeveloper installed.
    When you compiled your classes, you compiled them with JAXB 1.1 libraries in the JWSDP 1.3.
    When you were running your classes within JDeveloper, OC4J looked at the jaxb-rt-1.0-ea.jar library before looking at the libraries in WEB-INF\lib, causing the IncompatibleClassChangeError.
    Hope this helps.
    Derek Sedlmyer

  • Setting a deployment context when using the embedded OC4J

    I'm trying to debug a servlet using the embedded OC4J server. I have a simple project that includes a servlet source file and and a web.xml file. The web.xml file defines context
    parameters that I want the servlet to read and use when it is deployed. However I don't know
    how to get JDeveloper to set up the servlet context on the debugging environment to use the
    contents of the web.xml file. Could anyone tell me how to do this? I cannot see how to
    do this from the help files.
    Many thanks in advance

    The trick is to ensure that you use a 'Project with Web Module' rather than
    'Empty Project' and then add a new 'HTTP Servlet'. When you do this
    JDeveloper automatically creates a web.xml file. You can add context
    parameters, or practically any other configuration items by right clicking
    on the web.xml tree node inthe system navigator and selecting settings.
    The web.xml file is saved into the directory specified by the 'HTML Root Directory' on the 'Input Paths' panel in the project settings dialog.

  • How to use quartz jobscheduling framework

    how to use quartz job scheduling framework to send mails to a recipint when he places an order.
    give idea abt how it is going to detect the placing of order.is there any listener to detect that
    Edited by: sivaprasadrao on Jun 30, 2008 3:15 AM

    Hi,
    How does he places an order ?. It may be some block of your code. Include your mail function in that block.
    Regards,
    Ram.

  • Deploying using ant to oc4j 10.0.3

    We previously deployed our application using ant to OC4J 902.
    Now we try to deploy to OC4J 10.0.3 but it seems that
    com.evermind.client.orion.OrionConsoleAdmin doesn't exist anymore.
    Could someone plz tell me by what it is replaced ?
    I found com.evermind.client.orion.OrionConsoleAdmin but i'm not shure of this is the right one

    Actually, I'd recommend that you not use the direct classname in your ant scripts (it's not really a public class) and instead fork off a Java process to run the public admin.jar utility. If Oc4JAdminConsole is ever changed, using admin.jar insulates you from it.
    It's basically the same, just runs the Jar file instead.
    <target name="deploy" depends="core">
    <java jar="${j2ee.home}/admin.jar" fork="yes">
    <arg value="${oc4j.deploy.ormi}"/>
    <arg value="${oc4j.deploy.username}"/>
    <arg value="${oc4j.deploy.password}"/>
    <arg value="-deploy"/>
    <arg value="-file"/>
    <arg value="${this.build}/${this.ear}"/>
    <arg value="-deploymentName"/>
    <arg value="${this.application.name}"/>
    </java>
    </target>
    See http://radio.weblogs.com/0132383/stories/2004/03/16/antDeploymentToOc4j.html
    for examples to do undeployent and webbindings.
    cheers
    -steve-

  • Want to use a different OC4J sometimes is that possible

    Hi- I am using the embedded OC4J Server that comes with JDeveloper and
    now that I have installed Oracle Application Server Infrastructure
    as well as midtier. I just wanted to find out how I could point
    my JDeveloper project to run on the OC4J of the Oracle AS that I
    have just installed instead of using the embedded one that comes
    with JDeveloper
    other then that is it possible to use different OC4J when I run the index.xml from JDeveloper...

    thanks it works now... the only i have now is that I am trying to search for a web service puttin in ab% as the criteria for IBM UDDI v2 Registry and I get the following error:
    A Soap Exception occured
    There may be a problem with a a registry
    and in the exception stack trace I get:
    oracle.jdevimpl.webservices.uddi.model.UDDIModelException: Unsupported response content type "text/html", must be: "text/xml". Response was:
    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <html><head>
    <title>301 Moved Permanently</title>
    </head><body>
    <h1>Moved Permanently</h1>
    <p>The document has moved here.</p>
    </body></html>
    at oracle.jdevimpl.webservices.uddi.model.UDDIRegistry.findTModel(UDDIRegistry.java:770)
    at oracle.jdevimpl.webservices.uddi.wizard.find.SelectTModel$TModelSearchRunner.runSearch(SelectTModel.java:251)
    at oracle.jdevimpl.webservices.uddi.util.SearchRunner$SearchRunnable.run(SearchRunner.java:131)
    at java.lang.Thread.run(Thread.java:534)

  • Anyway to use quartz to schedule jobs without EJB

    Hai all,
    I had a web application in jsp where i need to send automatic mails at regular intervals of time.For this scheduling process i had decided to use quartz. But i had too develop some ejb's for this purpose.As i am using tomcat server it's not possible for me to use EJB's. So is there any other way i can use quartz without ejb's to run a scheduled task?.
    I request your kind help and suggestions in this regard.
    Thank you.

    According to the iPod nano (5th generation) - User Guide you can video tape in landscape or portrait mode. By default, it is oriented in portrait mode (240x376), but due to an accelerometer, automatically switches to landscape mode (376x240) when rotated.
    When I hold the cam vertically, the recorded videos are sometimes in portrait mode with borders but not always. When I hold the cam horizontally (landscape), the recorded videos are always borderless.
    Which way are you holding the camera when you get videos with borders?

  • How can I use mySQL with OC4J

    Hello,
    I have standalone OC4J and I want to use mySQL database (Oracle is no problem). My data-sources.xml for application (not global data-sources) is:
    <data-sources>
    <data-source class="com.evermind.sql.DriverManagerDataSource"
         connection-driver="org.gjt.mm.mysql.Driver"
         ejb-location="jdbc/MG_DBDS"
         inactivity-timeout="30"
         location="jdbc/MG_DBCoreDS"
         name="MG_DBDS"
         password=""
         pooled-location="jdbc/MG_DBPooledDS"
         url="jdbc:mysql://127.0.0.1:3306/test"
         username="root"
         xa-location="jdbc/xa/MG_DBXADS"/>
    </data-sources>
    Deploy return me:
    Error initializing data-source 'jdbc/MG_DBCoreDS': DriverManagerDataSource driver 'org.gjt.mm.mysql.Driver' not found
    Then I run this command:
    java -jar %OC4J_HOME%\admin.jar ormi://192.168.1.14:23791/ admin heslo -application Register -updateDataSource -oldLocation jdbc/MG_DBCoreDS -jar mysql-2.0.11-bin.jar
    this action is success and create in OC4J folder lib with jar file mysql-2.0.11-bin.
    When I use this configuration in application, I get connection but creating Statement cause SQL Exception - No suitable driver.
    When I try to restart OC4J, I get the same message as throught deploy - Error initializing data-source ...
    What is go wrong???? Could me help anyone?
    Thanks
    Libor

    pooling solution:
    1) put driver mysql.jar into any directory wich described in OC4J application.xml file like
    " <library path="D:\j2ee\home\lib">jdev-generated</library>"
    2) put a new datasource in data-sources.xml:
    <data-sources>
    <data-source name="MySqlDS"
    location="jdbc/MySqlDS"
    class="com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource"
    max-connections="100"
    min-connections="5"
    inactivity-timeout="200"
    wait-timeout="10"
    username="scott"
    password="tiger"
    url="jdbc:mysql://localhost:3306/oln?useUnicode=true"/>
    </data-sources>
    OC4J needs a special pooling class in comparision with other containers. For example, JBoss has own implementation of pooling broker, so pooling is enabled by default.

Maybe you are looking for

  • Using apple id on multiple devices

    My wife and I use the same IPAD. We both have Iphones, can we use either of our apple id's on that Ipad?

  • New iMac G5. Is it ok?

    I'm going to be getting a new iMac G5 2.0Ghz this week. I am ready the blogs about the imac and have a few worries about its visual stability. Please could I have some constructive adive about this machine. So I won't go make a mistake! I am updradin

  • Cache Seeding ibot. Where is the button.

    Guys, I think I am blind. The checkbox is not there.......? I have done that ibot a million times now but..where is the checkbox now. Did I forget something? The user is admin in the repository.

  • Using tar command to copy faster

    Hi, I want to copy the apps directories and subdirectories to another location on same machine for cloning purpose. I know this can be achieved using tar command. Will you pls send me the tar command to archive and copy at the same time using pipe "|

  • Would this drive fit in my quad core 2010 mac pro?

    I would be using this drive with windows as Apple does not support blu-ray. http://www.amazon.co.uk/LG-BH10LS30-AUAR10B-Internal-BDRW-Retail/dp/B0035FF066/r ef=wlit_dpo?ie=UTF8&coliid=I1AE1HQQ3Z2XCC&colid=3JEKXYVUZW51O