Pages

Thursday, July 15, 2010

OSB 11g ANT deployment scripts

For Oracle Service Bus 10.3 & 11g you can use the ANT / WLST deployment scripts provided by Oracle. With these scripts you can make an export 1 or more OSB projects from sbconsole, make a deployment / configuration plan and you can import a project jar to the sbconsole.

I made some changes to these scripts so it only needs one property file (build.properties ), you don't need to use the import or export.properties files. The second change I made, is support for making an export jar from the OSB workspace ( OEPE environment ). Very important! Do this on a copy of your workspace or use subversion because maybe you need to delete the .metadata folder for a successful export. ( you will loose all your workspace settings )

When you want to do this with Maven instead of ANT you can use these scripts and poms https://github.com/biemond/soa_tools/tree/master/maven_osb_ps5
or for PS6
https://github.com/biemond/soa_tools/tree/master/maven_osb_ps6
or with the new PS6 configjar tool which can create offline OSB exports without OEPE http://biemond.blogspot.nl/2013/04/offline-oracle-service-bus.html 

Here is the build.properties.
The ANT build.xml
When you want to run the ANT task from CMD then you need these environment variables
You can use these ANT tasks
ant exportFromWorkspace ( do this on a copy of your OEPE workspace )
ant importToOSB
ant exportFromOSB

Or you can run these task in JDeveloper, then you need to update these classpath entries for ANT


And run your ANT task from JDeveloper.

Download the PS5 or PS6 source code on my github https://github.com/biemond/soa_tools

219 comments:

  1. Hi,

    I have problem:(
    we are planing to have the osb project in SVN.There are multiple user who will check in their proxy services,business service n all.
    What i want to do is check out this OSB artifacts from svn and deploy it on a server..which has to be automated.
    The problem here is i cannot use ur export from workspace as i will not have .metadata n all.
    So how will i do this automation...I am really confuse..
    Please help me ,ie how will i implement this senario...
    Thanks
    Rohan

    ReplyDelete
  2. Hi,

    with the exportFromWorkspace ANT task, you don't need to have a .metadata folder, better not to have this because this will crash the export.

    just let Continious Integration do a checkout on a temp folder and exportFromWorkspace will delete this .metedata folder and you got an OSB export.

    hope this helps

    ReplyDelete
  3. Hi Edwin,

    can you elaborate on your point about deleting the .metadata folder in order to do a successful export?

    I am using more or less the same scripts, but I can make an export of the sources withiout first deleting the .metadata folder. I did some extra checks (apply changes, import after export etc) but I do not run into any problem..

    Regards,

    - Tom

    ReplyDelete
  4. Hi Tom,

    I have to do it else I get strange java errors without a glue what's wrong with it.

    [java]
    [java] Synchronizing "OSB Configuration"...
    [java] Error during configuration jar export.
    [java] Exporting to c:/temp/sbconfig.jar...

    BUILD FAILED
    C:\projecten\workspace\11g_prod\osb_deployment\Osb\build.xml:58: Java returned: 101


    When I delete this metadata folder then the export utility rebuilds the projects structure and the export is successful.

    When I take a look at the Oracle doc, Then I see that Oracle do the same.
    http://download.oracle.com/docs/cd/E14571_01/relnotes.1111/e10132/osb.htm#CJAJDHFF

    thanks

    ReplyDelete
  5. I am getting the following exception while trying to export from OSB
    ----------
    [wlst] File specified export.py does not exist
    [wlst] java.lang.IllegalStateException: File specified export.py does not e
    xist
    [wlst] Exception in thread "main" java.lang.IllegalStateException: java.lan
    g.IllegalStateException: File specified export.py does not exist

    ReplyDelete
  6. Hi,

    the export.py is located in the workspace zip and in this folder osb_deployment/Osb.

    thanks

    ReplyDelete
  7. Sorry but i searched my entire OSB11gR1 installation forlder but couldnt find workspace.zip folder. Any pointer as where can i find it.

    ReplyDelete
  8. Hi,

    I mean the download link under this blogpost.

    thanks

    ReplyDelete
  9. I am running this from the command line and when the export is processing I get the following error

    [java] java.lang.NoClassDefFoundError: javax/wsdl/extensions/ExtensionRegistry

    ReplyDelete
  10. Hi,

    you can add this jar to jdeveloper or to the bat file.

    do you have custom java in it. In my testcases I dont need this class or you can try to generate a weblogic full client instead of the weblogic.jar

    thanks

    ReplyDelete
  11. I did, I am using classpath refid to add jars to the process and I double checked it was bringing it in, but I still get the error

    ReplyDelete
  12. I figured out my issue, check out

    http://cn.forums.oracle.com/forums/thread.jspa?threadID=943099

    which is basically added...

    Add system property "com.bea.plateng.common.util.logging.useJDKlogger" set to "true" for configexport task, so that ANT target body look like:

    \[...]

    ReplyDelete
  13. I got this working successfully. I had to make a few minor changes.

    There is an issue when the project is deployed it deletes the System which causes issues with the Gobal Settings and causes everything to error...


    The Console has encountered an exception during the execution of an action. Details of the exception are displayed below. Console Exception
    Message com.bea.wli.config.component.NotFoundException: Validation failed for Operations System/Operator Settings/GlobalOperationalSettings: Referenced component (Operations System/Operator Settings/GlobalOperationalSettings) not found.
    Type com.bea.wli.config.component.NotFoundException

    ReplyDelete
  14. Hi,

    That why I make a OSB export from a subversion export and not doing it in the OSB workspace.

    and never commit this.

    thanks

    ReplyDelete
  15. Hello Edwin,
    Quick Question...
    Are there any pure ant tasks for OSB?
    I've been using BEA/Oracle Weblogic for a long time, and the ant tasks provided with Weblogic are very usefull. Basically all my app use ant and I would love to keep the same approach for my new OSB apps.

    Thank you.

    ReplyDelete
  16. Hi,

    not pure ANT, you can call wlst from ANT. Maybe in the next big release when it move to JDeveloper

    thanks

    ReplyDelete
  17. Hi,

    I have the exported sbconfig.jar generated properly and is getting imported in my local OSB11g environment properly. However when I try to do the export and import it in a remote environment, I get the following error:

    [wlst] DomainRuntime MBeanServer is not enabled on a Managed Server.
    [wlst]
    [wlst] ALSB Admin Server listening on : http://xxxx.com:50087
    [wlst] Created Session SessionScript1295650634270
    [wlst]
    [wlst] sessionMBean: None
    [wlst] Unexpected Error: exceptions.AttributeError
    [wlst] Unexpected Error: exceptions.AttributeError
    [wlst] No stack trace available.
    [wlst] Traceback (innermost last):
    [wlst] File "/home/bld/xxx/xyz/osb/deploy/scripts/delimport.py", line 70, in ?
    [wlst] File "/home/bld/xxx/xyz/osb/deploy/scripts/delimport.py", line 24, in removeFromALSBDomain
    [wlst] File "/home/bld/xxx/xyz/osb/deploy/scripts/delimport.py", line 64, in getSessionManagementMBean
    [wlst] AttributeError: 'NoneType' object has no attribute 'createSession'


    The significant difference I could find between my local env and the remote env is that I just have an adminserver running in my local and the remote has and adminserver and a managedserver running. I am trying to do the remote deployment onto the managed server. Please advise.


    Thank you.

    ReplyDelete
  18. Hi,

    can you deploy against the adminserver, maybe that will work.

    thnaks.

    ReplyDelete
  19. A few questions on this remote deployment issue as follows for which I seek your expert advise on the same.

    1. Though the managedserver port is different from the adminserver, I believe I should use the adminserver port to deploy the sbconfig.jar onto the managed server. Am I right?

    2. By any chances, should I add some code to register the managedserver for deploying the sbconfig.jar onto this managedserver.


    Thank you.

    ReplyDelete
  20. Hi Edwin,

    very very useful blog. Keep doign the nice job.
    Just a small question:
    what is the text editor you are using for the code shown in your screenshots?
    I mean the one with the numbered lines and the green vertical line on the left.

    Kind Regards,

    Loukas

    ReplyDelete
  21. Hi,

    that is google syntaxhighlighter.
    now moved to
    http://alexgorbatchev.com/SyntaxHighlighter/

    good luck

    ReplyDelete
  22. Hi Edwin,

    Thanks for this post, it helps alot! I'm having issues getting the java task to run though. I've tried running the "setDomainEnv.cmd" as you suggest in the readme, but I think the classpath ends up being too long. Here is the error I'm seeing:


    java.io.IOException: Cannot run program "D:\tools\WINDOW~1\jre\bin\java.exe" (in directory "D:\workspace\cjcitta_pmd.001.00_int_ci_sandbox\esd01\pmd_app\OSBScripts"
    ): CreateProcess error=87, The parameter is incorrect
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
    at java.lang.Runtime.exec(Runtime.java:593)
    ...

    ReplyDelete
  23. Hi,

    please check your PATH and other JAVA environment variables. I think this is your problem.

    thanks

    ReplyDelete
  24. Hi Edwin,

    In order to get this working without the entire middleware suite being installed locally, I had to copy the following directories into a separate lib directory and point my ant script at that: wlst, osb, oepe, and modules. Altogether this lib directory ends up just under 1 gig.

    So, it doesn't appear that Oracle yet has a way to build OSB projects from source in an IDE agnostic manner, or am I missing something? Basically we need the ability for a separate team to build and deploy from a machine which does not have weblogic, osb, or eclipse on it.

    Please let me know your thoughts!

    Thanks,
    ~sillydino

    ReplyDelete
  25. Hi,

    The way Oracle and BEA works with OSB = using the sbconsole web application. They dont use OEPE. in the next major release you can use jdeveloper which also contains wls etc.

    thanks

    ReplyDelete
  26. Hi Edwin,

    Thanks for the quick response! In that case I think for the build system we may end up rolling our own ant target that produces an importable jar. This way we can hand over a project to a separate team to be deployed, and that team only needs to have standard java and ant libs, plus a few wlst related ones. Basically we will avoid using the eclipse plugin for building at all.

    I'm starting to get the feeling that OEPE is being abandoned by Oracle for JDev? Are you able to confirm this? We've noticed several features missing from OEPE when building Proxy services; for instance, we can't set "service level monitoring" or add "access control" lists to a proxy with an owsm policy on it. Those views that exist inside the sb console (in browser) don't exist in Eclipse. We can hand edit the proxy code to make the changes without Eclipse, but the eclipse plugin won't publish those changes, it just ignores those parts of the source code. So really, having a build-from-source solution will kill two birds with one stone :)

    Do you know if these features that are missing in Eclipse are present in JDev? If Oracle is abandoning OEPE, do you recommend switching to JDev now or later?

    Thanks,
    ~sillydino

    ReplyDelete
  27. Hi,

    I'm starting to get the feeling that OEPE is being abandoned by Oracle for JDev?

    Not really, but I think for OSB, SOA and BPM it is. Oracle wants more productivity and full integration with other products. In the next big release OSB IDE will be in jdev.

    We've noticed several features missing from OEPE when building

    not everything is possible in eclipse and it needs some weblogic configuration, so the sbconsole does this for you.

    you can't switch to jdev now. maybe the best way is to work on the sbconsole and make from there an export.

    thanks

    ReplyDelete
  28. I have a question:

    Is there any possibility to export, with exportFromWorkspace, Global Configuration Settings which are located under System like JNDI Providers ?
    Thanks
    René

    ReplyDelete
  29. Hi Rene,

    If i do a test ( in PS3 ) with an alert in a osb project which needs a global smtpserver then I got this smtpserver entry in the sbconfig.jar when I set config.includeDependencies on true. with false then I dont get this in the export.

    thanks

    ReplyDelete
  30. Hi I am following your script to create jar file, following is the error i am getting : [java] Synchronizing "Pilot_OSB_Configuration"...
    [java] Initializing toplink project for use by the database adapter.
    [java] Exporting to c:/temp/sbconfig.jar...
    [java] Error during configuration jar export.

    We are having DBAdapters and JCA bindings in my application. Can you suggest on this.

    ReplyDelete
  31. Hi , I am following your scripts to create the jar from the workspace, which ahd DB adapters and JCA binding. and i am getting the following error
    [java] Synchronizing "Pilot_OSB_Configuration"...
    [java] Initializing toplink project for use by the database adapter.
    [java] Exporting to c:/temp/sbconfig.jar...
    [java] Error during configuration jar export.

    ReplyDelete
  32. Hi ,i was able to sort out thte issue, its the problem with a file in the build i got, which is holding to get the jar file created
    Thanks ...

    ReplyDelete
  33. Hi, when try to create a jar from the workspace, though i was able to create a sbconfig.jar file, i am getting the following [Fatal Error] and also its reporting that "Workspace does not contain any projects" do u have nay idea on this error.

    [java] Workspace does not contain any projects; importing project directories in workspace directory...
    [java] Importing project located in "OSB Project 1" directory of the workspace...
    [java] [Fatal Error] :1:1: Premature end of file.
    {java] [Fatal Error] :1:1: Premature end of file.

    ReplyDelete
  34. Hi,

    that is because I delete the metadata folder in ANT. you can remove this. I did this because sometimes this folder crashes my export.

    with this delete your export still works, but for workshop you need this so only do this from subversion.

    ReplyDelete
  35. Edwin,

    Did/Do you have time to test your scripts against the latest version of OSB? We are facing a huge performance decrease, comparing to the previous version. Creating a config file with JCA Adapters (DB) takes 45 minutes to create. And yes we do not have access to these databases (from our CI server). :-) Look like a timeout issue.

    The log shows, lots of:

    java] [Fatal Error] :1:1: Premature end of file

    Marc

    ReplyDelete
  36. Hi Marc,

    I checked the export from OEPE, that worked fine without the delete of the metadata folder.

    maybe it checks the weblogic server which is not online in your case.

    what should I check , export from OEPE , import & export OSB server.

    thanks

    ReplyDelete
  37. We solved it:

    We increased the "osgi.bundlefile.limit" property from 500 to 1000.

    <sysproperty key="
    osgi.bundlefile.limit" value="500"/>

    ReplyDelete
  38. Edwin, thank you for these scripts.

    I was able to use it to publish OSB resources from the command line. I was hoping to use it to integrate it into our CI process.

    In fact, this worked great only a week ago. When I tried it again today, it stop working for some reason... I have been trying to determine the root cause without much success.

    It simply hangs (I waited up to an hour) after this output:

    [java]
    [java] Workspace does not contain any projects; importing project directori
    es in workspace directory...
    [java] Importing project located in "ClaimDataAccessProject" directory of t
    he workspace...
    [java] Importing project located in "CommentsProject" directory of the work
    space...
    [java] Importing project located in "CommonResourcesProject" directory of t
    he workspace...
    [java] Importing project located in "FNOLProject" directory of the workspac
    e...
    [java] Importing project located in "Synch OSB Configuration" directory of
    the workspace...

    Is there a way to print out diagnostic message to see what is the problem?

    Thanks.

    ReplyDelete
  39. hi,

    you can try to remove the delete of the metadata folder, sometimes this is necessary to make an export.

    this will skip the making of the projects.

    thanks

    ReplyDelete
  40. Hi Edwin,
    I tried running the steps you have mentioned. But the export jar that I get after executing exportFromWorkspace does not have the OSB entities that I had created in my workspace - business services, proxy services etc. when I try to import the exported file manually into workspace I dont get anything.

    Could you please help on that? Thanks!

    ReplyDelete
  41. Hi,

    check these parameters
    config.subprojects="EJB,Rest"
    config.includeDependencies=true
    workspace.dir=C:/projecten/workspace/osb11g3

    and take a look at the output.

    thanks

    ReplyDelete
  42. Thanks Edwin, had figured this out. was missing out on the subprojects parameter. Worked like a charm. thanks for the quick reply though!

    ReplyDelete
  43. Hello Edwin,

    Can't we export the customisation file as well? when we exportFromWorkspace?

    ReplyDelete
  44. Hi Edwin,

    when i try to deploy the code into my domain using the command importToOSB i am getting this error in my command prompt - Failed to create task or type wlst.
    Cause: The name is undefined
    Action: Check the spelling
    Action: Check that any custom tasks/types have been declared
    Action: Check that any / declarations have taken place.

    Could you please help on this? Thanks!

    ReplyDelete
  45. Hi,

    Can't we export the customisation file as well? when we exportFromWorkspace?

    that is not possible, only from the OSB server.

    thanks

    ReplyDelete
  46. Hi Edwin, i saw that ant in the task exportFromWorkspace create the jar succesfully but the task dont verify that the project compile. Is any way to do that? Thanks

    ReplyDelete
  47. Hi,

    For compiling of java sources you can do it easily in ANT.

    For validating OSB artifacts I don't have a solution, I think it is possible but I dont have any information or documentation

    thanks

    ReplyDelete
  48. Hi,
    I tried to export OSB project from worspace using the ant script youo mentioned in Unix machine, but I get the below java error while running the ant. Also the .metadata file is not getting created inside the workspace after running the script.

    usrapp $>ant -v exportFromWorkspace
    Apache Ant version 1.7.1 compiled on June 27 2008
    Buildfile: build.xml
    Detected Java version: 1.6 in: /usr/java/jdk1.6.0_23/jre
    Detected OS: Linux
    parsing buildfile /opt/apps/OSBWorkspace/OSBScripts/build/build.xml with URI = file:/opt/apps/OSBWorkspace/OSBScripts/build/build.xml
    Project base dir set to: /opt/apps/OSBWorkspace/OSBScripts/build
    [antlib:org.apache.tools.ant] Could not load definitions from resource org/apache/tools/ant/antlib.xml. It could not be found.
    [property] Loading /opt/apps/OSBWorkspace/OSBScripts/build/export.properties
    Build sequence for target(s) `exportFromWorkspace' is [exportFromWorkspace]
    Complete build sequence is [exportFromWorkspace, import, ]

    exportFromWorkspace:
    [java] Executing '/usr/java/jdk1.6.0_23/jre/bin/java' with arguments:
    [java] '-XX:MaxPermSize=256m'
    [java] '-Xmx768m'
    [java] '-Dweblogic.home=/opt/apps/wls/wl1033/wlserver_10.3'
    [java] '-Dosb.home=/opt/apps/wls/wl1033/osb113'
    [java] '-Dosgi.bundlefile.limit=500'
    [java] '-Dharvester.home=/opt/apps/wls/wl1033/osb113/harvester'
    [java] '-Dosgi.nl=en_US'
    [java] '-Dcom.bea.plateng.common.util.logging.useJDKlogger=true'
    [java] '-Dsun.lang.ClassLoader.allowArraySyntax=true'
    [java] '-jar'
    [java] '/opt/apps/wls/wl1033/OEPE/plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar'
    [java] '-data'
    [java] '/opt/apps/OSBWorkspace'
    [java] '-application'
    [java] 'com.bea.alsb.core.ConfigExport'
    [java] '-configProject'
    [java] 'TestOSBConfiguration'
    [java] '-configJar'
    [java] '/opt/apps/OSBWorkspace/out/sbconfig.jar'
    [java] '-configSubProjects'
    [java] 'GetCustomerAccountHierarchy'
    [java] '-includeDependencies'
    [java] 'true'
    [java]
    [java] The ' characters around the executable and arguments are
    [java] not part of the command.

    BUILD FAILED
    /opt/apps/OSBWorkspace/OSBScripts/build/build.xml:48: Java returned: 13
    at org.apache.tools.ant.taskdefs.Java.execute(Java.java:108)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    .........

    Total time: 2 seconds

    This script perfectly works if I run in windows. The directory permissions in unix box is 777 only. please help me in fixing this.

    Thanks
    Harini

    ReplyDelete
    Replies
    1. Got exactly the same error, but found out that in oepe-eclipse-ini an additional param was set: middleware.home
      Using this with value of the installation brought the desired result.

      PS: maybe someone need this for future

      Delete
  49. Hello,
    Thanks for the wonderful blog. I was able to import the OSB project from a jar file using your scripts. I was wondering if there is a way to deploy multiple projects in one shot?

    Regards,
    Rakhee

    ReplyDelete
  50. Hi,

    That should work look at these parameters

    config.subprojects="EJB,Rest"

    export.project = "EJB,Rest"
    import.project = None

    You need to use a , between your projects

    thanks

    ReplyDelete
  51. I am now able to deploy multiple jar and customization files, however it can be done only by an administrator, an integrationdeployer should be able to do this. I am getting Unexpected error: weblogic.management.NoAccessRuntimeException error when I try any user who is not an administrator. Please suggest. Thanks and regards.

    ReplyDelete
    Replies
    1. I presume you either resolved this or settled for Admin access but if not the answer is that this is a bug (that exists in OSB at least to Version 11.1.1.5) for which Oracle can provide a version specific patch that allows someone in the Deployers group to deploy via WLST (which make ti equivalent to permissions needed to do it via the OSB Console)

      Delete
  52. I am able to run it using user accounts with integrationdeployers group membership too. Thank you for ur help.

    ReplyDelete
  53. Hi,

    the only thing I can see in the linux logging is that it missing org/apache/tools/ant/antlib.xml

    did you installed wls,osb and oepe on linux and did you check your java and other environment variables.

    thanks

    ReplyDelete
  54. Hi Edwin,
    Thanks a lot for the reply. I have installed wls,osb and oepe in linux. Also verified java and other env varaibles if they point to correct location. I am really stuck with this issue. please kindly help me in getting it fixed.

    Thanks
    Harini

    ReplyDelete
  55. Hi Edwin,
    I found the logfile in /configuration folder. I have attached the log message below. It looks like the class com.bea.alsb.core.ConfigExport is not present . Please help me in fixing this.

    !SESSION 2011-06-07 01:08:32.223 -----------------------------------------------
    eclipse.buildId=unknown
    java.version=1.6.0_23
    java.vendor=Sun Microsystems Inc.
    BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
    Framework arguments: -application com.bea.alsb.core.ConfigExport -configProject TestOSBConfiguration -configJar /opt/apps/OSBWorkspace/out/sbconfig.jar -configSubProjects GetCustomerAccountHierarchy -includeDependencies true
    Command-line arguments: -data /opt/apps/OSBWorkspace -application com.bea.alsb.core.ConfigExport -configProject TestOSBConfiguration -configJar /opt/apps/OSBWorkspace/out/sbconfig.jar -configSubProjects GetCustomerAccountHierarchy -includeDependencies true

    !ENTRY org.eclipse.equinox.p2.repository 4 0 2011-06-07 01:08:33.128
    !MESSAGE ProvisioningEventBus could not be obtained. Metadata caches may not be cleaned up properly.

    !ENTRY org.eclipse.osgi 4 0 2011-06-07 01:08:33.177
    !MESSAGE Application error
    !STACK 1
    java.lang.RuntimeException: Application "com.bea.alsb.core.ConfigExport" could not be found in the registry. The applications available are: org.eclipse.ant.core.antRunner, org.eclipse.ant.ui.antRunner, org.eclipse.datatools.connectivity.console.profile.StorageFileEditor, org.eclipse.emf.codegen.CodeGen, org.eclipse.emf.codegen.JMerger, org.eclipse.emf.codegen.ecore.Generator,
    .............

    Thanks
    Harini

    ReplyDelete
  56. Hi,

    Make sure that the OSB home is set and that you got the right version of the equinox jar located in the eclipse ide plugin folder and that you load the alsb.jar and the configfwk jar in the sh scripts, just like the bat script

    Thanks

    ReplyDelete
  57. Hi Edwin,
    I checked the equinox jar version, its "org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar" only. Also ensured that alsb and fwk are in class path. but still could not recover from that error. I have attached my build script below , can u pls chk if anything is wrong in it.

    ReplyDelete
  58. Hi,

    Ok skip ant and go for java. There is a example in the documentation.

    Maybe delete the metadata folder

    If this don't work make a support call.

    Good luck

    ReplyDelete
  59. Hi!
    I'm using this tutorial, but when I run the ant script I got the following error:
    Cause: The name is undefined.
    Action: Check the spelling.
    Action: Check that any custom tasks/types have been declared.
    Action: Check that any / declarations have taken place.
    I'm using SOA Suite 11.1.1.4.
    Thanks in advance.
    Martín.-

    ReplyDelete
  60. brilliant! thank you so much also for all the answers given in the comments - you should add a "donate" button on your blog :o)

    ReplyDelete
  61. I have the same problem as some othere before me have had here:

    [java] Synchronizing "OSBConfiguration"...
    [java] Exporting to sbconfig.jar...
    [java] Error during configuration jar export.

    Tried to clean out the .metadata folder with no success and the output from the script doesn't give me any clues what so ever what might be wrong now...

    ReplyDelete
  62. Hi,

    Can you check the ant properties settings for the projects settings

    do you see any output

    check the OSB jars I am using in these scripts , they must exists and must match with your PS version.

    Good luck

    ReplyDelete
  63. Hi,

    Undeploy OSB task is availabe in you script?

    ReplyDelete
  64. Hi,

    undeploy is not available in my script and I don't know if this is possible. You can need to check the ALSB mbean operations if this is possible

    ALSBConfigurationMBean = findService("ALSBConfiguration", "com.bea.wli.sb.management.configuration.ALSBConfigurationMBean")

    thanks

    ReplyDelete
  65. Hi,

    I had also this error: [java] Error during configuration jar export.
    but I solved it. I had a problem in my Oracle service bus Configuration. I had to edit file com.bea.alsb.core.prefs which is in folder .settings of my OSB Configuration.

    And I didn't need to delete the .metadata

    But I have a question, is it posible to change some variables. When I am deploying .jar using sbconsole I can uncheck options in Advancet Settings : Preserve Enviroment Variables, Preserve Operational Values. Can I change this options when I am deploying using the Ant script?

    Thx.

    ReplyDelete
  66. Hi,

    Sorry the export options are very limited or well hidden.

    Thanks

    ReplyDelete
  67. Hi Edwin,
    Thanks a lot for the tremendous resource! Is this the oracle recommended/approach for deployment? I didnt find any oracle docs referring to the python scripts? Also, we want to only build the project and apply customization on it so that we could manually deploy it later(i.e stage to prod). do you suggest a regular ANT script to find replace values, since we cant seem to customize the import.py script to replace and then deploy?
    any thoughts,
    Krishna

    ReplyDelete
  68. Hi,

    here are some doc references and I think there are some oracle OSB examples which does the same but not so complete.

    http://download.oracle.com/docs/cd/E21764_01/doc.1111/e15866/tasks.htm#OSBDV127

    http://download.oracle.com/docs/cd/E21764_01/doc.1111/e15866/tasks.htm#OSBDV125

    The deployment changes are done after you deploy to the OSB. no need to this now.

    thanks

    ReplyDelete
  69. Thanks Edwin for the quick response!I found the samples on oracle.However,our prod deployment process is to package the jar and move to stage folder from which point a deployment team takes over. So, can you recommend best strategy only to build jar by applying customization file? Use a custom ANT task or to tweak import.py script?
    Thanks in advance,
    Krishna

    ReplyDelete
  70. Hi,

    this is a bit strange, because you are changing the jar and this is not the same which is tested.

    you can still generate a deployment plan , unzip the jar and make a custom framework which reads and apply the deployment plan.

    good luck

    ReplyDelete
  71. Thanks Edwin for making the point! I failed to envision repackaging the jar. We only want to avoid keeping a hot prod deployment script in another env which is prone to be mistakenly used.

    ReplyDelete
  72. If somebody want to know, you can change Preserve enviroment variable option by editing import.py file. line 54 :

    alsbImportPlan.setPreserveExistingEnvValues(false/true)

    ReplyDelete
  73. J/Edwin,
    Is there a way to create new env variables that are not part of default customization file?

    ReplyDelete
  74. Hi,

    If it is an Mbean property or can do it in à script then it is possible

    Thanks

    ReplyDelete
  75. This comment has been removed by the author.

    ReplyDelete
  76. Hi Edwin

    Great tutorial, got everything working a treat.

    One thing I find disappointing is that Oracle requires me to install a whole heap of s/w (that I will never use such as local instances of WLS, OSB etc)just so I can design OSB flows and export them to a remote server. I guess it will be easier once we have a unified IDE - either Jdev or Eclipse - that sits along side SOA 11g. Not holding my breath tho!

    ReplyDelete
  77. Hi,

    in a year you can do it all from jdeveloper 12c. So I think there will be some alignment with the SOA Suite deployment and I heard also some things about everything in maven.

    thanks

    ReplyDelete
  78. Hi Edwin,
    I have nested Osb projects structure and only one Osb Configuration Project. If I use the Eclipse Workspace, I get shortly after next checkout from SVN repository “out of sync” between my workspace and project files. And without Eclipse workspace I’m not able to create temporary workspace with all projects from my nested Osb project structure.
    I want to do it without Eclipse GUI, only from Command Line. Do you mean, is there a possibility to refresh the existing Eclipse workspace via org.eclipse.equinox.launcher or to create a temporary workspace from a nested project structure, what actually I would prefer.

    Thanks.
    Peter.

    ReplyDelete
  79. Hi,

    you should not check in your eclipse workspace in svn, leave it out.

    Put only your osb projects in subversion. ( these projects needs to be on a different path )

    So create a new workspace and import the projects but leave it on that location ( dont import it into your workspace.)

    thanks

    ReplyDelete
  80. I am trying export from console using script and getting below error.

    exportFromOSB:
    [wlst] All lines will be trimmed by 11
    [wlst] Line: adminUser=sys.argv[1] . Final trim length: 11, String length: 34
    [wlst] Line: adminPassword=sys.argv[2] . Final trim length: 11, String length: 38
    [wlst] Line: adminUrl=sys.argv[3]. Final trim length: 11, String length: 31
    [wlst] Line: exportJar = sys.argv[5]. Final trim length: 11, String length: 34
    [wlst] Line: customFile = sys.argv[6]. Final trim length: 11, String length: 35
    [wlst] Line: passphrase = "osb". Final trim length: 11, String length: 29
    [wlst] Line: project = sys.argv[4]. Final trim length: 11, String length: 32
    [wlst] Line: connect(adminUser,adminPassword,adminUrl) . Final trim length: 11, String length: 53
    [wlst] Line: domainRuntime(). Final trim length: 11, String length: 26
    [wlst] Executing the command line :
    [wlst] "C:\Program Files\Java\jre6\bin\java.exe" -Ddebug=true -DfailOnError=true -DexecuteScriptBeforeFile=true -DfileName=exportCustomization.py "-


    weblogic.management.scripting.WLSTInterpreterInvoker "${wls.username} ${wls.password} ${wls.server} ${export.pr
    ject} ${export.jar} ${export.customFile}"
    [wlst] java.lang.NoClassDefFoundError: weblogic/management/scripting/WLSTInterpreterInvoker
    [wlst] Caused by: java.lang.ClassNotFoundException: weblogic.management.scripting.WLSTInterpreterInvoker
    [wlst] at java.net.URLClassLoader$1.run(Unknown Source)
    [wlst] at java.security.AccessController.doPrivileged(Native Method)
    [wlst] at java.net.URLClassLoader.findClass(Unknown Source)
    [wlst] at java.lang.ClassLoader.loadClass(Unknown Source)
    [wlst] at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    [wlst] at java.lang.ClassLoader.loadClass(Unknown Source)
    [wlst] Could not find the main class: weblogic.management.scripting.WLSTInterpreterInvoker. Program will exit.
    [wlst] Exception in thread "main"
    [wlst] Java Result: 1

    ReplyDelete
  81. Hi,

    Can you check your classpath and check for the weblogic.jar or generate a wlfullclient and add this.

    Thanks

    ReplyDelete
  82. Hi Edwin,
    I was facing the same problem like MahiMahi above, and added wlfullclient.jar as you mentioned.
    However I am getting the same error.
    Little more detail -- I am getting a successful result when I am running the ant script from command line.
    The problem (this error) arises when I use Hudson to do this.
    Any ideas Edwin?

    ReplyDelete
  83. Hi,

    I was trying to run the ant file using our CI server (hudson). The import is working fine, but the target exportFromWorkspace is not working as expected. I get an error saying that "Exception launching the Eclipse Platform:" This being a separate machine, I had just used the plugin - org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar, as this machine does not have OEPE installed.
    My question is - is it necessary to install OEPE on this machine as well, or is there a way to just include the plugins/jars in any directory and give a reference to that directory in my build.xml.

    NB: This hudson machine builds the OSB artifacts from our SVN repository.

    ReplyDelete
  84. Hi,

    for the export you need to install weblogic, osb and oepe.
    in the export function I am using some jar of the oepe osb extensions.

    don't know if it works with just jars and without oepe and osb installation.

    thanks

    ReplyDelete
  85. Hi,

    Do you have a hudson output and do you run the bat file on the same machine.

    thanks

    ReplyDelete
    Replies
    1. Hi ,
      when I execute my build.xml it gives me the following error :
      [java] Specified OSB Configuration project "../build /IntegrationWorkspace/sbconfig/ExportInfo" not found, config export cannot proceed

      [java] Workspace does not contain any projects; importing project directories in workspace directory...
      [java] Java Result: 101

      Delete
    2. Hi,

      what are your property settings, it is something like this

      config.project="OSB Configuration"
      config.subprojects="ASynchronous"
      workspace.dir=C:/Users/Gebruiker/workspace

      this is a bit strange for me
      ../build /IntegrationWorkspace/sbconfig/ExportInfo

      thanks

      Delete
  86. Hi Edwin,

    Very helpful post. I am having a problem though. I am using Hudson to call the ant target 'exportFromWorkspace', but the process hangs after creation of sbconfig.jar. It takes almost 4-5 hours for the next target to call the next target. I am using OSB version 11.1.1.5 and OEPE version 11.1.1.7.2 on a Linux box. Following is the output I get:

    [java] Workspace does not contain any projects; importing project directories in workspace directory...
    [java] Importing project located in "Project_A" directory of the workspace...
    [java] Importing project located in "Project_B" directory of the workspace...
    [java] Importing project located in "Project_C" directory of the workspace...
    [java] Synchronizing "OSB Configuration"...
    [java] Exporting to /my_path/sbconfig.jar...
    [java] Export complete.

    I tried both commenting and uncommenting the delete .metedata folder but to no avail. Please help.

    Thanks in advance,
    Karthik

    ReplyDelete
    Replies
    1. Hi,

      Does it work without hudson and do you have set all the environment variables in hudson, like the temp folder .

      hope this helps

      Delete
    2. [wlst]
      [wlst] DomainRuntime MBeanServer is not enabled on a Managed Server.
      [wlst]
      [wlst]
      [wlst] ALSBConfiguration MBean found
      [wlst] Mortgage_Broker
      [wlst] Export the project Mortgage_Broker
      [wlst] Unexpected error: exceptions.AttributeError
      [wlst] No stack trace available.
      [wlst] Traceback (innermost last):
      [wlst] File ".\osb_export.py", line 64, in ?
      [wlst] File ".\osb_export.py", line 37, in exportAll
      [wlst] AttributeError: 'NoneType' object has no attribute 'exportProjects'
      [wlst]
      [wlst] Exception in thread "Main Thread" java.lang.IllegalStateException: Traceback (innermost last):
      [wlst] File ".\osb_export.py", line 64, in ?
      [wlst] File ".\osb_export.py", line 37, in exportAll
      [wlst] AttributeError: 'NoneType' object has no attribute 'exportProjects'
      [wlst]
      [wlst] at weblogic.management.scripting.WLSTInterpreterInvoker.printError(WLSTInterpreterInvoker.java:110)
      [wlst] at weblogic.management.scripting.WLSTInterpreterInvoker.executePyScript(WLSTInterpreterInvoker.java:103)
      [wlst] at weblogic.management.scripting.WLSTInterpreterInvoker.main(WLSTInterpreterInvoker.java:27)

      ???

      Delete
    3. Hi,

      are all the managed servers running and are you exporting against the adminserver or against the osb server.

      thanks

      Delete
    4. Hi Edwin,

      Sorry for the late reply. It works without Hudson within 5-10 mins. But when i call the ant target from Hudson, it takes a long time. All variables are present, still the same.

      Thanks in advance,
      Karthik

      Delete
  87. Hello,
    Have you been able to adjust the script for 11.1.1.6? I keep getting the following message when I try exportFromWorkspace, "Caused by: java.lang.NoClassDefFoundError: org/apache/xmlbeans/SchemaTypeLoader" but I have added serveral jars to my classpath that contain this class, specifically every version of com.bea.core.xml.xmlbeans****.jar I could find. I have been able to build for 11.1.1.3 and .5 versions.

    Thanks.

    ReplyDelete
    Replies
    1. Hi,

      here we go
      https://github.com/biemond/soa_tools/tree/master/ant_osb_ps5

      I needed to set some extra vars on the java task. I didn't test the import and export task. Will do that tomorrow.

      thanks

      Delete
    2. I am successfully building again. I was trying to set the classpath up from a command prompt as I have done in the past.
      Thanks alot for your help and this valuable website.

      Delete
  88. I want export from server multiple project OSB in one .jar without using OSBConfig because the projects aren't in workspace..How i can do it plzz ???

    ReplyDelete
    Replies
    1. Hi,

      multiple projects in one workspace is supported, Don't if it works without a OSB configuration project. I know it needs an eclipse workspace with a .metadata folder.

      thanks

      Delete
    2. I watn export the projects from sbconsole et not from workspace ..How i can do it

      Delete
  89. i want that export.py export multiple project from sbconsole

    ReplyDelete
    Replies
    1. Hi,

      I think you need to change this part of the export.py

      else :
      ref = Ref.makeProjectRef(project);
      print "Export the project", project
      collection = Collections.singleton(ref)
      theBytes = ALSBConfigurationMBean.exportProjects(collection, passphrase)


      Loop through the projects and add it to the Collections parameter

      thanks

      Delete
  90. hi Edwin,
    The customization file changes are not reflected in subsequent runs of the scripts. Like if I had a end point http://host1/test and I imported this successfully. If I run this script again this time with custom File having endpoint http://host2/test. This doesnt work. The business service still shows http://host1/test. Ideally it should replace the old enpoint with the new one.

    ReplyDelete
  91. Hi Edwin,

    We are doing CI for our Bus projects. All is well with the Ant scripts except when I tried to use relative path for certain properties like -data.
    Interestingly it works if I directly invoke it from command promt(i.e., execute java), however, when I turn the same thing into Ant script, it says that the "OSB Configuration Project" could not be found and Java 101 error is shown.
    Now to give you a background, I am using random folders and not eclipse workspace. So .metadata folder is not there.

    Command that works:
    =====================
    java ^
    -Dmiddleware.home=C:\Oracle\MiddlewareDev ^
    -Dweblogic.home=C:\Oracle\MiddlewareDev\wlserver_10.3 ^
    -Dosb.home=C:\Oracle\MiddlewareDev\Oracle_OSB1 ^
    -Dosgi.bundlefile.limit=500 ^
    -Dharvester.home=cC:\Oracle\MiddlewareDev\Oracle_OSB1\harvester ^
    -Dosgi.nl=en_US ^
    -Dsun.lang.ClassLoader.allowArraySyntax=true ^
    -jar C:\Oracle\MiddlewareDev\oepe_11.1.1.8.0\plugins\org.eclipse.equinox.launcher_1.2.0.v20110502.jar ^
    -data .\ ^
    -application com.bea.alsb.core.ConfigExport ^
    -configProject "OSB Dev Conf" ^
    -configJar poc_sbconfig.jar ^
    -configSubProjects "HelloWorld" ^
    -includeDependencies true


    Corresponding Ant snippet that fails:
    ========================================


















    Properties file:
    ================


    alsb.import.script=import.py
    import.build.props.file=import.properties
    clean.msg=Cleaned
    build.msg=Built
    deploy.msg=Deployed
    build.compiler=extJavac
    outputdir=CI_OUT
    eclipse.home=C:\\Oracle\\MiddlewareDev\\oepe_11.1.1.8.0
    equinox.jar.version=1.2.0.v20110502
    fmw.home=C:\\Oracle\\MiddlewareDev
    weblogic.home=C:\\Oracle\\MiddlewareDev\\wlserver_10.3
    osb.home=C:\\Oracle\\MiddlewareDev\\Oracle_OSB1
    workspace.dir=".\\"
    config.project="OSB Dev Conf"
    config.subprojects="HelloWorld"
    config.jar=sbconfig.jar
    config.includeDependencies=true

    I am using Winddows for this. Have you faced similar problem?

    ReplyDelete
    Replies
    1. Hi,

      I think you are missing some environment settings when you do it from hudson. Maybe you can use forward slashes and check your env path does not contain spaces.

      thanks

      Delete
    2. Hi Ankur,I am getting th esam e error.but for me i have used maven to call ant script.How did u fix dat issue???please rep ASAP

      Delete
  92. Hi Edwin ,
    I m getting some error in the time of executing import.py .At line number 7

    ost:7001', 'None', 'c:/sbconfigjar/sbconfigPV.jar', 'c:/sbconfigjar/cust.xml']
    [wlst] Connecting to t3://localhost:7001 with userid weblogic ...
    [wlst] Successfully connected to Admin Server 'AdminServer' that belongs to
    domain 'base_domain'.
    [wlst]
    [wlst] Warning: An insecure protocol was used to connect to the
    [wlst] server. To ensure on-the-wire security, the SSL port or
    [wlst] Admin port should be used instead.
    [wlst] Exception in thread "main" java.lang.IllegalStateException: Tracebac
    k (innermost last):
    [wlst] File "import.py", line 7, in ?
    [wlst] ImportError: no module named config
    [wlst]
    [wlst] at weblogic.management.scripting.WLSTInterpreterInvoker.printErr
    or(WLSTInterpreterInvoker.java:110)
    [wlst] at weblogic.management.scripting.WLSTInterpreterInvoker.executeP
    yScript(WLSTInterpreterInvoker.java:103)
    [wlst] at weblogic.management.scripting.WLSTInterpreterInvoker.main(WLS


    can u please help me out to resolve this..is it the issue of cust.xml file or some thing else

    ReplyDelete
  93. Hi Edwin,

    regarding by previous post,i have resolved that issue.It was the jar issue.
    Can u plz tell me what is the use of the target "exportFormOSB"......If u plz gv any idea,then it will be help full for me..

    And one more thing,Suppose My workspace is in remote system,lets say SVN,for that we have to login through credential.So shall i use this workspace(SvnWorkspace) as a local workspace instead of checking out the large code.And deploy it directly to the local server. waiting for your reply.....

    ReplyDelete
    Replies
    1. Hi,

      With exportFromOSB you can make a export from the SBConsole and import that to a other server
      , some developers don't use OEPE.

      I also do an export of svn and use that.

      thanks

      Delete
    2. Ok thanks for the reply...one issue i am facing,dat in my project der is a customisation.xml file.I cant not see the use of this.bcoz the endpoint uri is not getting changed.it is reaming the same.

      I was trying to mavenise the script.dat is done.but i can not find the jars in any repository.so that my code should be machine independent.can u plz help on that???

      Delete
    3. hi

      can you check if it works when you do it manually in the sbconsole.
      if so then i will check it.

      thanks

      Delete
    4. Edwin,
      I have mavenised the code.means I have just only automise the code.But the actual thing to be required is dat i need to get those jars,like equinox.launcher,kernel,xml means jars from any repository.So it will bcum machine/eclipse independent.If i m anywhere wrong,please let me kno.
      And one more thing,U didnt said abt endpont uri thing.How do i change the end point uri using customisation file

      Delete
    5. Hi Indranil,
      Iam also getting the same error

      ImportError: no module named config

      how did u resolve it .

      Delete
    6. Hi,

      please download the latest import and export.py from github for your customization plans.
      https://github.com/biemond/soa_tools/tree/master/ant_osb_ps5

      Delete
    7. Hi Anonymous sorry for you hav nnot mentioned your name..
      I guess you are facing jar issue..



      ensure that this to jars r present with proper version or not.

      I guess the issue will be resolved

      Delete
    8. Hi Edwin,
      i have a question.to run the script is it essential to hava eclipse home or all those things.if i directly place the jars only.will it work??can we make it eclipse independent??please revert back ASAP

      Delete
    9. Hi,

      It depends when you export artifacts from the osb eclipse workspace , you need it all but for import and export from sbconsole then you probably need the sb kernel api and a few others.

      thanks

      Delete
    10. now my situation comes that,i need to compile the svn code(all the osb projects and all).which will create the jar and place it some repostry.for that some tool is there who will run this.but here i get a exception lik OsbConfiguration is not found.I do think that it is the issue of relative workspace directory path.



      07-Jun-2012 02:22:13 [java]
      07-Jun-2012 02:22:13 [java] Workspace does not contain any projects; importing project directories in workspace directory...
      07-Jun-2012 02:22:13 [java] Specified OSB Configuration project "/realativepath/SampleOSBConfiguration" not found, config export cannot proceed.
      07-Jun-2012 02:22:14 [INFO] ------------------------------------------------------------------------
      07-Jun-2012 02:22:14 [ERROR] BUILD ERROR
      07-Jun-2012 02:22:14 [INFO] ------------------------------------------------------------------------
      07-Jun-2012 02:22:14 [INFO] An Ant BuildException has occured: The following error occurred while executing this line:
      07-Jun-2012 02:22:14 relativepath/BuildScript/build.xml:188: Java returned: 101



      please help me on that.thing is now my whole thing is in svn.i can not give workspace directory.please do reply ASAP

      Delete
    11. Hi,

      Can you check this example , this one is complete with a osb workspace and it works for PS5 but you can change it
      https://github.com/biemond/soa_tools/tree/master/ant_osb_ps5

      thanks

      Delete
  94. Hi,

    I fixed the issue with customization plan , Also export cust plan works better now.

    check github for the latest resources, The PS5 version contains a total testset with a OSB workplace.
    https://github.com/biemond/soa_tools/tree/master/ant_osb_ps5
    https://github.com/biemond/soa_tools/tree/master/ant_osb

    thanks

    ReplyDelete
  95. Is there anyway we use these scripts to just export the OSB 'Resources' and not the complete project/subproject using ant scripts for the code checked out from SVN? Eclipse IDE allows you to either export the complete project / specific selected resources in a project into a .jar file. I don't see anyway to do that with these scripts.

    'config.subprojects' property still refers to a sub project which is exported to sbconfig.jar with all artifacts in that subproject.

    For example: If I have to export only 2 schema files which changed in a subproject, I can export the same using eclipseIDE by selecting export resource option into a .jar file. I want to do the same with the ant scripts. Is there a way to do that?

    ReplyDelete
    Replies
    1. Hi,

      Sorry only everything or some projects. but maybe you can export everything and with ANT you can unzip it and include your wanted artifacts to a new zip.

      Thanks Edwin

      Delete
  96. Hi Edwin,

    Is there a way to customize the script, or try to increase a parameter to take less? In eclipse compilation and packaging is immediate, with the script takes at least 7 min. Thats why?

    Thanks in advance

    ReplyDelete
    Replies
    1. Hi,

      Do what you want , you can fork it, clone etc on github and let me know if you can improve it. Eclipse already got everything validated and loaded, that's why it's fast.

      thanks

      Delete
  97. Hi Edwin,

    OSB: 11g (11.1.1.5)
    I have the next organization:

    OSBConfigurationProject
    .... EntityProject
    ............ Employee
    ................. proxy
    ....................... EmployeeInterface_PS.proxy
    ............ User
    ................. proxy
    ....................... UserInterface_PS.proxy

    I need to export the subproject 'Employee' using ant script. I am able to export 'EntityProject' with 'Employee' and 'User' included, but not only one subproject, is this possible?

    Thanks in advance

    ReplyDelete
    Replies
    1. Hi,

      I think you talk about OEPE, there you can only export all or projects. I think Employee is not a project but a folder.

      thanks

      Delete
  98. Hi Edwin,

    I used the code that you kept in the following location https://github.com/biemond/soa_tools/tree/master/ant_osb_ps5.

    But i am getting the below error and for importing and exporting it is saying authentication failed....

    [wlst] Connecting to t3://localhost:7001 with userid weblogic ...
    [wlst] Successfully connected to Admin Server 'AdminServer' that belongs to
    domain 'base_domain'.
    [wlst]
    [wlst] Warning: An insecure protocol was used to connect to the
    [wlst] server. To ensure on-the-wire security, the SSL port or
    [wlst] Admin port should be used instead.
    [wlst] Exception in thread "main" java.lang.IllegalStateException: Tracebac
    k (innermost last):
    [wlst] File "import.py", line 7, in ?
    [wlst] ImportError: no module named config
    [wlst]
    [wlst] at weblogic.management.scripting.WLSTInterpreterInvoker.printErr
    or(WLSTInterpreterInvoker.java:110)
    [wlst] at weblogic.management.scripting.WLSTInterpreterInvoker.executeP
    yScript(WLSTInterpreterInvoker.java:103)
    [wlst] at weblogic.management.scripting.WLSTInterpreterInvoker.main(WLS

    Can you please give me a solution on this points.

    1)It is connecting to the Admin Server Successfully but why it is saying Insecure Protocol?

    2)while executing export and Import why it is saying authenticaton failed?

    3)After getting of these errors i can able to build the file success full?

    4)After getting of build success full i am not getting the projects in my sbconsole. i.ethe projects are not deploying..

    Thanks for your time.

    Regards
    JMR

    ReplyDelete
    Replies
    1. Hi,

      for 1 you can ignore this. you are using t3 instead of t3s.
      but it looks like it can't find some jars. please check your classpath

      thanks

      Delete
  99. Hi Edwin,

    1st, thanks for the useful post, i was able to deploy the my OSB project to development server.

    But when come to production server, i having problem to deploy it due to production env is in cluster mode, so i just wonder, is that any modification need to be done?

    i have below error when deploy to the cluster.
    [wlst] weblogic.management.DeploymentException: weblogic.management.DeploymentException: [Deployer:149189]An attempt was made to execute the 'deploy' operation on an application named '_ALSB_1349464537458' that is not currently available. The application may have been created after non-dynamic configuration changes were activated. If so, the operation can not be performed until server is restarted so that the application will be available.

    base on the stacktrace, it show that it throws
    when SessionMBean.activateSession(sessionName, "Complete import for tag:" + tag).


    Hope that you can help to advice.

    Thanks.

    Regards,
    CC

    ReplyDelete
    Replies
    1. Hi,

      Very strange, mostly you need to deploy to the adminserver which contains the sbconsole.
      do you have more stacktrace for me.

      thanks

      Delete
    2. Hi Edwin,

      Below is the stacktrace


      [wlst] Exception in thread "main" java.lang.IllegalStateException: Traceback (innermost last):
      [wlst] File "d:\Warcraft-Porject\deployment\OSB\import.py", line 168, in ?
      [wlst] File "d:\Warcraft-Porject\deployment\OSB\import.py", line 41, in importToALSBDomain
      [wlst] weblogic.management.DeploymentException: [Deployer:149189]An attempt was made to execute the 'deploy' operation on an application named '_ALSB_1349707089276' that is not currently available. The application may have been created after non-dynamic configuration changes were activated. If so, the operation can not be performed until server is restarted so that the application will be available.
      [wlst] at weblogic.deploy.internal.targetserver.DeploymentManager.assertDeploymentMBeanIsNonNull(DeploymentManager.java:1319)
      [wlst] at weblogic.deploy.internal.targetserver.DeploymentManager.findDeploymentMBean(DeploymentManager.java:1360)
      [wlst] at weblogic.deploy.internal.targetserver.DeploymentManager.createOperation(DeploymentManager.java:1050)
      [wlst] at weblogic.deploy.internal.targetserver.DeploymentManager.createOperations(DeploymentManager.java:1406)
      [wlst] at weblogic.deploy.internal.targetserver.DeploymentManager.handleUpdateDeploymentContext(DeploymentManager.java:162)
      [wlst] at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.updateDeploymentContext(DeploymentServiceDispatcher.java:156)
      [wlst] at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doUpdateDeploymentContextCallback(DeploymentReceiverCallbackDeliverer.java:147)
      [wlst] at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.updateDeploymentContext(DeploymentReceiverCallbackDeliverer.java:29)
      [wlst] at weblogic.deploy.service.internal.statemachines.targetserver.ReceivedPrepare.callDeploymentReceivers(ReceivedPrepare.java:203)
      [wlst] at weblogic.deploy.service.internal.statemachines.targetserver.ReceivedPrepare.handlePrepare(ReceivedPrepare.java:114)
      [wlst] at weblogic.deploy.service.internal.statemachines.targetserver.ReceivedPrepare.receivedPrepare(ReceivedPrepare.java:52)
      [wlst] at weblogic.deploy.service.internal.targetserver.TargetRequestImpl.run(TargetRequestImpl.java:211)
      [wlst] at weblogic.deploy.service.internal.transport.CommonMessageReceiver$1.run(CommonMessageReceiver.java:458)
      [wlst] at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545)
      [wlst] at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
      [wlst] at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
      [wlst]
      [wlst] weblogic.management.DeploymentException: weblogic.management.DeploymentException: [Deployer:149189]An attempt was made to execute the 'deploy' operation on an application named '_ALSB_1349707089276' that is not currently available. The application may have been created after non-dynamic configuration changes were activated. If so, the operation can not be performed until server is restarted so that the application will be available.
      [wlst]
      [wlst] at weblogic.management.scripting.WLSTInterpreterInvoker.printError(WLSTInterpreterInvoker.java:110)
      [wlst] at weblogic.management.scripting.WLSTInterpreterInvoker.executePyScript(WLSTInterpreterInvoker.java:103)
      [wlst] at weblogic.management.scripting.WLSTInterpreterInvoker.main(WLSTInterpreterInvoker.java:27)
      [wlst] Java Result: 1
      Thanks.

      Regards,
      CC

      Delete
    3. Hi Edwin,

      Please discharge my previous comment, just found out that is because of the database error and causing it cannot be deploy.

      After fixed the database issue, it working now.

      Thanks.

      Regards,
      CC

      Delete
  100. Hi Edwin

    Will you be checking in the code for maven_osb_ps5 to the Git repository soon ?

    ReplyDelete
    Replies
    1. Hi,

      indeed the plan is this weekend.

      thanks

      Delete
    2. Hi,

      I got it also working with Maven and also with Java but and here you can find the code
      https://github.com/biemond/soa_tools/tree/master/maven_osb_ps5

      thanks

      Delete
  101. Hi, Edwin,

    After we introduced security policy in the code, our build script failed
    [java] Oct 8, 2012 1:48:36 PM oracle.wsm.policymanager.bean.util.PolicySetBuilder resolveReference
    [java] SEVERE: The policy referenced by URI "oracle/wss10_x509_token_with_message_protection_client_policy_police" could not be retrieved.

    Do i missed some jar in the build script? Is there any work around for this?

    cheers
    Kevin

    ReplyDelete
    Replies
    1. HI, More information, I added wsm-seed-policies.jar in the classpath, still not working. anything I missed?

      Delete
    2. Hi,

      Can you also add oracle_common\modules\oracle.webservices_11.1.1\wsclient.jar.
      and maybe this jar contains some references to other jars in the manifest.

      thanks

      Delete
    3. Hi, Edwin,

      Doesnt work. any idea? I put this in my build.xml

      <path id="policy.class.path">
      <fileset dir="${env.MW_HOME}/oracle_common/modules">
      <include name="oracle.wsm.policies_11.1.1/wsm-seed-policies.jar" />
      <include name="oracle.webservices_11.1.1/*.jar" />
      </fileset>
      </path>

      Delete
    4. Hi,

      maybe you can make a owsm jdeveloper proxy service client and then take a look at the libraries , jars so you know what you minimal need to have.

      thanks

      Delete
  102. Hi, Edwin,
    I successfully run the script to import the generated jar on my single managed domain server(AdminServer with osb). But if I import the same jar in Cluster environment, I got Exception as below.

    Could you help?thanks

    traceback:[wlst] Unexpected error: com.bea.wli.config.component.NotFoundException
    [wlst] Unexpected error: com.bea.wli.config.component.NotFoundException
    [wlst] No stack trace available.
    [wlst] Traceback (innermost last):
    [wlst] File "C:\iomsworkspace\target\import.py", line 170, in ?
    [wlst] File "C:\iomsworkspace\target\import.py", line 85, in importToALSBDomain
    [wlst] com.bea.wli.config.component.NotFoundException: Failed to create temporary jar file
    [wlst] at com.bea.wli.sb.resources.archive.classloader.ArchiveClassLoaderDerivedTypeDef.com
    puteData(ArchiveClassLoaderDerivedTypeDef.java:160)
    [wlst] at com.bea.wli.sb.resources.archive.classloader.ArchiveClassLoaderDerivedTypeDef.com
    puteData(ArchiveClassLoaderDerivedTypeDef.java:34)
    [wlst] at com.bea.wli.config.derivedcache.DerivedCache.deriveTheValue(DerivedCache.java:453
    )
    [wlst] at com.bea.wli.config.derivedcache.DerivedCache.get(DerivedCache.java:273)
    [wlst] at com.bea.wli.config.derivedcache.DerivedResourceManager.getDerivedValueInfo(Derive
    dResourceManager.java:341)
    .........
    [wlst] at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:788)
    [wlst] at javax.management.remote.rmi.RMIConnectionImpl_WLSkel.invoke(Unknown Source)
    [wlst] at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:667)
    [wlst] at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:522)
    [wlst] at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.jav
    a:363)
    [wlst] at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
    [wlst] at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:518)
    [wlst] at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
    [wlst] at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    [wlst] at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    [wlst] Caused by: java.io.IOException: No such file or directory
    [wlst] at java.io.UnixFileSystem.createFileExclusively(Native Method)
    [wlst] at java.io.File.checkAndCreate(File.java:1704)
    [wlst] at java.io.File.createTempFile(File.java:1792)
    [wlst] at com.bea.wli.sb.util.IOUtils.storeToTempFile(IOUtils.java:245)
    [wlst] at com.bea.wli.sb.resources.archive.classloader.ArchiveClassLoaderDerivedTypeDef.com
    puteData(ArchiveClassLoaderDException in thread "main" java.lang.IllegalStateException: Traceback (i
    nnermost last):

    .....

    ReplyDelete
    Replies
    1. Hi,

      I think you got a tmp folder proble , it can't upload the jar to a temporary folder. Please set the tmp dir and the permissions.

      thanks

      Delete
    2. yes, you are right. I asked UNIX team to add the folder for me. thanks

      Delete
  103. how to deploy multiple config.jar?if I ave more than one?

    ReplyDelete
    Replies
    1. Hi,

      You can change my script and make a loop.

      thanks

      Delete
  104. Hi Edwin,

    I have a question to do about the task "exportFromWorkspace" .. i need to know if its posible build with that task, a jar with specific files of a project, not an entire osb project.. for example i have a XSD and a WSDL file in my project, and i want to include in the jar only the XSD file, can be more files too like XQuery transformations and MFL transformations and folders, i mean build the jar with resources.

    thanks a lot and regards!

    ReplyDelete
    Replies
    1. Hi,

      only a whole workspace or 1 or more OSB projects.

      thanks

      Delete
    2. Thanks for the answer , Edwin... but my doubt now, is if exists some way to do a export of a sbconfig.jar programatically .. (not with the export of the Eclipse) with resources of diferent projects of the Osb Configuration?

      Thanks again!

      Delete
    3. Hi,

      in the end it is a jar with some files and folders , you can make your own build process.

      Delete
  105. Hi

    I have a general question regarding how ant and wlst compare with each other. What best suits for each of the following scenarios? Pros and cons of using either of them for these steps. Appreciate your comments.

    I have these tasks to perform. (1) Connect to my version control (called MKS) and fetch the OSB resources (2) Build an OSB jar file (3) Deploy to my OSB server and applying the customization xml file.

    ReplyDelete
  106. Hi Edwin, as you mentioned above, in my case I get following error even if I delete .matadata when I execute exportFromWorkspace task. Any suggestion to resolve this ?

    [java] Importing project located in "FilePolling" directory of the workspac
    e...
    [java] Importing project located in "Sample" directory of the workspace...
    [java] Synchronizing "Sample"...
    [java] Error during configuration jar export.
    [java] Exporting to D:/OSBBuild/temp/sbconfig.jar...

    BUILD FAILED
    D:\OSBBuild\tool\build.xml:58: Java returned: 101

    ReplyDelete
    Replies
    1. Hi,

      Do you have some more logging, Most likely it misses an environment variable
      can you try this java call ( at the bottom of the page ) instead of ant or maven
      https://github.com/biemond/soa_tools/tree/master/maven_osb_ps5

      thanks

      Delete
  107. Hi Edwin, Got some success in export. problem was with my config project. however getting error in import task. I tried options discussed above but somehow not able to solve this error.

    [wlst] Adding None to sys.argv
    [wlst] sys.argv is ['import.py', 'weblogic', 'S0@@dm1n', 't3://h
    aze-ena4d:7001', 'FilePolling', 'D:\\OSBBuild\\ant_osb_ps5/export/FilePolling.ja
    r', 'None']
    [wlst] Connecting to t3://haze-ena4d:7001 with userid weblogic ...
    [wlst] Exception in thread "main" java.lang.IllegalStateException: Tracebac
    k (innermost last):
    [wlst] Successfully connected to Admin Server 'AdminServer' that belongs to
    domain 'devmkg_domain'.
    [wlst]
    [wlst] File "import.py", line 7, in ?
    [wlst] ImportError: no module named config
    [wlst]
    [wlst] Warning: An insecure protocol was used to connect to the
    [wlst] at weblogic.management.scripting.WLSTInterpreterInvoker.printErr
    or(WLSTInterpreterInvoker.java:110)
    [wlst] at weblogic.management.scripting.WLSTInterpreterInvoker.executeP
    yScript(WLSTInterpreterInvoker.java:103)
    [wlst] at weblogic.management.scripting.WLSTInterpreterInvoker.main(WLS
    TInterpreterInvoker.java:27)
    [wlst] server. To ensure on-the-wire security, the SSL port or
    [wlst] Admin port should be used instead.
    [wlst]
    [wlst] Location changed to domainRuntime tree. This is a read-only tree wit
    h DomainMBean as the root.
    [wlst] For more help, use help(domainRuntime)
    [wlst]
    [wlst] Traceback (innermost last):
    [wlst] File "import.py", line 7, in ?
    [wlst] ImportError: no module named config
    [wlst]
    [wlst] Java Result: 1

    ReplyDelete
    Replies
    1. Hi,

      I think you are missing some jars.
      Can you check this
      set CLASSPATH=%FMW_HOME%/wlserver_10.3/server/lib/weblogic.jar;
      %FMW_HOME%/Oracle_OSB1/lib/alsb.jar;
      %FMW_HOME%/Oracle_OSB1/modules/com.bea.common.configfwk_1.3.0.0.jar

      thanks

      Delete
  108. Hi Edwin, seems jars are already there in classpath. this is trace when I start import task of ANT. error remains same.

    String length: 26
    [wlst] Executing the command line :
    [wlst] "D:\Program Files\Java\jdk1.6.0_31\jre\bin\java.exe" -Ddebug=true -D
    failOnError=true -DexecuteScriptBeforeFile=true -DfileName=import.py -DscriptTem
    pFile=C:\Users\gaurav.gupta\AppData\Local\Temp\wlsttempfile947397896.py -classpa
    th "C:\Oracle\Middleware_11115\modules\org.apache.ant_1.7.1\lib\ant-launcher.jar
    ;C:\Oracle\Middleware_11115\modules\org.apache.ant_1.7.1\lib\ant-all.jar;C:\Orac
    le\Middleware_11115\modules\org.apache.ant_1.7.1\lib\ant-antlr.jar;C:\Oracle\Mid
    dleware_11115\modules\org.apache.ant_1.7.1\lib\ant-apache-bcel.jar;C:\Oracle\Mid
    dleware_11115\modules\org.apache.ant_1.7.1\lib\ant-apache-bsf.jar;C:\Oracle\Midd
    leware_11115\modules\org.apache.ant_1.7.1\lib\ant-apache-log4j.jar;C:\Oracle\Mid
    dleware_11115\modules\org.apache.ant_1.7.1\lib\ant-apache-oro.jar;C:\Oracle\Midd
    leware_11115\modules\org.apache.ant_1.7.1\lib\ant-apache-regexp.jar;C:\Oracle\Mi
    ddleware_11115\modules\org.apache.ant_1.7.1\lib\ant-apache-resolver.jar;C:\Oracl
    e\Middleware_11115\modules\org.apache.ant_1.7.1\lib\ant-commons-logging.jar;C:\O
    racle\Middleware_11115\modules\org.apache.ant_1.7.1\lib\ant-commons-net.jar;C:\O
    racle\Middleware_11115\modules\org.apache.ant_1.7.1\lib\ant-jai.jar;C:\Oracle\Mi
    ddleware_11115\modules\org.apache.ant_1.7.1\lib\ant-javamail.jar;C:\Oracle\Middl
    eware_11115\modules\org.apache.ant_1.7.1\lib\ant-jdepend.jar;C:\Oracle\Middlewar
    e_11115\modules\org.apache.ant_1.7.1\lib\ant-jmf.jar;C:\Oracle\Middleware_11115\
    modules\org.apache.ant_1.7.1\lib\ant-jsch.jar;C:\Oracle\Middleware_11115\modules
    \org.apache.ant_1.7.1\lib\ant-junit.jar;C:\Oracle\Middleware_11115\modules\org.a
    pache.ant_1.7.1\lib\ant-netrexx.jar;C:\Oracle\Middleware_11115\modules\org.apach
    e.ant_1.7.1\lib\ant-nodeps.jar;C:\Oracle\Middleware_11115\modules\org.apache.ant
    _1.7.1\lib\ant-starteam.jar;C:\Oracle\Middleware_11115\modules\org.apache.ant_1.
    7.1\lib\ant-stylebook.jar;C:\Oracle\Middleware_11115\modules\org.apache.ant_1.7.
    1\lib\ant-swing.jar;C:\Oracle\Middleware_11115\modules\org.apache.ant_1.7.1\lib\
    ant-testutil.jar;C:\Oracle\Middleware_11115\modules\org.apache.ant_1.7.1\lib\ant
    -trax.jar;C:\Oracle\Middleware_11115\modules\org.apache.ant_1.7.1\lib\ant-weblog
    ic.jar;C:\Oracle\Middleware_11115\modules\org.apache.ant_1.7.1\lib\ant.jar;C:\Or
    acle\Middleware_11115\modules\org.apache.ant_1.7.1\lib\xercesImpl.jar;C:\Oracle\
    Middleware_11115\modules\org.apache.ant_1.7.1\lib\xml-apis.jar;D:\Program Files\
    Java\jdk1.6.0_31\lib\tools.jar;D:\oracle\Middleware_11115\Oracle_OSB1\modules\co
    m.bea.common.configfwk_1.5.0.0.jar;D:\oracle\Middleware_11115\wlserver_10.3\serv
    er\lib\weblogic.jar;D:\oracle\Middleware_11115\Oracle_OSB1\lib\alsb.jar" weblogi
    c.management.scripting.WLSTInterpreterInvoker 'weblogic S0@@dm1n t3://haze-ena4d
    :7001 "FilePolling" D:\OSBBuild\ant_osb_ps5/export/FilePolling.jar None'

    ReplyDelete
  109. Edwin, the issue got resolved. it was incorrect jar path. Thanks for all your help..

    ReplyDelete
  110. Hi Edwin, I am trying to automate OSB build process. Idea is OSB projects will get checked out from SVN and then execute build. first exportFromWorkspace and then import. all this looks good.

    Problem is how to structure multiple projects and custom files :
    I have created 2 OSB config projects :
    1. FileAdapter (Deals with any type of file processing projects)
    2. JMSAdapters (Deals with any type of JMS processing projects)
    (I can keep at business domain level.. but I haven't received those scenario yet).

    Now, I have kept config project based branches in SVN. so there are 2 branches. reason, in build process each project have to have a config project.
    But I don't know if this is a good structure or I should have everything in one config project or something else.

    another, problem is with Custom file. I want to keep custom files at project level rather than one file for multiple project (the way SOA config plan does) for easy maintenance at project level rather than branch level. but then I can't make build at branch level. I will have to configure build at project level in each branch. (also branches will replicate for each environment like DV, Test, QA, Prod).

    can you provide some recommendations what are the best practices on this ? any suggestion will help.

    ReplyDelete
    Replies
    1. Hi,

      more then one workspace is no problem, Just change the ANT build file so it read the right property file in a workspace folder and then knows what to build.
      you can manually export your own project custom file and keep this in svn with the project. no need to export and generate this every time. Just use this with the import.

      thanks

      Delete
  111. Good post and it worked well. Couple of questions
    1. While deploying OSB process using ANT script, can we specify the target folder in OSB, where the project needs to be deployed ? This requirement is similar to specifying the partition name under which BPEL process is deployed.
    2. A sample OSB project is a simple proxy service having normal components like WSDL, Business Service and Proxy service. Manually edited the customization file, to replace hostname1 with host name2. Imported the process via ant script. From the SB console noticed that in Business Service part, hostname2 is being referenced. But under WSDL, i still see reference to Host name 1. Is there way to replace reference under WSDL files too ?
    Thanks

    ReplyDelete
    Replies
    1. Hi,

      1 Nop , you will import Projects and this will always put in /
      2 Is this in a import or is it an endpoint, you can ignore this.

      thanks

      Delete
  112. Thanks for the Edwin, I have (hopefully) a straight forward question.

    We structure our projects in nested directories such as
    OSBConfig
    DirA/DirB/Project/.project

    The export from Eclipse understands this structure and produces a sbconfig.jar file with all the projects in it.

    When running from ant on the build machine, it only seems to be able to pick up projects in the root of the workspace. i.e.

    OSBConfig/
    ProjectA/
    ProjectB/

    etc..

    Is it possible for this script to pick up nested projects?

    Hope this is Clear

    Rod

    ReplyDelete
    Replies
    1. Hi,

      interesting, I don't think so but maybe you can try something with the config.subprojects variable like "DirA/DirB/Project,...."
      or workspace.dir to the DirB folder and use for config project relative paths like ../../OSBConfig

      Thanks

      Delete
  113. Hi Edwin,

    you have mentioned about deleting the .metadata folder, but even when I do that the export from Workspace fails.

    the workspace...
    [java] Importing project located in "OSB Configuration" directory of the wo
    rkspace...
    [java] Synchronizing "OSB Configuration"...
    [java] Exporting to D:\Project\osbdep\osbant/export/sbconfig.jar...
    [java] Error during configuration jar export.

    BUILD FAILED
    D:\Project\osbdep\osbant\build.xml:75: Java returned: 101

    In fact it creates the .metadata folder back again.

    Kindly help on fixing this.

    Thanks
    Susmit

    ReplyDelete
    Replies
    1. Hi Susmit,

      I'm not sure but be aware to the slashes, of the path where the project need to be exported.

      Ex.: \ and / mixed (I don't know if it'd be a problem)

      Delete
    2. Hi,

      Do you have more log information and can try my version on github . ( this has a dummy osb workspace )
      this should work, else your required jar files does not exists.

      Thanks

      Delete
  114. Hi Edwin,

    when I execute the scripts from my windows machine, it works fine. I'm trying to use Hudson to control the build activities but when my ant task is called from hudson, a bunch of errors are displayed during the build (in importToOSB task):

    [wlst] Error execing the Python script "C:\Middleware\JDev11gR1PS4\jdeveloper\common\wlst\configplan.py" caused an error "Traceback (innermost last):
    [wlst] File "C:\Middleware\JDev11gR1PS4\jdeveloper\common\wlst\configplan.py", line 8, in ?
    [wlst] ImportError: no module named oracle
    [wlst] "
    [wlst] Error execing the Python script "C:\Middleware\JDev11gR1PS4\jdeveloper\common\wlst\deployComposite.py" caused an error "Traceback (innermost last):
    [wlst] File "C:\Middleware\JDev11gR1PS4\jdeveloper\common\wlst\deployComposite.py", line 8, in ?
    [wlst] ImportError: no module named oracle
    [wlst] "
    [wlst] Error execing the Python script "C:\Middleware\JDev11gR1PS4\jdeveloper\common\wlst\manageComposite.py" caused an error "Traceback (innermost last):
    [wlst] File "C:\Middleware\JDev11gR1PS4\jdeveloper\common\wlst\manageComposite.py", line 9, in ?
    [wlst] ImportError: no module named oracle
    [wlst] "
    [wlst] Error execing the Python script [wlst] For more help, use help(domainRuntime)
    [wlst]
    [wlst] Exception in thread "main" java.lang.IllegalStateException: Traceback (innermost last):
    [wlst] File "import.py", line 6, in ?
    [wlst] ImportError: no module named wli
    [wlst]
    It seem's that lot's of aux python scripts are called and I think I need to set the classpath in somewhere... would you mind in helpping me?

    Thanks,

    Josué

    ReplyDelete
    Replies
    1. Hi,

      What version are you using, from this blog or from github which is OSB PS5 version which should also work on PS3 & PS4
      in this blog I added the required jars to bat file and in the github I added them to the ANT build file
      osb pb5 build xml with jar added to targets

      Thanks

      Delete
    2. Hi Edwin,

      thanks for the reply. I added the JARs manually in my classpath (bat file) and it's working now! I'll consider add them to the ANT build file too.

      I'm trying to use Jenkins for CI but lot's of workarounds are necessary. I had to create another workspace (as you suggested) and created a ANT script which copy the most recent code to this workspace. The projects are recognized to be a part of the OSBConfiguration if it's present in the "com.bea.alsb.core.prefs" file that is, I need to edit this file or perform a clean in eclipse. Is there a way to perform a clean in eclipse to be my projects added to this file?


      Thanks!
      Regars.

      Delete
    3. Hi,

      can you delete the .metadata folder of your workspace, this should do a clean.

      thanks

      Delete
  115. Hi,
    I need to export a single resource not all project files (ex. proxy or businessService).
    How can I do?

    Thanks

    ReplyDelete
    Replies
    1. Hi,

      Sorry not possible only a project or multiple projects or a whole workspace.

      Thanks

      Delete
    2. Do you know which libraries allows Eclipse to compile jars for single resources?

      Delete
    3. Hi,

      don't know if this is possible

      Delete
  116. Hi,

    Great post, however I am having trouble with the example ant_osb_ps5.

    I have imported the projects into a new workspace and put the build.xml and build.properties into the OSB Configuration folder and changed the setting accordingly. When I run the importToOSB the build/deploy run successfully, but when I try the exportFromWorkspace I get the below error:

    [java] Workspace does not contain any projects; importing project directories in workspace directory...
    [java] Specified OSB Configuration project "OSBConfiguration" not found, config export cannot proceed.

    I am running the build.xml file from Eclipse and deleted the metadata folder also.

    Any suggestions?

    Thanks in advance.


    J

    ReplyDelete
    Replies
    1. Hi,

      can you open ecllpse and check the name of the osb configuration project , did you drag the projects under this. and use the same name of the osb configuration in your build.properties and put it between ""

      thanks

      Delete
    2. Hi,

      Thank you for the quick response, I imported the projects into the workspace and renamed the OSB Configuration project from "OSB Confirugation" to "OSBConfirugation" (removed the space).

      This change was reflected to the property config.project="OSBConfiguration" in the build.properties.

      Cheers

      J

      Delete
    3. Hi,

      you got it now working now or still got a error.

      Thanks

      Delete
    4. Hi,

      Yeah it's working now, came down to the most common problem of all, user error.

      Cheers

      J

      Delete
  117. Hi

    Thanks for the great infon - really useful.

    I was wondering if you are able to assist with an issue with exportFromOSB target. It doesn't seem to be able to accommodate projects with spaces in their names.

    I believe the the real issue is within export.py and passing in a project name with spaces. I have tried wrapping in double and single quotes to no avail.

    Any ideas appreciated - I am a total osb/jython/ant novice just trying to work it through.

    Regards

    TW

    ReplyDelete
    Replies
    1. Hi,

      I did not test it but can you try this escape double quote
      config.subprojects="A,\"A A\""

      thanks

      Delete
  118. Hi,
    Did you got chance to test OSB 11.1.1.7 Build using ant or Maven?
    Kindly let me know if you tested.
    I can do it manually by invoking batch file command but not through ant.

    Thanks
    TJ

    ReplyDelete
    Replies
    1. Hi,

      Not yet but I will test it out very soon and put the code on Github.
      I will let you know

      thanks

      Delete
    2. Hi,
      In PS6 build there is no need to give oepe home and got a new tool configjar in osb_home/tools.But having some difficulty in creating config for export.

      http://docs.oracle.com/cd/E28280_01/dev.1111/e15866/app_export.htm#BABBBBAI

      Thanks
      TJ

      Delete
    3. Indeed,

      now working on a new version with the osb configjar tool
      Works great so far,

      will make a blogpost today

      Delete
  119. HI Edwin,

    I am trying to run my import to OSB and task. But I am getting the below error.
    Any help or pointers in this?

    Buildfile: C:\Users\Admin\workspace\project\ant\build.xml
    importToOSB:

    BUILD FAILED
    C:\Users\Admin\workspace\BDM\ant\build.xml:40: Problem: failed to create task or type wlst
    Cause: The name is undefined.
    Action: Check the spelling.
    Action: Check that any custom tasks/types have been declared.
    Action: Check that any / declarations have taken place.

    ReplyDelete
    Replies
    1. Hi,

      Do you use my github project but I think this taskdef wlst fails because it can't find the weblogic library.

      Thanks

      Delete
  120. Hi All,

    I made a new blogpost about the new OSB PS6 offline configjar tool ( made 2 versions , one with a shell script and how to do this in maven.
    http://biemond.blogspot.nl/2013/04/offline-oracle-service-bus.html

    Thanks

    ReplyDelete
  121. From what I've been able to determine, the ConfigExport process requires that you check in your .metadata folders into version control or use a particular configuration of project files. Am I missing something? I really don't like the idea of having to check in Eclipse-centric files into Version control.

    ReplyDelete
    Replies
    1. Hi,

      or a new .metadata is generated by the export tool because it is based on eclipse. can you use this ?http://biemond.blogspot.nl/2013/04/offline-oracle-service-bus.html

      thanks Edwin

      Delete
  122. Hi Edwin,

    Is there any way that I can import many jar files at a time.(The way we can do it in SOA).I know through build.properties, I can import one jar at a time.

    Thanks in advance

    ReplyDelete
    Replies
    1. Hi,

      you can change the import.py , start a new session and make an import loop.
      or call the ANT script in a loop. with antcontrib its very easy to make a loop.

      Thanks

      Delete
  123. Hi, I have a questipon regarding OSB jar file dna customization file. Is it possible to keep the customization file outside the jar file at a different location and then use wlst to apply the customization onto the jar file at the deployment time? If yes, how?

    ReplyDelete
    Replies
    1. Hi,

      yes that is possible , I do the same in my maven deploy scripts.
      just in the ANT script provide a valid file to this parameter customFile=sys.argv[6] in the importToOSB target

      Thanks

      Delete
  124. Hi Edwin,

    Have tried import using configjar utility in PS6?

    Thanks

    ReplyDelete
    Replies
    1. Hi,

      the configjar works perfectly , check this out http://biemond.blogspot.nl/2013/04/offline-oracle-service-bus.html

      no need for eclipse or the .metadata folder and you have more control what to include. also you can add different configuration projects and normal project.

      thanks

      Delete
  125. Hi Edwin,

    I want to deploy OSB services using ANT scripts dynamically.Every time End Point URI changes(for Business,Proxy services) in different domains(QA, Predev, Dev..).So, using ANT Scripts how can I handle this situation.
    Any help would be appreciated.
    Thanks,
    Gary

    ReplyDelete
    Replies
    1. Hi,

      Add the endpoints in a customization xml and put it in svn. poll for changes in svn or git with hudson and deploy all the projects on every env.

      Thanks

      Delete
  126. Here is the error while running the build.xml:
    run:
    [testng] [TestNG] Running:
    [testng] C:\Selenium\MonitoringAndAlert\testng.xml
    [testng]
    [testng]
    [testng] ===============================================
    [testng] Monitoring Alerting Test
    [testng] Total tests run: 2, Failures: 0, Skips: 2
    [testng] Configuration Failures: 2, Skips: 2
    [testng] ===============================================
    [testng]
    [testng] The tests failed.

    BUILD SUCCESSFUL
    and run commands

    and run in build.xml is










    ant run will execute the test




    when testng.xml is run , all the scripts are running as expected. But when build.xml is run at command promopt, it is giving configuration errors.
    could any one please help why it is giving configuration errors while running in commandline

    ReplyDelete