Showing posts with label deploy. Show all posts
Showing posts with label deploy. Show all posts

Thursday, September 1, 2016

WebLogic deployment plan for a EAR with EJB deployed in a WAR and not in a separate JAR module

https://docs.oracle.com/cd/E19798-01/821-1841/gippi/index.html

"To include enterprise bean class files in a WAR module, the class files should be in the WEB-INF/classes directory. To include a JAR file that contains enterprise beans in a WAR module, add the JAR to the WEB-INF/lib directory of the WAR module. WAR modules that contain enterprise beans do not require an ejb-jar.xml deployment descriptor. If the application uses ejb-jar.xml, it must be located in the WAR module’s WEB-INF directory. "

in this case you MUST put an empty weblogic-ejb-jar.xml in the WAR's file WEB-INF directory:


<weblogic-ejb-jar xmlns="http://www.bea.com/ns/weblogic/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">
</weblogic-ejb-jar>





then you can provide a deployment plan plan.xml :


<?xml version='1.0' encoding='UTF-8'?>
<deployment-plan xmlns="http://xmlns.oracle.com/weblogic/deployment-plan" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/deployment-plan http://xmlns.oracle.com/weblogic/deployment-plan/1.0/deployment-plan.xsd">
  <application-name>PippoApplication.ear</application-name>
  <variable-definition>
    <variable>
      <name>WeblogicEnterpriseBean_com.pippo.PippoBean_CreateAsPrincipalName_14562212116401</name>
      <value>SERVERSTARTUP.CREATE.PRINCIPAL</value>
    </variable>
  </variable-definition>
  <module-override>
    <module-name>PippoDashboard.war</module-name>
    <module-type>war</module-type>
    <module-descriptor external="false">
      <root-element>weblogic-ejb-jar</root-element>
      <uri>WEB-INF/weblogic-ejb-jar.xml</uri>
      <variable-assignment>
        <name>WeblogicEnterpriseBean_com.pippo.PippoBean_CreateAsPrincipalName_14562212116401</name>
        <xpath>/weblogic-ejb-jar/weblogic-enterprise-bean/[ejb-name="PippoBean"]/create-as-principal-name</xpath>
      </variable-assignment>
    </module-descriptor>
    <module-descriptor external="false">
      <root-element>ejb-jar</root-element>
      <uri>META-INF/ejb-jar.xml</uri>
    </module-descriptor>
  </module-override>
  <config-root>/path/to/envconfig/deployplans/</config-root>
</deployment-plan>


and in the config.xml you configure the deployment plan:

  <app-deployment>
    <name>PippoApplication</name>
    <target>mywlsserver</target>
    <module-type>ear</module-type>
    <source-path>/path/to/PippoApplication.ear</source-path>
    <deployment-principal-name>PIPPO.deployment.principal</deployment-principal-name>
    <plan-dir>/path/to/plan</plan-dir>
    <plan-path>/path/to/envconfig/deployplans/plan.xml</plan-path>
    <security-dd-model>Advanced</security-dd-model>
    <staging-mode>nostage</staging-mode>
  </app-deployment>




Sunday, November 28, 2010

SOA Suite and OSB: deploying and testing

You should create a SAR file and deploy it.

SOA SUITE:

with WLST:

some interesting WLST commands here

Here C:\Oracle1\Middleware\Oracle_SOA1\bin\ant-t2p-worklist.xml the MDS migration tool.

with ANT:
C:\Oracle1\Middleware\jdeveloper\bin\ant-sca-compile.xml

here the entire documentation on how to build and deploy using the Ant files.

OSB:

with WLST:
http://www.oracle.com/technology/sample_code/products/osb/index.html

also here another version of same script
http://www.insemble.com/oracleservicebus-deployment.html

before you run it:

c:\Oracle1\Middleware\wlserver_10.3\server\bin\setWLSEnv.cmd

set CLASSPATH=%CLASSPATH%;C:\Oracle1\Middleware\Oracle_OSB1\lib\sb-kernel-api.jar;C:\Oracle1\Middleware\Oracle_OSB1\modules\com.bea.common.configfwk_1.3.0.0.jar;C:\Oracle1\Middleware\Oracle_OSB1\lib\sb-kernel-impl.jar

java weblogic.WLST import.py import.properties

Examples:

how to compile your SCA with Ant:

cd C:\JDeveloper\mywork\myproject
ant -f C:\Oracle1\Middleware\jdeveloper\bin\ant-sca-compile.xml -Dscac.input=C:\JDeveloper\mywork\myproject\composite.xml

this will produce out.err and out.xml in your default TEMP directory
(eg C:\Users\pierre\AppData\Local\Temp)

then package into a jar file:
ant -f C:\Oracle1\Middleware\jdeveloper\bin\ant-sca-package.xml -DcompositeDir=C:\JDeveloper\mywork\myproject -DcompositeName=myproject -Drevision
=1.0

then deploy:

ant -f C:\Oracle1\Middleware\jdeveloper\bin\ant-sca-deploy.xml -DserverURL=http://localhost:7001 -DsarLocation=C:\JDeveloper\mywork\myproject\deploy\sca_myproject_rev1.0.jar -Duser=weblogic

Thursday, February 4, 2010

How to deploy a EAR to WebLogic with WLST

http://blogs.oracle.com/jamesbayer/2007/10/automate_wls_console_tasks_wit.html

excellent tutorial! As usual with James Bayer!

In a nutshell:

cd C:\beawli\user_projects\domains\JCRMIntegration_Domain\bin
setDomainEnv.cmd
java weblogic.WLST
connect( 'weblogic', 'weblogic', 't3://localhost:7001')
stopApplication('ACME_INTEG_EAR')
undeploy('ACME_INTEG_EAR')
deploy('ACME_INTEG_EAR', 'C:/TEMP/WORKSHOP_ACME_INTEG_EAR.ear', targets='AdminServer')
startApplication('ACME_INTEG_EAR')
disconnect()



The complete script is:

connect( 'weblogic', 'weblogic1', 't3://localhost:7001')
try:
   stopApplication('MQParserEAR')
except:
   print 'unable to stop'

try:
   undeploy('MQParserEAR')
except:
   print 'unable to undeploy'

deploy('MQParserEAR', '/path/to/MQParserEAR/1.1.0-SNAPSHOT/MQParserEAR-1.1.0-SNAPSHOT.ear', targets='AdminServer')
startApplication('MQParserEAR')
disconnect()