This discussion is archived
10 Replies Latest reply: Dec 12, 2012 2:15 AM by webyildirim RSS

Using EJB with Hibernate on Weblogic Server ADF platform

webyildirim Newbie
Currently Being Moderated
Hi all,
We use Jdeveloper 11.1.1.4 and WLS 10.3
I tried to use Hibernate on my project according to this link well, EJB with Hibernate On Weblogic
I wanto use Hibernate tool because toplink and eclipselink can not achieve the issue about generating update* ddl on schema, they can just only re-create the tables -not real update.

Firstly i got the related jars from internet: http://www.2hotfile.com/di-LSBU.png
cglib-2.2
antlr-2.7.6
commons-collections-3.1
dom4j-1.6.1
hibernate3
hibernate-validator-4.1.0.Final
javassist-3.9.0.GA
jta-1.1
slf4j-api-1.5.11
slf4j-nop-1.5.11

Then i added to model project as library dependencies: http://www.2hotfile.com/di-GMSZ.png

configured persistence.xml as below:
<?xml version="1.0" encoding="windows-1252" ?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="1.0">
<persistence-unit name="VakkoEJBModel" transaction-type="RESOURCE_LOCAL">

<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>jdbc/VakkoDS</jta-data-source>

<properties>
<property name="hibernate.jndi.url" value="t3://127.0.0.1:7001" />
<property name="hibernate.connection.datasource" value="jdbc/VakkoDS" />
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.WeblogicTransactionManagerLookup" />
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" />
<property name="hibernate.hbm2ddl.auto" value="update" />
<property name="hibernate.current_session_context_class" value="jta" />
</properties>


</persistence-unit>
</persistence>

weblogic-application.xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<weblogic-application>
<prefer-application-packages>
<package-name>antlr.*</package-name>
<package-name>org.hibernate.*</package-name>
<!-- package-name>org.apache.commons.logging.*</package-name -->
<!-- package-name>org.w3c.dom.*</package-name -->
</prefer-application-packages>
</weblogic-application>


weblogic-ejb-jar.xml
<?xml version = '1.0' encoding = 'UTF-8'?>
<weblogic-ejb-jar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-ejb-jar http://www.bea.com/ns/weblogic/weblogic-ejb-jar/1.0/weblogic-ejb-jar.xsd"
xmlns="http://www.bea.com/ns/weblogic/weblogic-ejb-jar">

</weblogic-ejb-jar>


ejb-jar.xml
<?xml version="1.0" encoding="windows-1252" ?>
<ejb-jar/>

And i added to setDomainEnv.cmd that line:
set EXT_PRE_CLASSPATH=C:\jarlar\hibernate-3.3.2\antlr-2.7.6.jar;C:\jarlar\hibernate-3.3.2\commons-collections-3.1.jar;C:\jarlar\hibernate-3.3.2\dom4j-1.6.1.jar;C:\jarlar\hibernate-3.3.2\hibernate3.jar;C:\jarlar\hibernate-3.3.2\javassist-3.9.0.GA.jar;C:\jarlar\hibernate-3.3.2\jta-1.1.jar;C:\jarlar\hibernate-3.3.2\slf4j-api-1.5.11.jar;C:\jarlar\hibernate-3.3.2\slf4j-nop-1.5.11.jar;C:\jarlar\hibernate-3.3.2\bytecode\cglib\cglib-2.2.jar;C:\Oracle\Middleware_11.1.1.4\modules\ejb3-persistence-3.3.1.jar;hibernate-validator-4.1.0.Final.jar;

deployment profile could be seen by clicking those links:
http://www.2hotfile.com/di-XV68.png
http://www.2hotfile.com/di-8YC9.png
http://www.2hotfile.com/di-ADR4.png

And i tried to manipulate the ear file contents according to these informations: http://middlewaremagic.com/weblogic/wp-content/uploads/2010/06/EAR_Application_Diagram.jpg

under ear\META-INF\application.xml
<?xml version = '1.0' encoding = 'windows-1252'?>
<application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd" version="5" xmlns="http://java.sun.com/xml/ns/javaee">
<display-name>ejb1</display-name>
<module>
<ejb>ejb1.jar</ejb>
</module>
</application>

under ear\META-INF\weblogic-application.xml
<?xml version = '1.0' encoding = 'windows-1254'?>
<weblogic-application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-application http://www.bea.com/ns/weblogic/weblogic-application/1.0/weblogic-application.xsd" xmlns="http://www.bea.com/ns/weblogic/weblogic-application">
<prefer-application-packages>
<package-name>org.hibernate.*</package-name>
<package-name>antlr.*</package-name>
<!-- package-name>org.apache.commons.logging.*</package-name -->
<!-- package-name>org.w3c.dom.*</package-name -->
</prefer-application-packages>
<listener>
<listener-class>oracle.adf.share.weblogic.listeners.ADFApplicationLifecycleListener</listener-class>
</listener>
<listener>
<listener-class>oracle.mds.lcm.weblogic.WLLifecycleListener</listener-class>
</listener>
<library-ref>
<library-name>adf.oracle.domain</library-name>
</library-ref>
</weblogic-application>

The files which existed in ejb1.ear\ejb1.jar\META-INF\ directory same with source folder of model project (these were created by jdeveloper deployment process according to deployment profile which previously explaint)

ear contents shown that link : http://www.2hotfile.com/di-23X6.png

When i deploy the project to weblogic by using JDeveloper or http://127.0.0.1:7101/console/ method. But occured exception
<10-Dec-2012 16:31:54 o'clock EET> <Warning> <netuix> <BEA-423420> <Redirect is executed in begin or refresh action. Redirect url is /console/console.portal?_nfpb=true&_pageLabel=AppDeploymentsControlPage.>
<10-Dec-2012 16:32:45 o'clock EET> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID '1355149965087' for task '2'. Error is: 'weblogic.application.ModuleException: Exception preparing module: EJBModule(ejb1.jar)
'
weblogic.application.ModuleException: Exception preparing module: EJBModule(ejb1.jar)

     at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:469)
     at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
     at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:517)
     at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
     at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:159)
     Truncated. see log file for complete stacktrace
Caused By: weblogic.deployment.EnvironmentException: Error processing persistence unit VakkoEJBModel of module ejb1.jar: Error instantiating the Persistence Provider class org.hibernate.ejb.HibernatePersistence of the PersistenceUnit VakkoEJBModel: java.lang.ClassNotFoundException: org.hibernate.ejb.HibernatePersistence
     at weblogic.deployment.BasePersistenceUnitInfoImpl.getPersistenceProvider(BasePersistenceUnitInfoImpl.java:375)
     at weblogic.deployment.BasePersistenceUnitInfoImpl.initializeEntityManagerFactory(BasePersistenceUnitInfoImpl.java:393)
     at weblogic.deployment.BasePersistenceUnitInfoImpl.initializeEntityManagerFactory(BasePersistenceUnitInfoImpl.java:386)
     at weblogic.deployment.BasePersistenceUnitInfoImpl.<init>(BasePersistenceUnitInfoImpl.java:158)
     at weblogic.deployment.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:39)
     Truncated. see log file for complete stacktrace
>
<10-Dec-2012 16:32:45 o'clock EET> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating deploy task for application 'ejb1'.>
<10-Dec-2012 16:32:45 o'clock EET> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004
weblogic.application.ModuleException: Exception preparing module: EJBModule(ejb1.jar)

     at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:469)
     at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
     at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:517)
     at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
     at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:159)
     Truncated. see log file for complete stacktrace
Caused By: weblogic.deployment.EnvironmentException: Error processing persistence unit VakkoEJBModel of module ejb1.jar: Error instantiating the Persistence Provider class org.hibernate.ejb.HibernatePersistence of the PersistenceUnit VakkoEJBModel: java.lang.ClassNotFoundException: org.hibernate.ejb.HibernatePersistence
     at weblogic.deployment.BasePersistenceUnitInfoImpl.getPersistenceProvider(BasePersistenceUnitInfoImpl.java:375)
     at weblogic.deployment.BasePersistenceUnitInfoImpl.initializeEntityManagerFactory(BasePersistenceUnitInfoImpl.java:393)
     at weblogic.deployment.BasePersistenceUnitInfoImpl.initializeEntityManagerFactory(BasePersistenceUnitInfoImpl.java:386)
     at weblogic.deployment.BasePersistenceUnitInfoImpl.<init>(BasePersistenceUnitInfoImpl.java:158)
     at weblogic.deployment.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:39)
     Truncated. see log file for complete stacktrace
>
<10-Dec-2012 16:32:45 o'clock EET> <Error> <Console> <BEA-240003> <Console encountered the following error weblogic.application.ModuleException: Exception preparing module: EJBModule(ejb1.jar)

     at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:469)
     at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
     at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:517)
     at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
     at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:159)
     at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:45)
     at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:613)
     at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
     at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:184)
     at weblogic.application.internal.EarDeployment.prepare(EarDeployment.java:58)
     at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:154)
     at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
     at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:207)
     at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:98)
     at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217)
     at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:747)
     at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1216)
     at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:250)
     at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159)
     at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:171)
     at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:13)
     at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:46)
     at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
     at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
     at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
Caused by: weblogic.deployment.EnvironmentException: Error processing persistence unit VakkoEJBModel of module ejb1.jar: Error instantiating the Persistence Provider class org.hibernate.ejb.HibernatePersistence of the PersistenceUnit VakkoEJBModel: java.lang.ClassNotFoundException: org.hibernate.ejb.HibernatePersistence

     at weblogic.deployment.BasePersistenceUnitInfoImpl.getPersistenceProvider(BasePersistenceUnitInfoImpl.java:375)
     at weblogic.deployment.BasePersistenceUnitInfoImpl.initializeEntityManagerFactory(BasePersistenceUnitInfoImpl.java:393)
     at weblogic.deployment.BasePersistenceUnitInfoImpl.initializeEntityManagerFactory(BasePersistenceUnitInfoImpl.java:386)
     at weblogic.deployment.BasePersistenceUnitInfoImpl.<init>(BasePersistenceUnitInfoImpl.java:158)
     at weblogic.deployment.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:39)
     at weblogic.deployment.AbstractPersistenceUnitRegistry.storeDescriptors(AbstractPersistenceUnitRegistry.java:349)
     at weblogic.deployment.AbstractPersistenceUnitRegistry.loadPersistenceDescriptor(AbstractPersistenceUnitRegistry.java:263)
     at weblogic.deployment.ModulePersistenceUnitRegistry.<init>(ModulePersistenceUnitRegistry.java:69)
     at weblogic.ejb.container.deployer.EJBModule.setupPersistenceUnitRegistry(EJBModule.java:223)
     at weblogic.ejb.container.deployer.EJBModule$1.execute(EJBModule.java:324)
     at weblogic.deployment.PersistenceUnitRegistryInitializer.setupPersistenceUnitRegistries(PersistenceUnitRegistryInitializer.java:62)
     at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:393)

What are my mistake/s or incompletes?
Please help me and excuse my poor English. Thanks in advance
  • 1. Re: Using EJB with Hibernate on Weblogic Server ADF platform
    Ganesh.. Explorer
    Currently Being Moderated
    Hi,
    Try adding the below line at the bottom of setDomainEnv.bat and restart the server :

    set CLASSPATH=C:\jarlar\hibernate-3.3.2\hibernate3.jar;%CLASSPATH%;
  • 2. Re: Using EJB with Hibernate on Weblogic Server ADF platform
    Jeets Journeyer
    Currently Being Moderated
    set EXT_PRE_CLASSPATH=C:\jarlar\hibernate-3.3.2\antlr-2.7.6.jar;C:\jarlar\hibernate-3.3.2\commons-collections-3.1.jar;C:\jarlar\hibernate-3.3.2\dom4j-1.6.1.jar;C:\jarlar\hibernate-3.3.2\hibernate3.jar;C:\jarlar\hibernate-3.3.2\javassist-3.9.0.GA.jar;C:\jarlar\hibernate-3.3.2\jta-1.1.jar;C:\jarlar\hibernate-3.3.2\slf4j-api-1.5.11.jar;C:\jarlar\hibernate-3.3.2\slf4j-nop-1.5.11.jar;C:\jarlar\hibernate-3.3.2\bytecode\cglib\cglib-2.2.jar;C:\Oracle\Middleware_11.1.1.4\modules\ejb3-persistence-3.3.1.jar;hibernate-validator-4.1.0.Final.jar;


    Instead of adding it to the pre classpath, add these .jars directly to the classpath with in setDomainEnv.

    weblogic is unable to find hibernate classes at runtime.

    Adjusting classpath should help.
  • 3. Re: Using EJB with Hibernate on Weblogic Server ADF platform
    webyildirim Newbie
    Currently Being Moderated
    Thank you. I did changes that what you written. Unfortunatelly that does not work for me. Same exception: Caused By: weblogic.deployment.EnvironmentException: Error processing persistence unit VakkoEJBModel of module ejb1.jar: Error instantiating the Persistence Provider class org.hibernate.ejb.HibernatePersistence of the PersistenceUnit VakkoEJBModel: java.lang.ClassNotFoundException: org.hibernate.ejb.HibernatePersistence

    Edited by: webyildirim on 11.Ara.2012 00:00
  • 4. Re: Using EJB with Hibernate on Weblogic Server ADF platform
    Ganesh.. Explorer
    Currently Being Moderated
    Hi,
    Your application is not able to pick up hibernate.jar from the classpath.
    Echo the classpath in setDomainEnv after setting it. Make sure you have added the path of jar correctly and that classpath is not getting overwritten somewhere.
  • 5. Re: Using EJB with Hibernate on Weblogic Server ADF platform
    webyildirim Newbie
    Currently Being Moderated
    Thanks again for your consideration.
    I double checked CLASSPATH. And seen starting wls with classpath which i defined, but no change about ecxeption.
    you can see wls starting classpath through the link: http://www.2hotfile.com/image.php?di=BQNE


    setDomainEnv.cmd

    @ECHO OFF

    @REM WARNING: This file is created by the Configuration Wizard.
    @REM Any changes to this script may be lost when adding extensions to this configuration.

    @REM *************************************************************************
    @REM This script is used to setup the needed environment to be able to start Weblogic Server in this domain.
    @REM
    @REM This script initializes the following variables before calling commEnv to set other variables:
    @REM
    @REM WL_HOME - The BEA home directory of your WebLogic installation.
    @REM JAVA_VM - The desired Java VM to use. You can set this environment variable before calling
    @REM this script to switch between Sun or BEA or just have the default be set.
    @REM JAVA_HOME - Location of the version of Java used to start WebLogic
    @REM Server. Depends directly on which JAVA_VM value is set by default or by the environment.
    @REM USER_MEM_ARGS - The variable to override the standard memory arguments
    @REM passed to java.
    @REM PRODUCTION_MODE - The variable that determines whether Weblogic Server is started in production mode.
    @REM DOMAIN_PRODUCTION_MODE
    @REM - The variable that determines whether the workshop related settings like the debugger,
    @REM testconsole or iterativedev should be enabled. ONLY settable using the
    @REM command-line parameter named production
    @REM NOTE: Specifying the production command-line param will force
    @REM the server to start in production mode.
    @REM
    @REM Other variables used in this script include:
    @REM SERVER_NAME - Name of the weblogic server.
    @REM JAVA_OPTIONS - Java command-line options for running the server. (These
    @REM will be tagged on to the end of the JAVA_VM and
    @REM MEM_ARGS)
    @REM
    @REM For additional information, refer to "Managing Server Startup and Shutdown for Oracle WebLogic Server"
    @REM (http://download.oracle.com/docs/cd/E17904_01/web.1111/e13708/overview.htm).
    @REM *************************************************************************

    set COMMON_COMPONENTS_HOME=C:\Oracle\Middleware_11.1.1.4\oracle_common
    for %%i in ("%COMMON_COMPONENTS_HOME%") do set COMMON_COMPONENTS_HOME=%%~fsi



    @REM C:\jarlar\hibernate-3.3.2\antlr-2.7.6.jar;C:\jarlar\hibernate-3.3.2\commons-collections-3.1.jar;C:\jarlar\hibernate-3.3.2\dom4j-1.6.1.jar;C:\jarlar\hibernate-3.3.2\hibernate3.jar;C:\jarlar\hibernate-3.3.2\javassist-3.9.0.GA.jar;C:\jarlar\hibernate-3.3.2\jta-1.1.jar;C:\jarlar\hibernate-3.3.2\slf4j-api-1.5.11.jar;C:\jarlar\hibernate-3.3.2\slf4j-nop-1.5.11.jar;C:\jarlar\hibernate-3.3.2\bytecode\cglib\cglib-2.2.jar;C:\Oracle\Middleware_11.1.1.4\modules\ejb3-persistence-3.3.1.jar;hibernate-validator-4.1.0.Final.jar;
    set CLASSPATH=C:\jarlar\hibernate-3.3.2\antlr-2.7.6.jar;C:\jarlar\hibernate-3.3.2\commons-collections-3.1.jar;C:\jarlar\hibernate-3.3.2\dom4j-1.6.1.jar;C:\jarlar\hibernate-3.3.2\hibernate3.jar;C:\jarlar\hibernate-3.3.2\javassist-3.9.0.GA.jar;C:\jarlar\hibernate-3.3.2\jta-1.1.jar;C:\jarlar\hibernate-3.3.2\slf4j-api-1.5.11.jar;C:\jarlar\hibernate-3.3.2\slf4j-nop-1.5.11.jar;C:\jarlar\hibernate-3.3.2\bytecode\cglib\cglib-2.2.jar;C:\Oracle\Middleware_11.1.1.4\modules\ejb3-persistence-3.3.1.jar;hibernate-validator-4.1.0.Final.jar;%CLASSPATH%;
    set WC_ORACLE_HOME=C:\Oracle\Middleware_11.1.1.4\jdeveloper


    set PORTLET_ORACLE_HOME=C:\Oracle\Middleware_11.1.1.4\jdeveloper


    set WC_ORACLE_HOME=C:\Oracle\Middleware_11.1.1.4\jdeveloper


    set WL_HOME=C:\Oracle\Middleware_11.1.1.4\wlserver_10.3
    for %%i in ("%WL_HOME%") do set WL_HOME=%%~fsi

    set BEA_JAVA_HOME=

    set SUN_JAVA_HOME=C:\Program Files\Java\jdk1.6.0_30x64

    if "%JAVA_VENDOR%"=="Oracle" (
         set JAVA_HOME=%BEA_JAVA_HOME%
    ) else (
         if "%JAVA_VENDOR%"=="Sun" (
              set JAVA_HOME=%SUN_JAVA_HOME%
         ) else (
              set JAVA_VENDOR=Sun
              set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_30x64
              
              @REM set JAVA_HOME=C:\Oracle\Middleware_11.1.1.4\jdk160_21
         )
    )

    @REM We need to reset the value of JAVA_HOME to get it shortened AND
    @REM we can not shorten it above because immediate variable expansion will blank it

    set JAVA_HOME=%JAVA_HOME%
    for %%i in ("%JAVA_HOME%") do set JAVA_HOME=%%~fsi

    set SAMPLES_HOME=%WL_HOME%\samples

    set DOMAIN_HOME=C:\Users\Dijitaluser\AppData\Roaming\JDeveloper\system11.1.1.4.37.59.23\DefaultDomain
    for %%i in ("%DOMAIN_HOME%") do set DOMAIN_HOME=%%~fsi

    set LONG_DOMAIN_HOME=C:\Users\Dijitaluser\AppData\Roaming\JDeveloper\system11.1.1.4.37.59.23\DefaultDomain

    if "%DEBUG_PORT%"=="" (
         set DEBUG_PORT=8453
    )

    if "%SERVER_NAME%"=="" (
         set SERVER_NAME=DefaultServer
    )

    set DERBY_FLAG=false

    set enableHotswapFlag=

    set PRODUCTION_MODE=

    set doExitFlag=false
    set verboseLoggingFlag=false
    for %%p in (%*) do call :SET_PARAM %%p
    GOTO :CMD_LINE_DONE
         :SET_PARAM
         for %%q in (%1) do set noQuotesParam=%%~q
         if /i "%noQuotesParam%" == "nodebug" (
              set debugFlag=false
              GOTO :EOF
         )
         if /i "%noQuotesParam%" == "production" (
              set DOMAIN_PRODUCTION_MODE=true
              GOTO :EOF
         )
         if /i "%noQuotesParam%" == "notestconsole" (
              set testConsoleFlag=false
              GOTO :EOF
         )
         if /i "%noQuotesParam%" == "noiterativedev" (
              set iterativeDevFlag=false
              GOTO :EOF
         )
         if /i "%noQuotesParam%" == "noLogErrorsToConsole" (
              set logErrorsToConsoleFlag=false
              GOTO :EOF
         )
         if /i "%noQuotesParam%" == "noderby" (
              set DERBY_FLAG=false
              GOTO :EOF
         )
         if /i "%noQuotesParam%" == "doExit" (
              set doExitFlag=true
              GOTO :EOF
         )
         if /i "%noQuotesParam%" == "noExit" (
              set doExitFlag=false
              GOTO :EOF
         )
         if /i "%noQuotesParam%" == "verbose" (
              set verboseLoggingFlag=true
              GOTO :EOF
         )
         if /i "%noQuotesParam%" == "enableHotswap" (
              set enableHotswapFlag=-javaagent:%WL_HOME%\server\lib\diagnostics-agent.jar
              GOTO :EOF
         ) else (
              set PROXY_SETTINGS=%PROXY_SETTINGS% %1
         )
         GOTO :EOF
    :CMD_LINE_DONE


    set MEM_DEV_ARGS=

    if "%DOMAIN_PRODUCTION_MODE%"=="true" (
         set PRODUCTION_MODE=%DOMAIN_PRODUCTION_MODE%
    )

    if "%PRODUCTION_MODE%"=="true" (
         set debugFlag=false
         set testConsoleFlag=false
         set iterativeDevFlag=false
         set logErrorsToConsoleFlag=false
    )

    @REM If you want to override the default Patch Classpath, Library Path and Path for this domain,
    @REM Please uncomment the following lines and add a valid value for the environment variables
    @REM set PATCH_CLASSPATH=[myPatchClasspath] (windows)
    @REM set PATCH_LIBPATH=[myPatchLibpath] (windows)
    @REM set PATCH_PATH=[myPatchPath] (windows)
    @REM PATCH_CLASSPATH=[myPatchClasspath] (unix)
    @REM PATCH_LIBPATH=[myPatchLibpath] (unix)
    @REM PATCH_PATH=[myPatchPath] (unix)

    call "%WL_HOME%\common\bin\commEnv.cmd"

    set WLS_HOME=%WL_HOME%\server

    set XMS_SUN_64BIT=256
    set XMS_SUN_32BIT=256
    set XMX_SUN_64BIT=512
    set XMX_SUN_32BIT=512
    set XMS_JROCKIT_64BIT=256
    set XMS_JROCKIT_32BIT=256
    set XMX_JROCKIT_64BIT=512
    set XMX_JROCKIT_32BIT=512


    if "%JAVA_VENDOR%"=="Sun" (
         set WLS_MEM_ARGS_64BIT=-Xms256m -Xmx600m -XX:PermSize=128M -XX:MaxPermSize=256M
         set WLS_MEM_ARGS_32BIT=-Xms256m -Xmx600m -XX:PermSize=128M -XX:MaxPermSize=256M
         echo this is suuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuun
    ) else (
         set WLS_MEM_ARGS_64BIT=-Xms256m -Xmx600m -XX:PermSize=128M -XX:MaxPermSize=256M
         set WLS_MEM_ARGS_32BIT=-Xms256m -Xmx600m -XX:PermSize=128M -XX:MaxPermSize=256M
         echo this is noooooooooooooooooooooooooooooooooooooooooooooooot sun
    )

    if "%JAVA_VENDOR%"=="Oracle" (
         set CUSTOM_MEM_ARGS_64BIT=-Xms%XMS_JROCKIT_64BIT%m -Xmx%XMX_JROCKIT_64BIT%m
         set CUSTOM_MEM_ARGS_32BIT=-Xms%XMS_JROCKIT_32BIT%m -Xmx%XMX_JROCKIT_32BIT%m
    ) else (
         set CUSTOM_MEM_ARGS_64BIT=-Xms%XMS_SUN_64BIT%m -Xmx%XMX_SUN_64BIT%m
         set CUSTOM_MEM_ARGS_32BIT=-Xms%XMS_SUN_32BIT%m -Xmx%XMX_SUN_32BIT%m
    )


    set MEM_ARGS_64BIT=%CUSTOM_MEM_ARGS_64BIT%

    set MEM_ARGS_32BIT=%CUSTOM_MEM_ARGS_32BIT%

    if "%JAVA_USE_64BIT%"=="true" (
         set MEM_ARGS=%MEM_ARGS_64BIT%
    ) else (
         set MEM_ARGS=%MEM_ARGS_32BIT%
    )

    set MEM_PERM_SIZE_64BIT=-XX:PermSize=128m

    set MEM_PERM_SIZE_32BIT=-XX:PermSize=128m

    if "%JAVA_USE_64BIT%"=="true" (
         set MEM_PERM_SIZE=%MEM_PERM_SIZE_64BIT%
    ) else (
         set MEM_PERM_SIZE=%MEM_PERM_SIZE_32BIT%
    )

    set MEM_MAX_PERM_SIZE_64BIT=-XX:MaxPermSize=512m

    set MEM_MAX_PERM_SIZE_32BIT=-XX:MaxPermSize=512m

    if "%JAVA_USE_64BIT%"=="true" (
         set MEM_MAX_PERM_SIZE=%MEM_MAX_PERM_SIZE_64BIT%
    ) else (
         set MEM_MAX_PERM_SIZE=%MEM_MAX_PERM_SIZE_32BIT%
    )

    if "%JAVA_VENDOR%"=="Sun" (
         if "%PRODUCTION_MODE%"=="" (
              set MEM_DEV_ARGS=-XX:CompileThreshold=8000 %MEM_PERM_SIZE%
         )
    )

    @REM Had to have a separate test here BECAUSE of immediate variable expansion on windows

    if "%JAVA_VENDOR%"=="Sun" (
         set MEM_ARGS=%MEM_ARGS% %MEM_DEV_ARGS% %MEM_MAX_PERM_SIZE%
    )

    if "%JAVA_VENDOR%"=="HP" (
         set MEM_ARGS=%MEM_ARGS% %MEM_MAX_PERM_SIZE%
    )

    if "%JAVA_VENDOR%"=="Apple" (
         set MEM_ARGS=%MEM_ARGS% %MEM_MAX_PERM_SIZE%
    )

    @REM IF USER_MEM_ARGS the environment variable is set, use it to override ALL MEM_ARGS values
    set USER_MEM_ARGS=-Xms256m -Xmx1024m -XX:CompileThreshold=8000 -XX:PermSize=128m -XX:MaxPermSize=512m
    if NOT "%USER_MEM_ARGS%"=="" (
         set MEM_ARGS=%USER_MEM_ARGS%
    )

    set ORACLE_DOMAIN_CONFIG_DIR=%DOMAIN_HOME%\config\fmwconfig
    for %%i in ("%ORACLE_DOMAIN_CONFIG_DIR%") do set ORACLE_DOMAIN_CONFIG_DIR=%%~fsi
    set WLS_JDBC_REMOTE_ENABLED=-Dweblogic.jdbc.remoteEnabled=false


    if "%WC_OHOME_ARGUMENT%"=="" (
         set WC_OHOME_ARGUMENT=-Dwc.oracle.home=%WC_ORACLE_HOME%
         set EXTRA_JAVA_PROPERTIES=-Dwc.oracle.home=%WC_ORACLE_HOME% %EXTRA_JAVA_PROPERTIES%
    )


    if "%PORTLET_OHOME_ARGUMENT%"=="" (
         set PORTLET_OHOME_ARGUMENT=-Dportlet.oracle.home=%PORTLET_ORACLE_HOME%
         set EXTRA_JAVA_PROPERTIES=-Dportlet.oracle.home=%PORTLET_ORACLE_HOME% %EXTRA_JAVA_PROPERTIES%
    )


    if "%WC_OHOME_ARGUMENT%"=="" (
         set WC_OHOME_ARGUMENT=-Dwc.oracle.home=%WC_ORACLE_HOME%
         set EXTRA_JAVA_PROPERTIES=-Dwc.oracle.home=%WC_ORACLE_HOME% %EXTRA_JAVA_PROPERTIES%
    )


    set JAVA_PROPERTIES=-Dplatform.home=%WL_HOME% -Dwls.home=%WLS_HOME% -Dweblogic.home=%WLS_HOME%

    set ALT_TYPES_DIR=%COMMON_COMPONENTS_HOME%\modules\oracle.ossoiap_11.1.1,%COMMON_COMPONENTS_HOME%\modules\oracle.oamprovider_11.1.1
    set PROTOCOL_HANDLERS=oracle.mds.net.protocol


    if "%JAVA_VENDOR%"=="Sun" (
         set EXTRA_JAVA_PROPERTIES=-XX:+UseParallelGC -XX:+DisableExplicitGC %EXTRA_JAVA_PROPERTIES%
    ) else (
         if "%JAVA_VENDOR%"=="Oracle" (
              set EXTRA_JAVA_PROPERTIES=-Djrockit.codegen.newlockmatching=true %EXTRA_JAVA_PROPERTIES%
         ) else (
              set EXTRA_JAVA_PROPERTIES=-XX:+UseParallelGC -XX:+DisableExplicitGC %EXTRA_JAVA_PROPERTIES%
         )
    )


    set PROTOCOL_HANDLERS=%PROTOCOL_HANDLERS:;="|"%


    @REM To use Java Authorization Contract for Containers (JACC) in this domain,
    @REM please uncomment the following section. If there are multiple machines in
    @REM your domain, be sure to edit the setDomainEnv in the associated domain on
    @REM each machine.
    @REM
    @REM -Djava.security.manager
    @REM -Djava.security.policy=location of weblogic.policy
    @REM -Djavax.security.jacc.policy.provider=weblogic.security.jacc.simpleprovider.SimpleJACCPolicy
    @REM -Djavax.security.jacc.PolicyConfigurationFactory.provider=weblogic.security.jacc.simpleprovider.PolicyConfigurationFactoryImpl
    @REM -Dweblogic.security.jacc.RoleMapperFactory.provider=weblogic.security.jacc.simpleprovider.RoleMapperFactoryImpl

    set EXTRA_JAVA_PROPERTIES=-Doracle.webcenter.tagging.scopeTags=false %EXTRA_JAVA_PROPERTIES%

    set EXTRA_JAVA_PROPERTIES=-Doracle.webcenter.analytics.disable-native-partitioning=false %EXTRA_JAVA_PROPERTIES%

    set EXTRA_JAVA_PROPERTIES=-DUSE_JAAS=false -Djps.policystore.hybrid.mode=false -Djps.combiner.optimize.lazyeval=true -Djps.combiner.optimize=true -Djps.auth=ACC -Doracle.core.ojdl.logging.usercontextprovider=oracle.core.ojdl.logging.impl.UserContextImpl -noverify %EXTRA_JAVA_PROPERTIES%

    set EXTRA_JAVA_PROPERTIES=-Dwsm.repository.path=%DOMAIN_HOME%\oracle\store\gmds %EXTRA_JAVA_PROPERTIES%

    set EXTRA_JAVA_PROPERTIES=-Dcommon.components.home=%COMMON_COMPONENTS_HOME% -Djrf.version=11.1.1 -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger -Ddomain.home=%DOMAIN_HOME% -Djrockit.optfile=%COMMON_COMPONENTS_HOME%\modules\oracle.jrf_11.1.1\jrocket_optfile.txt -Doracle.server.config.dir=%ORACLE_DOMAIN_CONFIG_DIR%\servers\%SERVER_NAME% -Doracle.domain.config.dir=%ORACLE_DOMAIN_CONFIG_DIR% -Digf.arisidbeans.carmlloc=%ORACLE_DOMAIN_CONFIG_DIR%\carml -Digf.arisidstack.home=%ORACLE_DOMAIN_CONFIG_DIR%\arisidprovider -Doracle.security.jps.config=%DOMAIN_HOME%\config\fmwconfig\jps-config.xml -Doracle.deployed.app.dir=%DOMAIN_HOME%\servers\%SERVER_NAME%\tmp\_WL_user -Doracle.deployed.app.ext=\- -Dweblogic.alternateTypesDirectory=%ALT_TYPES_DIR% -Djava.protocol.handler.pkgs=%PROTOCOL_HANDLERS% %WLS_JDBC_REMOTE_ENABLED% %EXTRA_JAVA_PROPERTIES%

    set EXTRA_JAVA_PROPERTIES=-Djps.app.credential.overwrite.allowed=true %EXTRA_JAVA_PROPERTIES%

    set JAVA_PROPERTIES=%JAVA_PROPERTIES% %EXTRA_JAVA_PROPERTIES%

    set ARDIR=%WL_HOME%\server\lib

    pushd %LONG_DOMAIN_HOME%

    @REM Clustering support (edit for your cluster!)

    if "%ADMIN_URL%"=="" (
         @REM The then part of this block is telling us we are either starting an admin server OR we are non-clustered
         set CLUSTER_PROPERTIES=-Dweblogic.management.discover=true
    ) else (
         set CLUSTER_PROPERTIES=-Dweblogic.management.discover=false -Dweblogic.management.server=%ADMIN_URL%
    )

    if NOT "%LOG4J_CONFIG_FILE%"=="" (
         set JAVA_PROPERTIES=%JAVA_PROPERTIES% -Dlog4j.configuration=file:%LOG4J_CONFIG_FILE%
    )

    set JAVA_PROPERTIES=%JAVA_PROPERTIES% %CLUSTER_PROPERTIES%

    set JAVA_DEBUG=

    if "%debugFlag%"=="true" (
         set JAVA_DEBUG=-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=%DEBUG_PORT%,server=y,suspend=n -Djava.compiler=NONE
         set JAVA_OPTIONS=%JAVA_OPTIONS% %enableHotswapFlag% -ea -da:com.bea... -da:javelin... -da:weblogic... -ea:com.bea.wli... -ea:com.bea.broker... -ea:com.bea.sbconsole...
    ) else (
         set JAVA_OPTIONS=%JAVA_OPTIONS% %enableHotswapFlag% -da
    )

    if NOT exist %JAVA_HOME%\lib (
         echo The JRE was not found in directory %JAVA_HOME%. ^(JAVA_HOME^)
         echo Please edit your environment and set the JAVA_HOME
         echo variable to point to the root directory of your Java installation.
         popd
         pause
         GOTO :EOF
    )

    if "%DERBY_FLAG%"=="true" (
         set DATABASE_CLASSPATH=%DERBY_CLASSPATH%
    ) else (
         set DATABASE_CLASSPATH=%DERBY_CLIENT_CLASSPATH%
    )

    if NOT "%POST_CLASSPATH%"=="" (
         set POST_CLASSPATH=%COMMON_COMPONENTS_HOME%\modules\oracle.jrf_11.1.1\jrf.jar;%POST_CLASSPATH%
    ) else (
         set POST_CLASSPATH=%COMMON_COMPONENTS_HOME%\modules\oracle.jrf_11.1.1\jrf.jar
    )
    if NOT "%PRE_CLASSPATH%"=="" (
         set PRE_CLASSPATH=%COMMON_COMPONENTS_HOME%\modules\oracle.jdbc_11.1.1\ojdbc6dms.jar;%PRE_CLASSPATH%
    ) else (
         set PRE_CLASSPATH=%COMMON_COMPONENTS_HOME%\modules\oracle.jdbc_11.1.1\ojdbc6dms.jar
    )


    if "%PORTLET_ORACLE_HOME%"=="" (
         set POST_CLASSPATH=%WC_ORACLE_HOME%\webcenter\modules\oracle.portlet.server_11.1.1\oracle-portlet-api.jar;%POST_CLASSPATH%
    )


    if NOT "%POST_CLASSPATH%"=="" (
         set POST_CLASSPATH=C:\Oracle\Middleware_11.1.1.4\jdeveloper\webcenter\modules\wcps_11.1.1.4.0\wcps-connection-mbeans.jar;%POST_CLASSPATH%
    ) else (
         set POST_CLASSPATH=C:\Oracle\Middleware_11.1.1.4\jdeveloper\webcenter\modules\wcps_11.1.1.4.0\wcps-connection-mbeans.jar
    )


    set POST_CLASSPATH=%PORTLET_ORACLE_HOME%\webcenter\modules\oracle.portlet.server_11.1.1\oracle-portlet-api.jar;%POST_CLASSPATH%

    set POST_CLASSPATH=%DOMAIN_HOME%\wcps-lib\derby-10.6.1.0.jar;%DOMAIN_HOME%\wcps-lib\derbytools-10.6.1.0.jar;%POST_CLASSPATH%

    if NOT "%DATABASE_CLASSPATH%"=="" (
         if NOT "%POST_CLASSPATH%"=="" (
              set POST_CLASSPATH=%POST_CLASSPATH%;%DATABASE_CLASSPATH%
         ) else (
              set POST_CLASSPATH=%DATABASE_CLASSPATH%
         )
    )

    if NOT "%ARDIR%"=="" (
         if NOT "%POST_CLASSPATH%"=="" (
              set POST_CLASSPATH=%POST_CLASSPATH%;%ARDIR%\xqrl.jar
         ) else (
              set POST_CLASSPATH=%ARDIR%\xqrl.jar
         )
    )

    @REM PROFILING SUPPORT

    set JAVA_PROFILE=

    set SERVER_CLASS=weblogic.Server

    set JAVA_PROPERTIES=%JAVA_PROPERTIES% %WLP_JAVA_PROPERTIES%

    set JAVA_OPTIONS=%JAVA_OPTIONS% %JAVA_PROPERTIES% -Dwlw.iterativeDev=%iterativeDevFlag% -Dwlw.testConsole=%testConsoleFlag% -Dwlw.logErrorsToConsole=%logErrorsToConsoleFlag%

    if "%PRODUCTION_MODE%"=="true" (
         set JAVA_OPTIONS= -Dweblogic.ProductionModeEnabled=true %JAVA_OPTIONS%
    )

    @REM -- Setup properties so that we can save stdout and stderr to files

    if NOT "%WLS_STDOUT_LOG%"=="" (
         echo Logging WLS stdout to %WLS_STDOUT_LOG%
         set JAVA_OPTIONS=%JAVA_OPTIONS% -Dweblogic.Stdout=%WLS_STDOUT_LOG%
    )

    if NOT "%WLS_STDERR_LOG%"=="" (
         echo Logging WLS stderr to %WLS_STDERR_LOG%
         set JAVA_OPTIONS=%JAVA_OPTIONS% -Dweblogic.Stderr=%WLS_STDERR_LOG%
    )

    @REM ADD EXTENSIONS TO CLASSPATHS
    @REM set EXT_PRE_CLASSPATH=C:\jarlar\hibernate-3.3.2\antlr-2.7.6.jar;C:\jarlar\hibernate-3.3.2\commons-collections-3.1.jar;C:\jarlar\hibernate-3.3.2\dom4j-1.6.1.jar;C:\jarlar\hibernate-3.3.2\hibernate3.jar;C:\jarlar\hibernate-3.3.2\javassist-3.9.0.GA.jar;C:\jarlar\hibernate-3.3.2\jta-1.1.jar;C:\jarlar\hibernate-3.3.2\slf4j-api-1.5.11.jar;C:\jarlar\hibernate-3.3.2\slf4j-nop-1.5.11.jar;C:\jarlar\hibernate-3.3.2\bytecode\cglib\cglib-2.2.jar;C:\Oracle\Middleware_11.1.1.4\modules\ejb3-persistence-3.3.1.jar;hibernate-validator-4.1.0.Final.jar;
    if NOT "%EXT_PRE_CLASSPATH%"=="" (
         if NOT "%PRE_CLASSPATH%"=="" (
              set PRE_CLASSPATH=%EXT_PRE_CLASSPATH%;%PRE_CLASSPATH%
         ) else (
              set PRE_CLASSPATH=%EXT_PRE_CLASSPATH%
         )
    )

    if NOT "%EXT_POST_CLASSPATH%"=="" (
         if NOT "%POST_CLASSPATH%"=="" (
              set POST_CLASSPATH=%POST_CLASSPATH%;%EXT_POST_CLASSPATH%
         ) else (
              set POST_CLASSPATH=%EXT_POST_CLASSPATH%
         )
    )

    if NOT "%WEBLOGIC_EXTENSION_DIRS%"=="" (
         set JAVA_OPTIONS=%JAVA_OPTIONS% -Dweblogic.ext.dirs=%WEBLOGIC_EXTENSION_DIRS%
    )

    set JAVA_OPTIONS=%JAVA_OPTIONS%

    @REM SET THE CLASSPATH

    if NOT "%WLP_POST_CLASSPATH%"=="" (
         if NOT "%CLASSPATH%"=="" (
              set CLASSPATH=%WLP_POST_CLASSPATH%;%CLASSPATH%
         ) else (
              set CLASSPATH=%WLP_POST_CLASSPATH%
         )
    )

    if NOT "%POST_CLASSPATH%"=="" (
         if NOT "%CLASSPATH%"=="" (
              set CLASSPATH=%POST_CLASSPATH%;%CLASSPATH%
         ) else (
              set CLASSPATH=%POST_CLASSPATH%
         )
    )

    if NOT "%WEBLOGIC_CLASSPATH%"=="" (
         if NOT "%CLASSPATH%"=="" (
              set CLASSPATH=%WEBLOGIC_CLASSPATH%;%CLASSPATH%
         ) else (
              set CLASSPATH=%WEBLOGIC_CLASSPATH%
         )
    )

    if NOT "%PRE_CLASSPATH%"=="" (
         set CLASSPATH=%PRE_CLASSPATH%;%CLASSPATH%
    )

    if NOT "%JAVA_VENDOR%"=="BEA" (
         set JAVA_VM=%JAVA_VM% %JAVA_DEBUG% %JAVA_PROFILE%
    ) else (
         set JAVA_VM=%JAVA_VM% %JAVA_DEBUG% %JAVA_PROFILE%
    )



    startWebLogic.cmd

    @ECHO OFF

    @REM WARNING: This file is created by the Configuration Wizard.
    @REM Any changes to this script may be lost when adding extensions to this configuration.

    SETLOCAL

    @REM --- Start Functions ---
    @REM set JAVA_OPTIONS=-javaagent:C:\jarlar\jrebel\jrebel.jar %JAVA_OPTIONS%
    @REM set CLASS_CACHE=false

    GOTO :ENDFUNCTIONS
    :stopAll
         @REM We separate the stop commands into a function so we are able to use the trap command in Unix (calling a function) to stop these services
         if NOT "X%ALREADY_STOPPED%"=="X" (
              GOTO :EOF
         )
         @REM STOP DERBY (only if we started it)
         if "%DERBY_FLAG%"=="true" (
              echo Stopping Derby server...
              call "%WL_HOME%\common\derby\bin\stopNetworkServer.cmd" >"%DOMAIN_HOME%\derbyShutdown.log" 2>&1

              echo Derby server stopped.
         )

         set ALREADY_STOPPED=true
    GOTO :EOF

    :classCaching
         echo Class caching enabled...
         
         set JAVA_OPTIONS=%JAVA_OPTIONS% -Dlaunch.main.class=%SERVER_CLASS% -Dlaunch.class.path="%CLASSPATH%" -Dlaunch.complete=weblogic.store.internal.LockManagerImpl -cp %WL_HOME%\server\lib\pcl2.jar
         set SERVER_CLASS=com.oracle.classloader.launch.Launcher
    GOTO :EOF


    :ENDFUNCTIONS

    @REM --- End Functions ---

    @REM *************************************************************************
    @REM This script is used to start WebLogic Server for this domain.
    @REM
    @REM To create your own start script for your domain, you can initialize the
    @REM environment by calling @USERDOMAINHOME\setDomainEnv.
    @REM
    @REM setDomainEnv initializes or calls commEnv to initialize the following variables:
    @REM
    @REM BEA_HOME - The BEA home directory of your WebLogic installation.
    @REM JAVA_HOME - Location of the version of Java used to start WebLogic
    @REM Server.
    @REM JAVA_VENDOR - Vendor of the JVM (i.e. BEA, HP, IBM, Sun, etc.)
    @REM PATH - JDK and WebLogic directories are added to system path.
    @REM WEBLOGIC_CLASSPATH
    @REM - Classpath needed to start WebLogic Server.
    @REM PATCH_CLASSPATH - Classpath used for patches
    @REM PATCH_LIBPATH - Library path used for patches
    @REM PATCH_PATH - Path used for patches
    @REM WEBLOGIC_EXTENSION_DIRS - Extension dirs for WebLogic classpath patch
    @REM JAVA_VM - The java arg specifying the VM to run. (i.e.
    @REM - server, -hotspot, etc.)
    @REM USER_MEM_ARGS - The variable to override the standard memory arguments
    @REM passed to java.
    @REM PRODUCTION_MODE - The variable that determines whether Weblogic Server is started in production mode.
    @REM DERBY_HOME - Derby home directory.
    @REM DERBY_CLASSPATH
    @REM - Classpath needed to start Derby.
    @REM
    @REM Other variables used in this script include:
    @REM SERVER_NAME - Name of the weblogic server.
    @REM JAVA_OPTIONS - Java command-line options for running the server. (These
    @REM will be tagged on to the end of the JAVA_VM and
    @REM MEM_ARGS)
    @REM CLASS_CACHE - Enable class caching of system classpath.
    @REM
    @REM For additional information, refer to "Managing Server Startup and Shutdown for Oracle WebLogic Server"
    @REM (http://download.oracle.com/docs/cd/E17904_01/web.1111/e13708/overview.htm).
    @REM *************************************************************************

    @REM Call setDomainEnv here.
    set DOMAIN_HOME=C:\Users\Dijitaluser\AppData\Roaming\JDeveloper\system11.1.1.4.37.59.23\DefaultDomain
    for %%i in ("%DOMAIN_HOME%") do set DOMAIN_HOME=%%~fsi

    call "%DOMAIN_HOME%\bin\setDomainEnv.cmd" %*

    set SAVE_JAVA_OPTIONS=%JAVA_OPTIONS%

    set SAVE_CLASSPATH=%CLASSPATH%

    @REM Start Derby

    set DERBY_DEBUG_LEVEL=0

    if "%DERBY_FLAG%"=="true" (
         call "%WL_HOME%\common\derby\bin\startNetworkServer.cmd" >"%DOMAIN_HOME%\derby.log" 2>&1

    )

    set JAVA_OPTIONS=%SAVE_JAVA_OPTIONS%

    set SAVE_JAVA_OPTIONS=

    set CLASSPATH=%SAVE_CLASSPATH%

    set SAVE_CLASSPATH=

    if "%PRODUCTION_MODE%"=="true" (
         set WLS_DISPLAY_MODE=Production
    ) else (
         set WLS_DISPLAY_MODE=Development
    )

    if NOT "%WLS_USER%"=="" (
         set JAVA_OPTIONS=%JAVA_OPTIONS% -Dweblogic.management.username=%WLS_USER%
    )

    if NOT "%WLS_PW%"=="" (
         set JAVA_OPTIONS=%JAVA_OPTIONS% -Dweblogic.management.password=%WLS_PW%
    )

    if NOT "%MEDREC_WEBLOGIC_CLASSPATH%"=="" (
         if NOT "%CLASSPATH%"=="" (
              set CLASSPATH=%CLASSPATH%;%MEDREC_WEBLOGIC_CLASSPATH%
         ) else (
              set CLASSPATH=%MEDREC_WEBLOGIC_CLASSPATH%
         )
    )

    echo .

    echo .

    echo JAVA Memory arguments: %MEM_ARGS%

    echo .

    echo WLS Start Mode=%WLS_DISPLAY_MODE%

    echo .

    echo CLASSPATH=%CLASSPATH%

    echo .

    echo PATH=%PATH%

    echo .

    echo ***************************************************

    echo * To start WebLogic Server, use a username and *

    echo * password assigned to an admin-level user. For *

    echo * server administration, use the WebLogic Server *

    echo * console at http:\\hostname:port\console *

    echo ***************************************************

    @REM CLASS CACHING

    if "%CLASS_CACHE%"=="true" (
         CALL :classCaching
    )

    @REM START WEBLOGIC

    echo starting weblogic with Java version:

    %JAVA_HOME%\bin\java %JAVA_VM% -version

    if "%WLS_REDIRECT_LOG%"=="" (
         echo Starting WLS with line:
         echo %JAVA_HOME%\bin\java %JAVA_VM% %MEM_ARGS% -Dweblogic.Name=%SERVER_NAME% -Djava.security.policy=%WL_HOME%\server\lib\weblogic.policy %JAVA_OPTIONS% %PROXY_SETTINGS% %SERVER_CLASS%
         %JAVA_HOME%\bin\java %JAVA_VM% %MEM_ARGS% -Dweblogic.Name=%SERVER_NAME% -Djava.security.policy=%WL_HOME%\server\lib\weblogic.policy %JAVA_OPTIONS% %PROXY_SETTINGS% %SERVER_CLASS%
    ) else (
         echo Redirecting output from WLS window to %WLS_REDIRECT_LOG%
         %JAVA_HOME%\bin\java %JAVA_VM% %MEM_ARGS% -Dweblogic.Name=%SERVER_NAME% -Djava.security.policy=%WL_HOME%\server\lib\weblogic.policy %JAVA_OPTIONS% %PROXY_SETTINGS% %SERVER_CLASS% >"%WLS_REDIRECT_LOG%" 2>&1
    )

    CALL :stopAll

    popd

    @REM Exit this script only if we have been told to exit.

    if "%doExitFlag%"=="true" (
         exit
    )



    ENDLOCAL

    Edited by: webyildirim on 11.Ara.2012 02:38
  • 6. Re: Using EJB with Hibernate on Weblogic Server ADF platform
    Ganesh.. Explorer
    Currently Being Moderated
    Hi,
    It seems some weblogic jars are getting loaded before your jars. Add your jars at the beginning of the classpath at the end of setDomainEnv.cmd.

    set CLASSPATH=<YOUR_JARS>;%CLASSPATH%;

    Also there are some incorrect slashes '/' in the classpath. Please correct them before restarting.
  • 7. Re: Using EJB with Hibernate on Weblogic Server ADF platform
    RenévanWijk Oracle ACE
    Currently Being Moderated
    Note that you are missing a jar file

    Caused By: weblogic.deployment.EnvironmentException: Error processing persistence unit VakkoEJBModel of module ejb1.jar: Error instantiating the Persistence Provider class org.hibernate.ejb.HibernatePersistence of the PersistenceUnit VakkoEJBModel: java.lang.ClassNotFoundException: org.hibernate.ejb.HibernatePersistence

    This class is part hibernate-entitymanager*.jar (some version can be found here: http://www.findjar.com/class/org/hibernate/ejb/HibernatePersistence.html)

    Just a little tip, it is not wise to alter the WebLogic classpath - you never know want you might be messing up.

    The way to load classes before other WebLogic classes is to use class loading filters (just as you have been providing in your weblogic-application.xml), i.e.,
    <prefer-application-packages>
        <package-name>antlr.*</package-name>
    </prefer-application-packages>
    Examples to make Hibernate run on WebLogic are presented here:
    - http://middlewaremagic.com/weblogic/?p=5861
    - http://middlewaremagic.com/weblogic/?p=6725
    - http://middlewaremagic.com/weblogic/?p=7478
    - http://middlewaremagic.com/weblogic/?p=8104 (in the migration section, shows how to set-up Hibernate4)
  • 8. Re: Using EJB with Hibernate on Weblogic Server ADF platform
    webyildirim Newbie
    Currently Being Moderated
    Another exception encountered, when i added the set CLASSPATH to the end of setDomainEnv.
    When i tried to deploy my ear, also nothing changed unfortunatelly.
    brgds

    JAVA Memory arguments: -Xms256m -Xmx1024m -XX:CompileThreshold=8000 -XX:PermSize=128m -XX:MaxPermSize=512m
    .
    WLS Start Mode=Development
    .
    CLASSPATH=C:\Oracle\Middleware_11.1.1.4\modules\hibernate-3.3.2\antlr-2.7.6.jar;C:\Oracle\Middleware_11.1.1.4\modules\hibernate-3.3.2\commons-collections-3.1.jar;C:\Oracle\Middleware_11.1.1.4\modules\hibernate-3.3.2\dom4j-1.6.1.jar;C:\Oracle\Middleware_11.1.1.4\modules\hibernate-3.3.2\hibernate3.jar;C:\Oracle\Middleware_11.1.1.4\modules\hibernate-3.3.2\javassist-3.9.0.GA.jar;C:\Oracle\Middleware_11.1.1.4\modules\hibernate-3.3.2\jta-1.1.jar;C:\Oracle\Middleware_11.1.1.4\modules\hibernate-3.3.2\slf4j-api-1.5.11.jar;C:\Oracle\Middleware_11.1.1.4\modules\hibernate-3.3.2\slf4j-nop-1.5.11.jar;C:\Oracle\Middleware_11.1.1.4\modules\hibernate-3.3.2\bytecode\cglib\cglib-2.2.jar;C:\Oracle\Middleware_11.1.1.4\modules\ejb3-persistence-3.3.1.jar;C:\Oracle\Middleware_11.1.1.4\modules\hibernate-3.3.2\hibernate-validator-4.1.0.Final.jar;C:\Oracle\MIDDLE~1.4\ORACLE~1\modules\oracle.jdbc_11.1.1\ojdbc6dms.jar;C:\Oracle\MIDDLE~1.4\patch_wls1034\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\Oracle\MIDDLE~1.4\patch_jdev1111\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\PROGRA~1\Java\JDK16~1.0_3\lib\tools.jar;C:\Oracle\MIDDLE~1.4\WLSERV~1.3\server\lib\weblogic_sp.jar;C:\Oracle\MIDDLE~1.4\WLSERV~1.3\server\lib\weblogic.jar;C:\Oracle\MIDDLE~1.4\modules\features\weblogic.server.modules_10.3.4.0.jar;C:\Oracle\MIDDLE~1.4\WLSERV~1.3\server\lib\webservices.jar;C:\Oracle\MIDDLE~1.4\modules\ORGAPA~1.1/lib/ant-all.jar;C:\Oracle\MIDDLE~1.4\modules\NETSFA~1.0_1/lib/ant-contrib.jar;C:\Users\DIJITA~1\AppData\Roaming\JDEVEL~1\SYSTEM~1.23\DEFAUL~1\wcps-lib\derby-10.6.1.0.jar;C:\Users\DIJITA~1\AppData\Roaming\JDEVEL~1\SYSTEM~1.23\DEFAUL~1\wcps-lib\derbytools-10.6.1.0.jar;C:\Oracle\Middleware_11.1.1.4\jdeveloper\webcenter\modules\oracle.portlet.server_11.1.1\oracle-portlet-api.jar;C:\Oracle\Middleware_11.1.1.4\jdeveloper\webcenter\modules\wcps_11.1.1.4.0\wcps-connection-mbeans.jar;C:\Oracle\MIDDLE~1.4\ORACLE~1\modules\oracle.jrf_11.1.1\jrf.jar;C:\Oracle\MIDDLE~1.4\WLSERV~1.3\common\derby\lib\derbyclient.jar;C:\Oracle\MIDDLE~1.4\WLSERV~1.3\server\lib\xqrl.jar;.;
    .
    PATH=C:\Oracle\MIDDLE~1.4\patch_wls1034\profiles\default\native;C:\Oracle\MIDDLE~1.4\patch_jdev1111\profiles\default\native;C:\Oracle\MIDDLE~1.4\WLSERV~1.3\server\native\win\32;C:\Oracle\MIDDLE~1.4\WLSERV~1.3\server\bin;C:\Oracle\MIDDLE~1.4\modules\ORGAPA~1.1\bin;C:\PROGRA~1\Java\JDK16~1.0_3\jre\bin;C:\PROGRA~1\Java\JDK16~1.0_3\bin;C:\Program Files\Java\jre6X64;C:\Program Files\Java\jre6X64\bin;C:\Oracle\database\app\oracle\product\11.2.0\server\bin;C:\Oracle\database\app\oracle\product\11.2.0\server;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\Dell\Dell Wireless WLAN Card;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\OpenVPN\bin;C:\Oracle\MIDDLE~1.4\WLSERV~1.3\server\native\win\32\oci920_8




    <11-Dec-2012 13:45:56 o'clock EET> <Error> <Deployer> <BEA-149205> <Failed to initialize the application 'wcps-services [Version=11.1.1.4.0]' due to error java.lang.IncompatibleClassChangeError: Implementing class.
    java.lang.IncompatibleClassChangeError: Implementing class
         at java.lang.ClassLoader.defineClass1(Native Method)
         at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
         at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
         Truncated. see log file for complete stacktrace
    Caused By: java.lang.IncompatibleClassChangeError: Implementing class
         at java.lang.ClassLoader.defineClass1(Native Method)
         at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
         at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
         Truncated. see log file for complete stacktrace
    >
  • 9. Re: Using EJB with Hibernate on Weblogic Server ADF platform
    webyildirim Newbie
    Currently Being Moderated
    Thans for your guiding. I will try to implement according to your links and hints. And i inform you about result

    Edited by: webyildirim on 11.Ara.2012 06:27
  • 10. Re: Using EJB with Hibernate on Weblogic Server ADF platform
    webyildirim Newbie
    Currently Being Moderated
    Thanks to René van Wijk and all. I did configurations according to ear structure and i cleared all hibernate entry in classpath. It works, at least from now on i can see the created tables which i defined in my entity classes.
    brgds

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points