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

21 July 2011

TROUBLESHOOTING: The domain edit lock is owned by another session in non-exclusive mode (WLS deployer)

Error
[Deployer:149163]The domain edit lock is owned by another session in non-exclusive mode - this deployment operation requires exclusive access to the edit lock and hence cannot proceed. If you are using "Automatically Aquire Lock and Activate Changes" in the console, then the lock will expire shortly so retry this operation.

Solution
Actually what Deployer is trying to tell you is that it tried to deployed but another user has Lock and Edit the domain . More regarding Lock and Edit in this related post.

In other not to fail but exist gracefully leaving you deployment to be applied when the Lock is released, then use nonexclusivelock option.

Using this option you ll get the following message, if another user has avquire the lock and the script will not fail:
[wldeploy] Operation is pending and will be activated or cancelled when the ongoing edit session is activated or cancelled.


In case if you use a wldeploy ant task, here is an example script

<project name="deploy" default="deploy">
<property file="deploy.properties" />

<!-- Setting TaskDefinition -->
<taskdef name="wldeploy" classname="weblogic.ant.taskdefs.management.WLDeploy">
    <classpath>
        <pathelement location="${wldeploy.home}/weblogic.jar"/>
    </classpath>
</taskdef>
<!-- Deploying Applications  -->
<target name="deploy">
<wldeploy action="deploy"
          name="${deploy.name}"
          source="${deploy.source.path}/${deploy.source.ear}"
          verbose="true"
          adminurl="${connection.protocol}://${wls.hostname}:${wls.port}" 
          targets="${deploy.target}"
          upload="true"
          user="${wls.username}"
          password="${wls.password}"
          usenonexclusivelock="true" />
</target>
</project> 
 
 
 
Dig more:

20 July 2011

TROUBLESHOOTING: Bad Request' for url: '.../bea_wls_deployment_internal/DeploymentService (upon WLS deployment)

Error
weblogic.deploy.api.internal.utils.DeployerHelperException: The source '/tmp/ApplicationGreeceDEV.ear' for the application 'ApplicationGreeceDEV#2.0'
could not be loaded to the server 'http://127.0.0.1:7007/bea_wls_deployment_internal/DeploymentService'.
Response: '400: Bad Request' for url: 'http://127.0.0.1:7007/bea_wls_deployment_internal/DeploymentService'

Solution
I know it seems silly but do not waste time. Just restart server.

TROUBLESHOOTING: Changing the source location is not allowed for a previously attempted deployment. Try deploying without specifying the source. (WLS Error upon deployment)

Error
[Deployer:149007]New source location, '/u01/app/oracle/product/Middleware_1034/user_projects/domains/dev/servers/AdminServer/upload/ApplicationGreeceDEV/2.0/app/ApplicationGreeceDEV.ear',
 cannot be deployed to configured application, 'ApplicationGreeceDEV [Version=2.0]'. 
The application source is at
 '/u01/app/oracle/product/Middleware_1034/user_projects/domains/dev/servers/AdminServer/upload/ApplicationGreeceDEV.ear'.
 Changing the source location is not allowed for a previously attempted deployment. Try deploying without specifying the source.

Possible solution
(or  Solution that worked in my case)

-Undeploy the application.

-Go to Admin server's upload folder

eg. upload in my case

cd /u01/app/oracle/product/Middleware_1034/user_projects/domains/dev/servers/AdminServer/upload

-Remove any relate archives or directories
eg. ApplicationGreeceDEV.ear or ApplicationGreeceDEV directory
from upload folder


14 April 2011

Enable Precompilation of jspx pages in weblogic.

To enable locate the weblogic.xml and check the related option "Precompile JSPs"


or

add the following elements in weblogic.xml under the document root:



Pros
  • Errors in pages that cannot be identified with java compilation (javac) or ADF BC validation (ojdeploy) will be identified upon deployment and not during testing.
  • No more delay upon page request for the 1st time. Without precompilation the first time a page is requested, then the jspx is compiled into java.
Cons
  • Longer deployment time. eg it need a few mins more to compile all jspx into java files
In case of error you ll get upon deployment something like this:


Dig more:

30 March 2011

ojdeploy : Deploying ADF application from Command Line


Applications or modules can be deployed from JDeveloper without actually starting the JDeveloper IDE itself. Deploying from the command line, using ojdeploy, is especially useful where you need to deploy existing projects or applications using a batch file or other script.

Command Usage

ojdeploy -profile -workspace [ -project ] [ ]
ojdeploy -buildfile [ ]
ojdeploy -buildfileschema


Arguments: 
(Argument: Description)
  • profile: Name of the profile to deploy.
  • workspace: Full path to the JDeveloper workspace file (.jws).
  • project: Name of the JDeveloper project within the .jws where the deployment profile can be found. If omitted, the Profile is assumed to be in the workspace.
  • buildfile: Full path to a build file for batch deploy.
  • buildfileschema: Print XML Schema for the build file.


Note: Deployment profiles can be classified into two broad categories, those that are defined at the application or workspace level, and those defined at the project level. To deploy a workspace-profile, ojdeploy takes the workspace location, and the name of the profile. To deploy a project-profile it takes an additional -project argument.

Options
( -Option: Description)
  • -basedir: Interpret path for workspace relative to a base directory. The built-in macro ${base.dir} captures the value of -basedir.
  • -outputfile: Specifies an alternate location for the output. The default is within a \deploy directory inside the project or workspace. If this parameter does not specify a file extension, the extension is determined from the original file name in the deployment profile.
  • -nocompile: Prevents the build system from being invoked. This is useful if a workspace or project just needs to be packaged, and not compiled at this time. 
  • -clean: Deletes all files from the project output directory before compiling. Deployment will stop for that profile, if a file or directory could not be deleted.
  • -nodatasources: For Java EE applications, this prevents the weblogic-jdbc.xml file from being updated with connection information found in the JDeveloper IDE. This option is ignored for non-Java EE applications. More
  • -forcerewrite: Ensures output file is rewritten even if the contents have not changed in this run of ojdeploy.
  • -updatewebxmlejbrefs: Update EJB references in web.xml.
  • -define: Allows for additional macros to be defined on the command-line. This can also be done in an XML build file using the element. Macros and options defined on the command line supplement, or override, those found in the section of a build file if one is being used.
  • -statuslogfile: Full path to an output file for status summary. No macros allowed. The -statuslogfile option will create an XML file that stores a list of all the profiles processed and the status of each. A summary section at the end can be checked to quickly determine the exit status for the entire script.

Built-in Macros
(Macro: Description)
  • workspace.name: Name of the workspace (without the .jws extension).
  • workspace.dir: Directory of the workspace.jws file.
  • project.name: Name of the project (without the .jpr extension).
  • project.dir: Directory of the project.jpr file.
  • profile.name: Name of the profile being deployed.
  • deploy.dir: Default deploy directory for the profile.

Note: The project.name and project.dir macros are only available when a project-level profile is being deployed.

Examples

Deploy a project-level profile: 
  • ojdeploy -profile webapp1 -workspace /usr/jdoe/Application1/Application1.jws -project Project1 
  • ojdeploy -profile webapp1 -workspace Application1/Application1.jws -basedir /usr/jdoe -project Project1
Deploy a workspace-level profile: 
  • ojdeploy -profile earprofile1 -workspace /usr/jdoe/Application1/Application1.jws

Deploy all profiles from all projects of a workspace: 
  • ojdeploy -workspace /usr/jdoe/Application1/Application1.jws -project \* -profile \*

Build in batch mode from a ojbuild file: 
  • ojdeploy -buildfile /usr/jdoe/ojbuild.xml

Build using ojbuild file, pass into, or override default variables in, the build file: 
  • ojdeploy -buildfile /usr/jdoe/ojbuild.xml -define myhome=/usr/jdoe,mytmp=/tmp 
  • ojdeploy -buildfile /usr/jdoe/ojbuild.xml -basedir /usr/jdoe

Build using ojbuild file, set or override parameters in the default section: 
  • ojdeploy -buildfile /usr/jdoe/ojbuild.xml -nocompile ojdeploy -buildfile /usr/jdoe/ojbuild.xml -outputfile '${workspace.dir}/${profile.name}.jar' 
  • ojdeploy -buildfile /usr/jdoe/ojbuild.xml -define mydir=/tmp -outputfile '${mydir}/${workspace.name}-${profile.name}'

More examples
  •  ojdeploy -workspace Application1/Application1.jws,Application2/Application2.jws -basedir /home/jdoe -profile app* 
  • ojdeploy -buildfile /usr/jdoe/ojbuild.xml -define outdir=/tmp,rel=11.1.1 -outputfile '${outdir}/built/${workspace.name}/${rel}/${profile.name}.jar' 
  • ojdeploy -workspace Application1/Application1.jws -basedir /home/jdoe -nocompile -outputfile '${base.dir}/${workspace.name}-${profile.name}'
Quick Overrides Without Editing a Build Script

To pass in macro values or override the ones defined in a build script, use the -define option to supply a new value: 
  • ojdeploy -buildfile /home/user/ojbuild.xml -define "mycustomdir=/tmp"

This will add the mycustomdir variable to the section of the build script, or replace it if it already is defined with the value '/tmp'.

To pass in parameter values or override the ones defined in a build script, use the appropriate parameter option: 
  • ojdeploy -buildfile /home/user/ojbuild.xml -nocompile -nodatasources

This will add the -nocompile and -nodatasources parameters to the default section of the build file.

See related posts (when they arrive) for more info.

Src: 
  • JDeveloper's Help or ojdeploy commands help switch.  I did not manage to find it online :( 

You might also like:

Related Posts Plugin for WordPress, Blogger...