Invoking a java class while server start up

Hi,
I want to invoke a java class/method immediately after a web server is started. Can any body tell me how to do this.
Regards,
Prakash

It is easy.
Write a serlvet, lets call it ConfigServlet that handles the configuration parameters of a web-application.
My GenericConfigServlet looks like this:
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Enumeration;
import java.util.Map;
import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;
public class GenericConfigServlet extends HttpServlet
     private static final long serialVersionUID = 1L;
     public void init(ServletConfig config) throws ServletException
          super.init(config);
          ServletContext sCtx = getServletContext();
          ServletConfig sCfg = getServletConfig();
            String prefix =  sCtx.getRealPath("/");
            synchronized (this)
               Enumeration initParams = sCfg.getInitParameterNames();
               String key, value;
               GenericConfigProperties.setApplicationBasePath(prefix);
               while (initParams.hasMoreElements()) {
                    key = (String) initParams.nextElement();
                    value = sCfg.getInitParameter(key);
                    GenericConfigProperties.setProperty(key,value);
}Then in your web.xml, you write like this:
<servlet-name>ConfigServlet</servlet-name>
          <servlet-class>GenericConfigServlet</servlet-class>
          <init-param>
               <param-name>LICENSES</param-name>
               <param-value>1</param-value>
          </init-param>
          <init-param>
               <param-name>TMP_DIRECTORY</param-name>
               <param-value>C:\\temp\\</param-value>
          </init-param>
          <init-param>
               <param-name>INPUTFILE</param-name>
               <param-value>C:\\temp\\_input.txt</param-value>
          </init-param>
          <load-on-startup>0</load-on-startup>
     </servlet>You can add any number of init-param-tags.
The important thing is the element <load-on-startup>0</load-on-startup>. This tells the webserver to load this servlet first. A lower number is loades before a higher so if you have a servlet that you want to load but you need the configuration to be done first, that servlet definition should read <load-on-startup>1</load-on-startup>.
Of course, you can do anything you want in the init-method. This is just one way of doing it.
Message was edited by:
Lajm
Additionals...
Message was edited by:
Lajm
Hideing company name... ;-)

Similar Messages

  • How to load a java class at server start-up

    Hi,
    I have one custome java class that is being referenced by all the applications deployed in OC4J container. How can I load that class automatically and be evailable in the path at server start-up time. Is there an option available to give the class name that also gets loaded automatically.
    Thanks

    To me, you have two mixed issues.
    1. OC4J supports a startup/shutdown model where a named class will be invoked when the container is started (or stopped).
    This is described in the doc here:
    http://download-west.oracle.com/docs/cd/B32110_01/web.1013/b28952/startclas.htm#CIHECEIB
    Note that this specifically calls the methods that are implemented from the respective OC4JShutdown and OC4JStartup interfaces -- the class that is instantiated and called here is not available to all other applications by default. This is more to suit the need where something needs to be done when the container is started/stopped.
    2 The next option is where you just want to make a class available to all applications deployed to the container. For this we provide the shared-library mechanism. Using this you can either make use of the implicit global.libraries shared-lib in which you simply drop JAR files into the j2ee/home/applib directory whereupon the classes will become available by default to all applications. Or you can choose to install a shared-library that contains your specific classes (in a JAR file) and then import that into the default application whereupon the configuration will be inherited by all deployed applications.
    cheers
    -steve-

  • [EJB:015001]Unable to link class while server start up.

    I am getting the below exception during weblogic server start up.
    In the server under autodeploy folder there exist a class - AccountCacheLoaderMDB. I clue less, what is the cause for this exception. Can anyone help me out in solving this issue please,its urgent
    <Jun 2, 2011 10:23:01 AM EDT> <Error> <Deployer> <BEA-149205> <Failed to initialize the application 'gts' due to error weblogic.application.ModuleException: Exception preparing module: EJBModule(autodeploy)
    [EJB:011023]An error occurred while reading the deployment descriptor. The error was:
    Error processing annotations: ..
    weblogic.application.ModuleException: Exception preparing module: EJBModule(autodeploy)
    [EJB:011023]An error occurred while reading the deployment descriptor. The error was:
    Error processing annotations: .
         at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:454)
         at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93)
         at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:387)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:58)
         Truncated. see log file for complete stacktrace
    weblogic.utils.ErrorCollectionException:
    There are 1 nested errors:
    weblogic.j2ee.dd.xml.AnnotationProcessException: [EJB:015001]Unable to link class sepact.sepact-app.com.citi.gts.alto.accountservice.service.AccountCacheLoaderMDB in Jar C:\Oracle\user_projects\domains\base_domain\autodeploy : java.lang.NoClassDefFoundError: sepact/sepact-app/com/citi/gts/alto/accountservice/service/AccountCacheLoaderMDB (wrong name: com/citi/gts/alto/accountservice/service/AccountCacheLoaderMDB)
         at weblogic.j2ee.dd.xml.BaseJ2eeAnnotationProcessor.addProcessingError(BaseJ2eeAnnotationProcessor.java:1272)
         at weblogic.j2ee.dd.xml.BaseJ2eeAnnotationProcessor.addFatalProcessingError(BaseJ2eeAnnotationProcessor.java:1277)
         at weblogic.ejb.container.dd.xml.EjbAnnotationProcessor.processAnnotations(EjbAnnotationProcessor.java:168)
         at weblogic.ejb.container.dd.xml.EjbDescriptorReaderImpl.processStandardAnnotations(EjbDescriptorReaderImpl.java:332)
         at weblogic.ejb.container.dd.xml.EjbDescriptorReaderImpl.createReadOnlyDescriptorFromJarFile(EjbDescriptorReaderImpl.java:192)
         at weblogic.ejb.spi.EjbDescriptorFactory.createReadOnlyDescriptorFromJarFile(EjbDescriptorFactory.java:93)
         at weblogic.ejb.container.deployer.EJBModule.loadEJBDescriptor(EJBModule.java:1210)
         at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:382)
         at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93)
         at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:387)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:58)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:42)
         at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:609)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
         at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:185)
         at weblogic.application.internal.SingleModuleDeployment.prepare(SingleModuleDeployment.java:40)
         at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:154)
         at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
         at weblogic.deploy.internal.targetserver.AppDeployment.prepare(AppDeployment.java:141)
         at weblogic.management.deploy.internal.DeploymentAdapter$1.doPrepare(DeploymentAdapter.java:39)
         at weblogic.management.deploy.internal.DeploymentAdapter.prepare(DeploymentAdapter.java:187)
         at weblogic.management.deploy.internal.AppTransition$1.transitionApp(AppTransition.java:21)
         at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:233)
         at weblogic.management.deploy.internal.ConfiguredDeployments.prepare(ConfiguredDeployments.java:165)
         at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:122)
         at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:173)
         at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:89)
         at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
         at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
         at weblogic.j2ee.dd.xml.BaseJ2eeAnnotationProcessor.addProcessingError(BaseJ2eeAnnotationProcessor.java:1271)
         at weblogic.j2ee.dd.xml.BaseJ2eeAnnotationProcessor.addFatalProcessingError(BaseJ2eeAnnotationProcessor.java:1277)
         at weblogic.ejb.container.dd.xml.EjbAnnotationProcessor.processAnnotations(EjbAnnotationProcessor.java:168)
         at weblogic.ejb.container.dd.xml.EjbDescriptorReaderImpl.processStandardAnnotations(EjbDescriptorReaderImpl.java:332)
         at weblogic.ejb.container.dd.xml.EjbDescriptorReaderImpl.createReadOnlyDescriptorFromJarFile(EjbDescriptorReaderImpl.java:192)
         Truncated. see log file for complete stacktrace
    >
    ===============================================================
    Here is the message driven bean.
    package com.xxx.gts.alto.accountservice.service;
    import com.xxx.gts.alto.accountservice.adapter.AccountAdapter;
    import com.xxx.gts.alto.accountservice.util.AccBeanUtil;
    import com.xxx.gts.alto.accountservice.util.AccountConstants;
    import com.xxx.gts.alto.accountservice.util.AccountLoader;
    import org.apache.log4j.Logger;
    import org.springframework.beans.factory.BeanFactory;
    import javax.ejb.ActivationConfigProperty;
    import javax.ejb.EJB;
    import javax.ejb.MessageDriven;
    import javax.ejb.TransactionAttribute;
    import javax.ejb.TransactionAttributeType;
    import javax.ejb.TransactionManagement;
    import javax.ejb.TransactionManagementType;
    import javax.jms.Message;
    import javax.jms.MessageListener;
    import javax.jms.TextMessage;
    * MDB for the Account Cache Loader.
    @MessageDriven(mappedName = "AccountCacheLoaderQueue", activationConfig = {@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),@ActivationConfigProperty(propertyName = "destinationName", propertyValue = "AccountCacheLoaderQueue")})
    @TransactionManagement(value = TransactionManagementType.CONTAINER)
    @TransactionAttribute(value = TransactionAttributeType.NOT_SUPPORTED)
    public class AccountCacheLoaderMDB implements MessageListener {
    private static Logger logger = Logger.getLogger(AccountCacheLoaderMDB.class.getName());
    private static final String LOCAL_ADAPATER = AccBeanUtil.getProperty(AccountConstants.ADAPTER_ID);
    private static final String TOKEN_SEPARATOR = ","; // \\s
    @EJB
    private BeanFactory beanFactory;
    public void onMessage(Message message) {
    logger.debug("Entering onMessage of AccountCacheLoaderMDB");
    try {
    if (message instanceof TextMessage) {
    TextMessage tmsg = (TextMessage) message;
    String[] msgArr = tmsg.getText().split(TOKEN_SEPARATOR);
    logger.debug("Trying to get AccountAdapter");
    AccountAdapter acctAdapter = (AccountAdapter) beanFactory.getBean(LOCAL_ADAPATER);
    if (acctAdapter == null) {
    throw new RuntimeException("Account Adapter cannot be determined.");
    for (String msg : msgArr) {
    if (msg.equalsIgnoreCase(AccountConstants.ACC_RELOAD)) {
    logger.debug("Calling AccountLoader.load");
    AccountLoader.load(acctAdapter);
    } else if (msg.equalsIgnoreCase(AccountConstants.BIC_RELOAD)) {
    logger.debug("Calling AccountLoader.loadBicData");
    AccountLoader.loadBicData(acctAdapter);
    } catch (Exception e) {
    logger.error("Error while loading Account.", e);
    throw new RuntimeException(e);
    logger.debug("Exiting onMessage of AccountCacheLoaderMDB");
    can any one throw some light please...its urgent

    Your class seems to be in the wrong folder structure.
    instead of sepact/sepact-app/com/citi/gts/alto/accountservice/service/ it needs to be in com/citi/gts/alto/accountservice/service/ which matches the folder structure.

  • How to invoke a Java class located outside of  BPEL PM server?

    I konw the way of invoking the Java class deployed in BPEL PM server by using WISF binding. But now I have a legacy Java Application located in another Appache Server.I hope the BPEL process can invoke this legacy Java Application. How should I do?
    Anybody can help me?
    Kind regard
    Qu

    You can use axis to create a webservice out of this class, or do the same with oracle jdeveloper - remote class mean remote protocol..
    /clemens

  • Trying to invoke a Java class from BPEL Proces using Java Embedding

    Hi All,
    I have a requirement to invoke a Java class from the BPEL process;
    I am trying to import the class by "* <bpelx:exec import="+package_name.classname+"/>*.
    But, while compiling, I get the following error:
    "Error(19,57): Failed to compile bpel generated classes. failure to compile the generated BPEL classes for BPEL process "BPEL_PROCESS_NAME" of composite "default/COMPOSITE_NAME!1.0"
    The class path setting is incorrect. Ensure that the class path is set correctly. If this happens on the server side, verify that the custom classes or jars which this BPEL process is depending on are deployed correctly. Also verify that the run time is using the same release/version."
    Referred the scac.log:
    SAXParseException in file +project_path+\composite.xml
    org.xml.sax.SAXParseException: <Line 29, Column 32>: XML-24535: (Error) Attribute 'http://www.w3.org/XML/1998/namespace:id' not expected.
         at oracle.xml.parser.v2.XMLError.flushErrorHandler(XMLError.java:422)
         at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:287)
         at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:335)
         at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:318)
         at oracle.soa.scac.ValidationFaultUtil.validateStreamWithSchema(ValidationFaultUtil.java:146)
         at oracle.soa.scac.ValidationFaultUtil.validateCompositeWithSchema(ValidationFaultUtil.java:120)
         at oracle.soa.scac.ValidateComposite.validateWithSchema(ValidateComposite.java:1480)
         at oracle.soa.scac.ValidateComposite.doValidation(ValidateComposite.java:519)
         at oracle.soa.scac.ValidateComposite.main(ValidateComposite.java:223)
    May 19, 2010 6:46:29 PM com.collaxa.cube.CubeLogger info
    INFO: LibClasspath=E:\Softwares\OracleFMW\jdeveloper\..\oracle_common\modules\commonj.sdo_2.1.0.jar;E:\Softwares\OracleFMW\jdeveloper\..\oracle_common\modules\oracle.fabriccommon_11.1.1\fabric-common.jar;E:\Softwares\OracleFMW\jdeveloper\..\oracle_common\modules\oracle.xdk_11.1.0\xmlparserv2.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\orabpel-common.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\orabpel-exts.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\orabpel-thirdparty.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\orabpel-validator.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\orabpel.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\fabric-client.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\fabric-ext.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\fabric-runtime.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\oracle.soa.fabric.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\soa-infra-tools.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.ext_11.1.1\./classes
    May 19, 2010 6:46:37 PM com.collaxa.cube.CubeLogger info
    INFO: validating "RHMEDIInboundProcess.bpel" ...
    May 19, 2010 6:46:37 PM com.collaxa.cube.CubeLogger warn
    WARNING: CubeProcessor.compileGeneratedClasses() classpath is: E:\Softwares\OracleFMW\jdeveloper\jdev\extensions\oracle.sca.modeler.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\fabric-runtime.jar;E:\Softwares\OracleFMW\oracle_common\modules\oracle.fabriccommon_11.1.1\fabric-common.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\orabpel.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.mediator_11.1.1\mediator_client.jar;E:\Softwares\OracleFMW\oracle_common\modules\oracle.mds_11.1.1\mdsrt.jar;C:\JDeveloper\mywork\InboundEDI_RnD\parseInboundEDIXML\classes\com\onerheem\integration\EDIInboundProcess\parseInboundEDIXML.jar;;C:\JDeveloper\mywork\InboundEDI_RnD\RHMEDIInboundProcess\SCA-INF\classes;C:\JDeveloper\mywork\InboundEDI_RnD\RHMEDIInboundProcess\SCA-INF\classes;C:\JDeveloper\mywork\InboundEDI_RnD\RHMEDIInboundProcess\SCA-INF\gen-classes;E:\Softwares\OracleFMW\jdeveloper\..\oracle_common\modules\commonj.sdo_2.1.0.jar;E:\Softwares\OracleFMW\jdeveloper\..\oracle_common\modules\oracle.fabriccommon_11.1.1\fabric-common.jar;E:\Softwares\OracleFMW\jdeveloper\..\oracle_common\modules\oracle.xdk_11.1.0\xmlparserv2.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\orabpel-common.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\orabpel-exts.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\orabpel-thirdparty.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\orabpel-validator.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\orabpel.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\fabric-client.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\fabric-ext.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\fabric-runtime.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\oracle.soa.fabric.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\soa-infra-tools.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.ext_11.1.1\./classes
    Any suggestions to rectify the same?

    Hi,
    I wud suggest you to make a jar of ur java class and include it in the project libraries of BPEL and make use of java embedded activity this way it works.
    have a luk at below link:
    http://niallcblogs.blogspot.com/search/label/embedded%20Java

  • How do you invoke custom java classes???

    Could someone post a detailed method of invoking custom java classes that works including what files go where, settings and the way it is invoked etc.
    I have tried various ways from this forum and in the documentation without success. I am using IDM 8. I found these instructions regarding how you would do it if you were writing custom resource adaptors in the deployment tools guide:
    To install a resource adapter you’ve customized:
    1. Load the NewResourceAdapter.class file in the Identity Manager installation
    directory under
    idm/WEB-INF/classes/com/waveset/adapter/sample
    (You might have to create this directory.)
    2. Copy the .gif file to idm/applet/images.
    This .gif file is the image that displays next to the resource name on the List
    Resources page, and it should contain an image for your resource that is
    18x18 pixels and 72 DPI in size.
    3. Add the class to the resource.adapter property in
    config/waveset.properties.
    4. Stop and restart the application server. (For information about working with
    application servers, see Identity Manager Installation.)
    I tried the instructions here but placed my custom class in a folder entitled custom instead of /adapter/sample. Not sure about instruction 3 or whether it is relevent. Anyway nothings working.
    Edited by: masj78 on Nov 25, 2008 3:50 AM
    Edited by: masj78 on Nov 25, 2008 4:03 AM

    Hi,
    The way to add custom class is the same as you followed , put them in the WEB-INF/classes.
    To use the custom adapter ,
    Go To Resources - > Configure Types -> Add Custom Resource .
    Type in the fully qualified class name of the custom adapter you added.and Save.
    Now the new adapter you added should showup in the list of available adapters when you try to
    configure a new adapter.
    (Make sure that the prototype XML of your custom adapter is correct so that it displays the correct name / type for the adapter in the adapter list.
    Thanks,
    Balu

  • How to invoke a java class dynamically?

    Hi all,
    In my usecase I need to invoke a java class dynamically using any of the components like Button or link in jdeveloper.
    How could we invoke a java class which has a main method in it dynamically.
    Kindly come up with your help.
    Thanks,
    Phani.

    public class BackingBean {
    public BackingBean() {
    super();
    public void cb3_action() {
    File fileObj = new File("C:\\Jdeveloper software\\new.doc");
    IDocument myDoc = new Document2004();
    myDoc.addEle(Heading2.with("===== Headings ======").create());
    myDoc.addEle(Paragraph.with("This doc has been generated by the unit test testJava2wordAllInOne() in the class DocumentTest2004Test.java.").create());
    Table tbl = new Table();
    tbl.addTableEle(TableEle.TH, "Name", "Number of gols", "Country");
    tbl.setRepeatTableHeaderOnEveryPage();
    tbl.addTableEle(TableEle.TD, "Arthur Friedenreich", "1329", "Brazil");
    tbl.addTableEle(TableEle.TD, "Pele", "1281", "Brazil");
    myDoc.addEle(tbl);
    PrintWriter writer = null;
    try {
    writer = new PrintWriter(fileObj);
    } catch (FileNotFoundException e) {
    e.printStackTrace();
    String myWord = myDoc.getContent();
    writer.println(myWord);
    writer.close();
    Hi john,
    these are my Backing bean and action now at the run time when I am pressing a button which has to invoke cb3_action() method.
    When I am clicking the button at the runtime I am getting the below error
    Error 500--Internal Server Error
    javax.faces.el.EvaluationException: java.lang.NoClassDefFoundError: word/w2004/Document2004
         at org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:51)
         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
         at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
         at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
    In the above code if you observe I have used "IDocument myDoc = new Document2004();" line. Here this Document2004 is a class which is in one of the external
    jar files. xstream-1.3.1.jar , java2word-3.0_2011Aug02.jar , log4j-1.2.15.jar .
    these are the jar files I found in net using which I can create a word file and add all the components like table and format the txt etc..
    These jar files works in Tomcat, Jboss ,Struts
    I can even run this class and got the file created.
    But when I try to bind the method in ADF i am getting the error mentioned above.
    Kindly help me on this. Sorry for posting similar question two times on the blog.
    Sorry again if this question is wierd.
    Thanks,
    Phani.

  • Is it possible to invoke a Java class from Data Services 4.0?

    Is it possible to invoke a Java class from Data Services? I have a query transform with a varchar column which I want to run an external java class against to encrypt the string value. In the Management Console, I created an adapter of type TestAdapter and referenced my jar file in the Classpath section, but when I create a Datastore of type Adapter I can't import any functions related to my java class? It seems like I need to create a new Adapter type similar to the TestAdapter with the 'Adapter Class' set to my java class? I can't figure out how to do this - which is the correct approach and is there some documentation available? thanks!

    First u nees to imoprt the class which u are doing right
    then u need to call the function of the class , and then you can put the value in a string .
    DbCon.function()
    String data = DbCon.db;
    where db is a string in DbCon
    Cheers
    Varun Rathore

  • Instantiating Java class while WAS is starting

    Is there a possibility to register Java classes within the SAP WAS which will be instantiated while the server starts up?

    Hi,
    to be honest, I have only a rough idea - may be you can emulate this behaviour  by  a web application, where in the deployment descriptor the load-on-startup flag is set ?
    Barbara

  • Error while server start up

    Hi am getting the following error while server startup for CRS application, please help me out. All the files are OOTB, i didnt made any changes to the files.
    2011-08-05 15:07:34,152 ERROR [nucleusNamespace.atg.dynamo.messaging.MessagingManager] (InputDestinationConsumer-sqldms:/sqldms/DSSTopic/DisableScenarioEvents) An error occurred while trying to receive and deliver a Message for input port "DisableProcessEvents" with destination "sqldms:/sqldms/DSSTopic/DisableScenarioEvents" of MessageSink with nucleus name "/atg/scenario/ScenarioManager" and message id "ID:10063"
    java.lang.ClassCastException: atg.process.dms.InstanceTimerMessage cannot be cast to atg.process.dms.DisableProcessMessage
         at atg.process.ProcessManagerService.receiveMessage(ProcessManagerService.java:11370)
         at atg.process.ProcessManagerService.receiveMessage(ProcessManagerService.java:11305)
         at atg.dms.patchbay.ElementManager.deliverMessage(ElementManager.java:294)
         at atg.dms.patchbay.InputPort.onMessage(InputPort.java:168)
         at atg.dms.patchbay.InputDestination.onMessage(InputDestination.java:375)
         at atg.dms.patchbay.InputDestinationConsumer.processMessageDelivery(InputDestinationConsumer.java:479)
         at atg.dms.patchbay.InputDestinationConsumer.runXATransactions(InputDestinationConsumer.java:349)
         at atg.dms.patchbay.InputDestinationConsumer.run(InputDestinationConsumer.java:223)
         at java.lang.Thread.run(Unknown Source)

    The message you see seem to indicate a problem while starting logging threads. You might want to check if you have some appserver processes running. If you do kill them and try to restart your appserver instance.
    You can also check if you have log rotation set incorrectly or some third party logging enabled(i.e log4j) that might prevent appserver startup.

  • How to invoke a java class during UCM 10gR3 startup ?

    I am integrating AD4J (Application Diagnostic for Java) with UCM (Universal Content Management , earlier stellent) to monitor my UCM's JVM.
    This is very simple configuration where I have to add java class (jamagent.jamrun) in my UCM's startup program. This class (jamagent.jamrun) is in zip file ad4jagent.zip which I have added in classpath via intradoc.cfg
    JAVA_CLASSPATH_ad4j=$SHAREDDIR/classes/jamagent.zip
    Issue now is that I am unable to find java [content_server_startup_class] so can't add class jamagent.jamrun .
    As per my understanding : idcserver_start -> idcserver_ctr -> Launcher.sh -> Launcher (This launcher is executable)
    I am unable to understand where or how can I invoke jamagent.jamrun class with my UCM startup ?

    Java-code in a custom component could be triggering on a filter event that occurs during the startup of UCM, like extraAfterConfigInit. Would that be sufficient for loading yourAD4J?
    Other than that, it is my understanding that every jar that you put in the classes folder of UCM is loaded on startup.
    I hope this helps.
    Regards,
    Wim

  • Invoking remote java classes/methods

    Hi,
    I just wanted to ask for opinions and suggestions regarding my attempt to call a remote java class method using PL/SQL. I didn't want to load it in the database since the configurations for the java class were already set using Spring Integration. I just wanted to supply constructor arguments and run the method and then retrieve the result. Are there any good or easier ways on doing this?
    Thanks in advance

    Very curious Susan,
    A server JVM might not want to host mobile code from other clients, not that it's unsafe, it's just that it allows clients to crash the server JVM at will. They should have it configured to automatically restart though.
    Did they delete the java.rmi.* packages from the server JVM runtime? I don't understand why they'd do that.
    If you can pry some reasons from them, I'd be very interested to hear them. Perhaps they just want more money, in order to allow you this privilige.
    John
    PS I've updated representation for you, and ejp, on the cajo project supporting The Land Down Under!

  • How to invoke a Java class constructor in Forms

    I want to Run this ( http://persiancalendar.sourceforge.net/) Persian calendar in forms. I am using Forms 10g Rel 2 (Forms [32 Bit] Version 10.1.2.0.2 (Production))
    I did this:
    (1.) Downloaded the 2 Jar files persiancalendar.jar and icu4j_3_2_calendar.jar
    (2.) Deployed jar files in forms\java
    (3.) Added entries in FORMS_BUILDER_CLASSPATH and formsweb.cfg
    (4.) The 2 jar files get loaded to the JAR cache when form runs.
    Now, in order to invoke the Persian calendar according the documentation you have to invoke the constructor in class PersianCalendar.
    PersianCalendar() Constructs a Persian calendar with the default time zone and locale.
    In Forms the FBean package can invoke only methods. I tried combinations of inputs but without any success.
    According to the documentation this is the only class to create a calendar. All other classes are either utilities or get/set methods.
    How can I do this?

    PersianCalendar() is the constructor of the class; it will be invoked when you instantiate the class. This happens when you register your bean at runtime (assuming you are talking about the FBean Package):
    http://www.oracle.com/webapps/online-help/forms/10g/state?navSetId=_&navId=3&vtTopicFile=enhancedjavabean/enjbs_registerjavabean.html&vtTopicId=
    But I'd opt for a wrapper; you might even want your own class extending PersianCalendar to make some customizing of the calendar.
    cheers

  • How to invoke java class automatically at a fixed time everyday

    How to invoke a java class automatically using Quartz scheduler or any other simplified way
    I am trying to schedule a job in my web application and need to understand conceptually How to make it work using quartz . The job is scheduled to be executed at 4 pm daily. Am testing the same and It works well when i run it as standalone application manually.
    How to configure it that when i start my aplication it should run at its own through quartz.
    I am avoiding use of servlet init method and java timer though any alternatives there?
    Thanks for your help.

    I've not see quartz... are you in Windows, Solaris, Linux, or Mac?
    Are you using JAR files or class files?
    Windows: javaw myClass (I cannot remember right off if you have to have the .class on the end)
    Windows: java -jar myJAR.jar
    Solaris java -jar myJAR.jar
    Linux java -jar myJAR.jar
    Mac?

  • Invoking java class

    HI ALL,
    i'm invoking a java class in fault handling framework(ora-java) but i'm getting the following error:
    "AnnotatedNoClassDefFoundError" has been thrown.
    Missing class: com.oracle.bpel.client.config.faultpolicy.sample (wrong name: sample)
         Dependent class: com.oracle.bpel.client.config.faultpolicy.sample
         Loader: oracle.bpel.common:10.1.3
         Code-Source: /D:/product/10.1.3.1/OracleAS_1/bpel/system/classes/
         Configuration: in /D:/product/10.1.3.1/OracleAS_1/j2ee/oc4j_soa/config/server.xml
    The missing class is not available from any code-source or loader in the system.
    i have placed the class file in oracleas_home/bpel/system/classes/com/oracle/bpel/client/config/faultpolicy/sample.class.
    help me in solving this problem.
    Thanks

    You must create a .jar file and place this file in the bpel classpath of the server.

Maybe you are looking for

  • How to capture the value in buffer

    Hi, In VA01, when I change name of ship to party. Want to compare changed with name in ztable. But when I change the name it will be in buffer.So how to do this? Is there any function module  to caputure the value in buffer. Please suggest me. Regard

  • Restart a process or message in SXMB_MONI with status "Cancelled Manually"

    SDN Crew, This is query regarding the BPM process. I have cancelled a process in MONI manually, Now i want to restart the process... If i try to restart the process, it throws an error "only messages with error could be restarted and messages already

  • Can't download .jar and .jad via Bluetooth to Sony Ericsson phone?

    I have a standard Sony Ericsson K610i. I tried to transfer the manifest, the .jad and the .jar via Bluetooth. The manifest transferred fine but the .jad and the .jar cannot be transferred. Is there some certificate stuff that you have to do and how d

  • Disable button when text field is empty

    Hi How can I disable a button in JDialog box when the text field is empty and enable it when the user gives some input. Balaap

  • Constant Verify Certificate Message in Mail

    Hi Forum, in mail on my Mac Mini i get a constant message of: Verify Certificate The Identity of "Server" cvannot be verified. the server it mentions is an old email i used to use but now dont. Its been deleted from my accounts and doesntr exist. I c