- Making Jar And Running Java Using ANT
- Declaring properties in ANT Script
- Ant to Deploy Applications
- Building “wlfullclient.jar”
- WebLogic Specific APPC ant task
- WebLogic WebService Specific ANT Tasks
- Redeploying a Single JSP
- How to Automatically Generate the ANT “build.xml” file?
- Starting & Stoping Servers Using ANT
- Classpath Settings in ANT task
- Using WLST ant Task to Get ServerDetails
- DataSource Creation using AntTask wlconfig
- Get Rid Of “Unresolved WebApp library references” (Appc Utility)
- Deploy Multiple Applications Remotely Using ANT
- Deploy Applications Using Encrypted Password With ANT
January 29th, 2010 on 1:56 pm
Thanks for the info about the ant build.Could you please update us about the weblogic specific ant task.
Thanks again
February 12th, 2010 on 12:30 pm
Hi Rayzone,
Please find some more new WebLogic specific ANT tasks i have updated in the Blog: http://jaysensharma.wordpress.com/ant_for_wls/
Keep Posting 🙂
Thanks
Jay SenSharma
April 6th, 2010 on 6:42 am
Hi Jay,
Ant 1.6.5 is quite an old version. Does WLS support latest one, Ant 1.8.0? or better use older versions?
Thanks,
Alex
April 6th, 2010 on 9:58 am
Hi Alexander,
Actually there is no where maneioned clearly that we should not use the ANT 1.8.0 or latest version of ANt with WebLogic. But I have seen few issues when we upgrade the ANT version because many of WebLogic Jar files have a ANT Version specified inside their “META-INFMANIFEST.MF” file. So ideally we should not go with another different version of ANT.
Example: if you extract the “weblogic.jar” then inside META-INFMANIFEST.MF file you will find the ANT Version is defined as follwoing:
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.6.5
Created-By: R27.6.0-50_o-100423-1.6.0_05-20080626-2105-windows-ia32 (BEA Systems, Inc.)
Main-Class: weblogic.Server
Implementation-Vendor: BEA Systems
— — —
— — —
There are few issues which we see with WLS 10.0MP1 and ANT 1.7 version… but the issue gets resolved if we use the default ANT 1.6.5….Looking at these things it will be better if we use the Same ANT Version which comes with WebLogic…
But as an Application Server..WebLogic should provide this flexibility to the developers.
.
.
Keep Posting 🙂
Thanks
Jay SenSharma
April 15th, 2010 on 1:14 pm
Jay,
Here is a snippet from a working build.xml:
It compiles without any problem However, if I change this into:
The build fails immediately with message “No modules were found to build”. What is required for wlcompile to work?
Thanks,
Alex
April 15th, 2010 on 1:23 pm
System didn’t pick XML snippets for some reason. Here they are again:
Working one:
=================================
=================================
Not working
=================================
=================================
Thanks,
Alex
June 22nd, 2010 on 1:47 am
Hello there,
Can u please make a simple tutorial with a “how to do” an EAR file of an WS or WebApp and an EJB app?
I mean, if i have my project with an WS (or WebApp) and an EJB… i want to make the:
1) .war archive for ws
2) .jar archivo for ejb
and 3) package all off them into an EAR file
I have doubts about to package the build/ directory or the source directory… because i have APP-INF/lib with log4j and xml jars… and ther are used for EJB and WS… and i need to load them to another WLS 10.0 server
If u could do that in a simple tutorial im gonna be very grateful, thanx in advance
June 22nd, 2010 on 11:23 am
Hi Mgaldames,
I tried to develop a post on Creating an EAR application. Please have a look on the Post : http://middlewaremagic.com/weblogic/2010/06/22/how-to-build-ear-application-for-weblogic/.
The above Link explains about the EAR contents and it’s basic and mandatory elements and their uses. Please try to follow the post and let us know if you have any queries.
As u have mentioned that u want to use Log4j in your Web Module as well as in your EJB Modules…so in that case it is better to Put your log4j.jar file inside “APP-INF/lib” and the “log4j.xml/log4j.properties” file insode “APP-INF/classes” directory. Please refer to : http://middlewaremagic.com/weblogic/2010/03/03/log4j-at-application-level-in-weblogic/ as well…that may give some basic idea.
.
.
Keep Posting 🙂
Thanks
Jay SenSharma
September 22nd, 2010 on 12:42 pm
Hi JaySen ,
I need your help related to a issue in creating a build.xml for a weblogic portal application :
I have posted my concern at Oracle forum :
http://forums.oracle.com/forums/thread.jspa?threadID=1132470&stqc=true
It would be great , if you could help me to resolve my issues
thanks,
Sarat
September 22nd, 2010 on 1:05 pm
Please refer to : http://middlewaremagic.com/weblogic/2010/09/15/get-rid-of-unresolved-webapp-library-references/#comment-1952
.
.
Keep Posting 🙂
Thanks
Jay SenSharma
January 21st, 2011 on 5:51 pm
hi jay im a newbee
im working on ant and i want to start and stop a weblogic sever using ant weblogic tasks its clearly mentioned in this site but my question im getting the errors as shown below
and one thing is i knew that it cannot find the class and i included the below line in my ant code also
i have weblogic.jar and when i extract that It has one more folder inside weblogic called weblogic then the convention should change right
“weblogic.weblogic.ant.taskdefs.management.WLServer”
even then im getting error
java.lang.NoClassDefFoundError: weblogic/utils/NestedException
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
at java.lang.Class.getConstructor0(Class.java:2699)
at java.lang.Class.newInstance0(Class.java:326)
at java.lang.Class.newInstance(Class.java:308)
at javax.xml.parsers.FactoryFinder.newInstance(FactoryFinder.java:147)
at javax.xml.parsers.FactoryFinder.findJarServiceProvider(FactoryFinder.java:298)
at javax.xml.parsers.FactoryFinder.find(FactoryFinder.java:223)
at javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:128)
at org.apache.tools.ant.util.JAXPUtils.newParserFactory(JAXPUtils.java:114)
at org.apache.tools.ant.util.JAXPUtils.getNSParserFactory(JAXPUtils.java:100)
at org.apache.tools.ant.util.JAXPUtils.getNamespaceXMLReader(JAXPUtils.java:163)
at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:193)
at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:140)
at org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:91)
at org.apache.tools.ant.Main.runBuild(Main.java:653)
at org.apache.tools.ant.Main.startAnt(Main.java:187)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
Caused by: java.lang.ClassNotFoundException: weblogic.utils.NestedException
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
… 30 more
please jay kindly look at this please
where can i find weblogic.jar and where should it be placed
how to point to that jar from ant code so that i can use wlserver task without errors
January 21st, 2011 on 6:29 pm
Hi Sai,
I just now tested the script works fine in WLS10.3 (Please let us know which WLS version you are using)….But i have modified a bit in the script so that it will take care of the CLASSPATH setting on it’s own now…Please try this :
Run it like to see more verbose informations: :
ant -verbose
.
.
Keep Posting 🙂
Thanks
Jay SenSharma
January 22nd, 2011 on 2:02 pm
hi jay below is my ant script
i named the above file name as jumpstart.xml
while running its not responding the below is the verbose information
E:MY ANTstart and stop server using wltasks>ant -f jumpstart.xml -v
Apache Ant version 1.6.5 compiled on June 2 2005
Buildfile: jumpstart.xml
Detected Java version: 1.5 in: C:beajdk160_05jre
Detected OS: Windows XP
parsing buildfile E:MY ANTstart and stop server using wltasksjumpstart.xml with URI = file:///E:/MY%20ANT/start%20and%20stop%20server%20using%20wltasks/jumpstart.xml
Project base dir set to: E:MY ANTstart and stop server using wltasks
Build sequence for target(s) `startserver’ is [startserver]
Complete build sequence is [startserver, ]
startserver:
[WLServer efmserver] Executing ‘C:beajdk160_05jrebinjava.exe’ with arguments:
[WLServer efmserver] ‘-Xms512m’
[WLServer efmserver] ‘-Xmx960m’
[WLServer efmserver] ‘-Dweblogic.Domain=ksai_airproducts_1000’
[WLServer efmserver] ‘-Dweblogic.Name=efmserver’
[WLServer efmserver] ‘-Dbea.home=C:bea’
[WLServer efmserver] ‘-Dweblogic.management.username=register’
[WLServer efmserver] ‘-Dweblogic.management.password=register’
[WLServer efmserver] ‘-Dweblogic.ListenAddress=localhost’
[WLServer efmserver] ‘-Dweblogic.ListenPort=1000’
[WLServer efmserver] ‘-classpath’
[WLServer efmserver] ‘C:beawlserver103serverlibEccpressoAsn1.jar;C:beawlserver103serverlibEccpressoCore.jar;C:beawlserver103serverlibEccpressoJcae.jar;C:beawlserver103serverlibapi.jar;C:beawlserver103serverlibbea_wls_async_response.jar;C:beawlserver103serverlibbea_wls_r
emote_deployer.jar;C:beawlserver103serverlibdiagnostics-agent.jar;C:beawlserver103serverlibjConnect.jar;C:beawlserver103serverlibjcom.jar;C:beawlserver103serverlibjconn2.jar;C:beawlserver103serverlibjconn3.jar;C:beawlserver103serverlibjms51-interop.jar;C:beawlserver10
3serverlibjrmp.jar;C:beawlserver103serverlibjrmpclient.jar;C:beawlserver103serverlibjsafeFIPS.jar;C:beawlserver103serverlibmejb.jar;C:beawlserver103serverlibmysql-connector-java-commercial-5.0.3-bin.jar;C:beawlserver103serverlibojdbc6.jar;C:beawlserver103serverlibweb
logic-spring.jar;C:beawlserver103serverlibweblogic.jar;C:beawlserver103serverlibwebserviceclient+ssl.jar;C:beawlserver103serverlibwebserviceclient.jar;C:beawlserver103serverlibwebservices.jar;C:beawlserver103serverlibwl-j2ee-client.jar;C:beawlserver103serverlibwlbase.ja
r;C:beawlserver103serverlibwlcipher.jar;C:beawlserver103serverlibwlclient.jar;C:beawlserver103serverlibwlcommons-logging.jar;C:beawlserver103serverlibwlconnector.jar;C:beawlserver103serverlibwldb2.jar;C:beawlserver103serverlibwldeploy.jar;C:beawlserver103serverlibw
linformix.jar;C:beawlserver103serverlibwljarbuilder.jar;C:beawlserver103serverlibwljmsclient.jar;C:beawlserver103serverlibwljmxclient.jar;C:beawlserver103serverlibwllog4j.jar;C:beawlserver103serverlibwlnmclient.jar;C:beawlserver103serverlibwloracle.jar;C:beawlserver10
3serverlibwls-api.jar;C:beawlserver103serverlibwlsafclient.jar;C:beawlserver103serverlibwlspy.jar;C:beawlserver103serverlibwlsqlserver.jar;C:beawlserver103serverlibwlsybase.jar;C:beawlserver103serverlibwlutil.jar;C:beawlserver103serverlibwlw-langx.jar;C:beawlserver
103serverlibwlw-system.jar;C:beawlserver103serverlibwlw-wsee-soapfault.jar;C:beawlserver103serverlibwseeclient.jar;C:beawlserver103serverlibwsse.jar;C:beawlserver103serverlibxmlx.jar;C:beawlserver103serverlibxqrl.jar’
[WLServer efmserver] ‘weblogic.Server’
[WLServer efmserver]
[WLServer efmserver] The ‘ characters around the executable and arguments are
[WLServer efmserver] not part of the command.
[WLServer efmserver] waiting for efmserverto transition to [RUNNING], within 0 ms
i think now the earlier problem was resolved i.e.., ant file is now pointing to welogic.jar by the way im using weblogic 10.3 version only same as u
jay kindly have a look please
Thanks,
Sai Raghava
January 22nd, 2011 on 11:52 pm
Hi Sai,
I have updated the Post with More clear instructions this time and even edited the ANT Script as well …http://middlewaremagic.com/weblogic/?p=665 Hope this time your Server will come up fine.
Please check the Image as well for more clear instructions: http://middlewaremagic.com/weblogic/wp-content/uploads/2010/03/Ant_StartServer.jpg
.
.
Keep Posting 🙂
Thanks
Jay SenSharma
January 24th, 2011 on 4:23 pm
Hi jay
Thank u very much 🙂
yes as you mentioned its working fine.
I did that with the same configurations as you mentioned
like domain name:7001_Domain
server name: AdminServer
username:weblogic
password:weblogic
so with the above configurations its working pretty fine
so this type of server is not a Managed Server right because we are using AdminServer
I have couple of queries to pose,hope you can guide me with your expertise please
they are
1)How can i deploy some war files to the same example “7001_Domain” AdminServer and start the server and run application??
2)I want to automate the weblogic domain configuration using ANT’s WLCONFIG Task instead of manually clicking next and entering server name,port no and i want do some modifications in the weblogic console like myrealm settings and adding groups and users there etc i knew that all the settings will be stored in config.xml which is present in config folder.
i think we can use wlconfig ant task but im not sure that it does all these what i required
please and kindly jay can you explain with an example
August 10th, 2011 on 8:20 pm
Hi Jay SenSharma,
While deploying war in to weblogic server using ant script what is use of nostage=”true” flag.can u provide this info in detail.
August 11th, 2011 on 8:29 am
Hi Sravan,
WebLogic has 3 different modes of deployments as following:
1). Stage Mode Deployment: The Administration Server first copies the deployment unit source files to the staging directories of target servers. (The staging directory is named stage by default, and it resides under the target server’s root directory.)The target servers then deploy using their local copy of the deployment files.
2). No Stage Mode Deployment: In nostage mode, the Administration Server does not copy the archive files from their source location. Instead, each target server must access the archive files from a single source directory for deployment. The staging directory of target servers is ignored for nostage deployments. The source for the deployment files in nostage mode is the path provided by the user at deployment time (as opposed to stage mode, where the source is the path in each server’s staging directory). However, even in nostage mode, WebLogic Server copies out parts of the deployment to temporary directories. This enables users to update entire archived deployments or parts of archived deployments.
3). External Stage Mode Deployment: The Administration Server does not copy deployment files. Instead, the Administrator must ensure that deployment files are distributed to the correct staging directory location before deployment (for example, by manually copying files prior to deployment).
With external_stage deployments, the Administration Server requires a copy of the deployment files for validation purposes. Copies of the deployment files that reside in target servers’ staging directories are not validated before deployment.
For more informations on different Mode of deployment and which one we need to choose is described in the following link:
http://download.oracle.com/docs/cd/E11035_01/wls100/deployment/deploy.html#wp1029629
.
.
Keep Posting 🙂
Thanks
Jay SenSharma
August 11th, 2011 on 11:49 am
hi
Jay SenSharma thanks a lot for your reply…
Thanks
sravan.
August 11th, 2011 on 12:20 pm
Hi
Jay SenSharma
I think Nostagemode Deployment is better than stagedeployment.
can u suggest me regarding this….
Thanks
Sravan
August 11th, 2011 on 12:30 pm
Hi sravan,
If I have a large cluster environment and have a huge applications to be deployed on them, then I would prefer No-Stage deployment using a shared directory where I would keep the application which would surely help me and for smaller environment would go for staging so its totally depended on the once requirement .
Regards,
Ravish Mody
August 11th, 2011 on 12:46 pm
Thank you Ravish Mody
August 25th, 2011 on 3:54 pm
hi while deploying ear application into weblogic
MetadataNotFoundException: MDS-00013: no metadata found for metadata object “/META-INF/adf-config.xml”
at oracle.mds.core.MetadataObject.getBaseMO(MetadataObject.java:1285)
at oracle.mds.core.MDSSession.getBaseMO(MDSSession.java:3210)
at oracle.mds.core.MDSSession.getMetadataObject(MDSSession.java:1220)
at oracle.adf.share.jndi.MDSBackingStore.getMetadataObject(MDSBackingStore.java:377)
at oracle.adf.share.jndi.MDSBackingStore.obtainMetadataObject(MDSBackingStore.java:498)
at oracle.adf.share.jndi.MDSBackingStore.getMOBean(MDSBackingStore.java:554)
at oracle.adf.mbean.share.config.RuntimeMXBeanImpl.init(RuntimeMXBeanImpl.java:198)
at oracle.adf.mbean.share.config.RuntimeMXBeanImpl.(RuntimeMXBeanImpl.java:188)
at oracle.adf.mbean.share.config.RuntimeMXBeanImpl.(RuntimeMXBeanImpl.java:179)
at oracle.adf.mbean.share.config.RuntimeMXBeanImpl.(RuntimeMXBeanImpl.java:171)
at oracle.adf.mbean.share.config.ADFConfigLifeCycleCallBack.contextInitialized(ADFConfigLifeCycleCallBack.java:130)
at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:481)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:181)
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1872)
at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3153)
at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1508)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:482)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:247)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)
at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:636)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:205)
at weblogic.application.internal.EarDeployment.activate(EarDeployment.java:58)
at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
at weblogic.deploy.internal.targetserver.BasicDeployment.activate(BasicDeployment.java:184)
at weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeployment.java:361)
at weblogic.management.deploy.internal.DeploymentAdapter$1.doActivate(DeploymentAdapter.java:51)
at weblogic.management.deploy.internal.DeploymentAdapter.activate(DeploymentAdapter.java:200)
at weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:30)
at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:240)
at weblogic.management.deploy.internal.ConfiguredDeployments.activate(ConfiguredDeployments.java:169)
at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:123)
at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:180)
at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:96)
at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:17
can you help out me why do we get this issues ….
August 25th, 2011 on 4:10 pm
Hi
this is also one issue i found in server logs
Please add a basic META-INF/adf-config.xml to your classpath to avoid functional errors.
Thanks in advance
sravan
August 25th, 2011 on 6:21 pm
Hi Sravan,
Please have a look on the following link which has the similar issue resolved…
1). https://forums.oracle.com/forums/thread.jspa?threadID=941559
2). https://forums.oracle.com/forums/thread.jspa?threadID=1772989
And the following link:
http://techiecook.wordpress.com/2010/12/02/error-testing-adf-webservice-mds-00013-no-metadata-found-for-metadata-object/
.
.
Keep Posting 🙂
Thanks
Jay Sensharma
March 22nd, 2012 on 2:26 am
Hello,
I am new to tis forum and wasnt sure how to post a question under the right forum.
If it is ok to ask here..here is my question.
I work for a team that uses weblogic and we call WLST scripts to build a domain, build JDBC pools and deploy a ear/ear file to this domain.
Now we want to see if we can retire the WLST scripts and use ANT weblogic targets to get this done.
If there any eaxamples I can look at which shows me how to build a domain, build a dbpool and deploy a simple server on this domain using ANT.
Please answere or direct me to the right forum.
Sri
March 23rd, 2012 on 8:20 pm
Not in a single post, there are several (see also at the top of this page)
– data source (http://middlewaremagic.com/weblogic/?p=2504)
– deploy applications (http://middlewaremagic.com/weblogic/?p=373)
– server start and stop (http://middlewaremagic.com/weblogic/?p=665)
These examples can help on the way.
January 10th, 2014 on 10:37 pm
Hi Jay,
When I tried the below code it don’t execute properly..
${WSDL}
Output
run:
[echo] testingfromsai
[echo] /scratch/aime/work/CLOUDTOP/SDI/OracleHome/sdictl/
[exec] Result: 2
[exec] Unable to access jarfile SDI.jar adddbpod -podName abc123 -tag abc123 -constraint abc123 > abc12.log
[exec] Result: 1
[echo] /scratch/aime/work/CLOUDTOP/SDI/OracleHome/sdictl/sdi.sh
[echo] /net/slc03yza/scratch/aime/work/CLOUDTOP/SDI/OracleHome/sdictl/SDI.jar
Here we are having shell scripts in which internally calls the java Jar file.
I don’t know which class there used internally
but from the command we have to executed as java -jar SDI.jar adb -pod XXX etc..
and shell script is the same as sh sdi.sh adb -pod XXX etc..
So what I want is we need to execute the jar file, here we are not making any jar file but we are using jar file.
It will be great if you check what the issue all abt.