Posts

Showing posts with the label Weblogic Tips and Tweaks

remote debug configuration in weblogic console

Image
I have seen in many forums and blogs on how to remote debug a Weblogic Admin or Managed Servers. Most of them suggested to modify the files setDomainEnv.cmd or to modify the Startup aScripts like startWeblogic.cmd or startManagedWeblogic.cmd.But these modifications require change of multiple files in case if need to debug both Admin and Managed Servers.There is an easy way you can achieve this through Admin Console Login to the Weblogic Console ,Click on Servers and select the respective Server and go to the Server Start tab like shown below . In the Arguments Section paste the  line along with other arguments if any ,like below.Here address is any port which is free and can be used for remote debugging.I have used 8444. -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8444,server=y,suspend=n -Djava.compiler=NONE Now restart your Weblogic Server you will see the message  in th...

Weblogic Issues during EAR Deployment Exception in AppMerge flows progression

Unable to access the selected application Exception in AppMerge flows progression Bean already exists "weblogic.j2ee.descriptor.ModuleBeanImpl@..../Modules[weblogic.descriptor.internal.Descriptor.Beankey@....] This issue can happen in many scenarios, may be you need to check your deployment descriptors based on Application Servers used, this generally happens due to issue in XML files related to deployment. I got this issue when i mistakenly added the modules twice in the Manifest file, the module 'Store.Storefront' is added more than once in  'ATG-Required'  of my Manifest.MF file,due to this i am seeing the module 'storedocroot.war' is added twice in my application.xml which is located in the  path ATGProd.ear\META-INF\application.xml.Due to this i am not able to deploy my EAR file. I have removed the duplicate entry and deployed the application and everything working fine. ....... <module>         <web>  ...

Configure Template Email Sender for Managed Weblogic Server

This is how i done the configuration for my local box. My Admin Server as usual is running in the Weblogic default port 7001.To deploy another EAR,I have created a Managed Server running in port 7002. My application hosted in the Managed Server got hanged when i try to send email through template email sender. Fix After modifying the component Configuration.properties   i was able to do that. Add the properties siteHttpServerPort and adminPort in <ATG-Home>/servers/managed-webLogicServer/localconfig/atg/dynamo/ Configuration.p roperties and set it to your Managed Server Ports. siteHttpServerPort=7002 adminPort=7002 If  you use CIM configuration  for creating Managed Server,CIM will automatically create this entries in the component, otherwise you need to modify it manually.The above properties are required to send out email through template email sender using template jsp.  Also set the below properties in SMTPEmail component which is ...

Hot Swap Java Classes - Hot Deploy ATG Application with Weblogic

I saw a lot of  information regarding this topic which is either cluttered or confusing to the readers,i tried this,a very useful feature and a must have for every developers,this is quite easy to configure with minimal modifications. Visit the link to see the  Pre-Requisites and how hotswap works in Java Application Hot Deploy Java Application Now its time for hot deploying your classes in ATG Apllications which is deployed in some Application Servers,believe me its really simple,fast and saves a hell lot of time !!!, you can modify your classes straight away but do keep in mind to launch the debgugger before doing so,Run the runAssembler as well(This can be invoked from a build script,probably an Ant Build with “fork = yes”,so that it will run in a seperate JVM), after this  you can see your class changes will be reflected without needing a Server restart

Hot deploy Pre Requisites – Easiest way to hotdeploy your code – Hot switch your java classes

Pre Requisites This can be possible if  the version of JVM is V1.4 or higher. In Eclipse Set up your remote debugging options. please visit the link to see how can you setup this, Set up Remote Debug Also From the Eclipse Project menu,check 'Build Automatically' Option. Set  break points to the class you need to modify(will make sense if you keep the debug point before the line you want to modify),after that Launch the debugger. Hot Deploy Java Application Generally you compile the code with the options  ‘Run  as a Java Application’ or through some ant script which will do a clean, build and deploy your whole code.which is time consuming. Hot Deploy, Modify your code straight away unless it's a change in method signature,save your changes, Relaunch the  debugger with the same class(in case any issues with automatic build ) and you will notice your changes are reflected without compilation. Also verify how to Hot Swap classes in ATG Applicat...

Deploy different ears without admin console-Fast way of Deploying EAR to Weblogic

Traditional Way Normally in Weblogic for deploying a new ear,the process most of us follows are ,In short,login to Weblogic Admin Console,go to 'Deployments',click 'Lock and Edit', click 'Install' button, navigate to the respectieve path where your EAR is residing,select the appropriate deployment mode,then finally click 'Finish' button. Here the first step opening the admin console and login with the credentials itself is a time consuming process so as the other steps. Instead follow the steps below for easy deployment. Easy Deployment This requires a little tweak in the  config.xml file,idea is to specify in  config.xml files  which ear you need to deploy,Weblogic Server will read the Config file and looks for  an EAR in the  location  specified in the config file,great!!! ,then if found,it waits for nothing it will go ahead with the usual Server startup,picks the EAR,starts the modules specified in the EAR, installs the EAR to the Server ...

atg.service.jdbc.MonitoredDataSource vs atg.nucleus.JNDIReference

Monitored DataSource This is the default class used by ATG for configuring datasources,Most of the out of the box repositories in ATG uses  this in combination with JTDataSource component. JNDIReference For working with Weblogic Server,you need to override the old style of relying MonitoredDataSource,it makes life difficult if we have multiple repositories pointing to multipe datasources,configuring each repositories in this way is a tedious task, instead replace the old class with atg.nucleus.JNDIReference,so now the repositories   is pointing to the datasource which is specified by the JNDIName in the   JTDataSource component,which in turn points to the   Datasources configured in Weblogic Server identified with the JNDI name. eg: $class=atg.nucleus.JNDIReference JNDIName=abc_ds where abc_ds is the JNDI name in which you have configured the datasource in Weblogic Server. See how to alter a datasource quic...

DUseSunHttpHandler=true weblogic.net.http.SOAPHttpsURLConnection Weblogic/Java HttpHandler issues

Verify the issue is happening due to the error throwing  from the weblogic class  SOAPHttpsURLConnection,then you need to inform the Application Server which handler implementation you need to use.  add the following option to JAVA_OPTIONS in   setDomainEnv.sh/setDomainEnv.cmd  on Unix/Windows.   -DUseSunHttpHandler=true.  eg:  set JAVA_PROPERTIES=%JAVA_PROPERTIES% %WLP_JAVA_PROPERTIES%  set JAVA_OPTIONS=%JAVA_OPTIONS% %JAVA_PROPERTIES% -  DUseSunHttpHandler=true -Dwlw.iterativeDev=%iterativeDevFlag% -  Dwlw.testConsole=%testConsoleFlag% -Dwlw.logErrorsToConsole=%  logErrorsToConsoleFlag%  This setting tells WebLogic to use the Sun's https Handler   implementation rather than the WebLogic one.  So after this,it will use the  class HttpsURLConnection from the  javax package.   See Also   SSL Handshake error   java.lang.RuntimePermission modifyThrea...

Change encrypted password - Add Password Propert y-to Weblogic Data Source Files

While configuring datasources weblogic defaultly stored the password in encrypted format inside the datasource files.But this will make the developers job   difficult in case if he want to change the password property directly through files. eg: <properties>       <property>         <name>user</name>         <value>test</value>       </property>     </properties> <password-encrypted>{3SFG}/kMKUSVmft+uzUsiXxpMNPw==</password-encrypted> But we have an easy way to accomplish this by adding the property which has a name and value pair like below. eg: <properties>       <property>         <name>user</name>         <value>test</value>  ...

Switch Weblogic Datasources quickly to connect different databases

Generally while configuring Datasources,especially changing the Username and Password for the datasources,Modifying the url of the datasource so as to establish connection to different databases in different environments like (Development,System Testing to verify a defect etc) will surely become a  tedious task if we rely  admin console each time to make these changes. There is an easy way to accomplish this,Assuming you already have a datasource configured for your Development purpose(connected to devdb),Now you need to connect to different datasource/database  to test a defect in different environment,say in System Test environment(connected to systestdb). Open your datasource files with a wordpad or notepad, located inside C:\bea\user_projects\domains\xxx_domain\config\jdbc folder, keep a back up of your old datasource file,now modify the datasource url,user name and password etc with respect to...

ATG Best practices to shutdown ATG Servers

Image
Always shutdown the Server by executing the shutdown scripts provided by the Weblogic (bea\user_projects\domains\base_domain\bin\stopWeblogic.cmd ). But the server will wait for the open session,open transaction to release ,and it will take some time.There is an option available which you can use and legitimately shutdown the Weblogic Server quickly. Add the 'force' option Open bea\user_projects\domains\base_domain\bin\stopWeblogic.cmd Modify the line to include the "force' option. this will be immediate and will suspend all the application process. You can also see how to Shutdown Weblogic Server while ACC is running   

java.security.AccessControlException during weblogic shutdown

Console Log: In Weblogic Server Console logs we are getting the exception which says access is denied with the AccessControlException. This exception occurs when both the weblogic server and ACC is running  and we try to shutdown the weblogic server via shutdown scripts .The reason being the ATG control center is  running in some ther ports being initiated by the weblogic thread. To resolve the issue you have to tweak the weblogic policy file bea/wlserver_XX/server/lib/weblogic.policy file Add the below entry grant { permission javax.management.MBeanPermission "*", "*"; Now restart your Server and ACC to verify.Ideally this will resolve the issue !!! Next tip

XAConnection Exception in ATG Weblogic

XAConnection java.sql.SQLException Logs: /atg/dynamo/messaging/SqlJmsProvider    ---     java.sql.SQLException: Unexpected exception while enlisting XAConnection java.sql.SQLException: XA error: XAResource.XAER_NOTA start() failed on resource 'XXX_DS': XAER_NOTA : The XID is not valid. Fix: Tweak the configuration file of weblogic server and add an entry after the datasource params. jdbc-xa-params> <xa-set-transaction-timeout>true</xa-set-transaction-timeout> </jdbc-xa-params> Make sure you are taking backup of the original configuration file,chances are there while doing modification you may accidently corrupt the orignial file.After doing the necesary changes bounce the Server once,to verify the issue. Still if you are encountering the issue you have to increase the jta values.refer the section to do so Next tip

java.lang.OutOfMemoryError: PermGen space in Weblogic startup

PermGen or Permanent Generation space is a part of Heap where it stores the Class definitions.By default JVM will take the value as 32m,if we have not set this explicitly,so this is comparitively very less. the issue stated here points that there is no enough Perm Gen space avaialable as per your current JVM settings,so increase it to avoid this issue.Again you need to select appropriate values based on your  development environment,how much hardware support etc. You need to modify this in any webLogic startup Script,i had modified this in setDomain.env file. Increase the heap size to MEM_ARGS=-Xms _ _ _ m -Xmx _ _ _ _ , here i have given values as 512 and 1024 respectievly. Set the Perm size MaxPermSize=_ _ _m,the value given here is 512 . Ideally the Max PermGen value allocated to JVM will be 50% of the Max Heap Size(Xmx). Also typically in a development environment ,if you are using one Admin Server to manage multiple Managed Servers and all your appli...

Java TransactionTimeout issues while working with Weblogic Server

Image
Java Transaction Timeout Issues We need to basically moidfy the transaction timeout parameter which by default is set as 30seconds by weblogic, many requests might  get timedout  between this very short period,so depends upon your requirement choose the best value that works for your development environment.I had modified it to 600. Two way you can achive this. one is again tweaking the configuratin file and another way to modify it through the admin console. Increase the transaction timeout seconds through console( Services->JTA),or modify in config.xml. If you are modifying the configuration file make sure to take  a backup copy,restart the server,ideally you may not further experience this issue.   Next tip

ATG Best Practices while working with Weblogic Server

Image
Avoid NullPointer Exception due to ATG caching of request attributes If you are following best practices while developing ATG applications,you have to be careful enough to avoid any nullpointer exception which crops up during ATG caching of request attributes. The solution  is pretty straight forward,you have to tweak your weblogic configuraion file a bit to add the entry like below. Set  the keep-alive-enabled property to false, in your config.xml. Make sure to take a backup of your original config.xml and restart the server to reflect these modifications. Next tip

Weblogic ssues accessing web application running in remote machine

I have experienced an issue,while trying to access the application running in  a remote machine, i was getting a 'connection refused' message,and not able to load the application pages further. Environment ATG 9.1 Weblogic10.0. I faced this issue while accessing the web application remotely on another machine through http protocol Upon further analysis,found the root cause,and that was due to an entry in the config.xml file which is none other than the listen address property   which is added as  'localhost' by default by the weblogic configuration. I deleted this entry and its working fine now !!! <listen-address>localhost</listen-address> Next tip

ATG issues java.net.MalformedURLException while working with Weblogic

java.net.MalformedURLException . cannot understand  protocol "dynamosystemresource" Solution: Add protocol.jar to the Classpath,you can add an entry inside the Weblogic Startup Script (c:\bea\user_projects\domains\your_domain\bin\startWebLogic.cmd). set CLASSPATH=% SAVE_CLASSPATH%;c:\bea\user_projects\domains\your_domain\protocol.jar. then copy the protocol.jar file from C:\ATG\ATG9.1\DAS\lib\protocol.jar  to lib directory of your weblogic domain folder.Basically this jar file s hould be in the classpath of your application server. One occurrance of this issue is due to the creation of weblogic domain  after ATG Installation,because generally during the Installation  ATG installer will take care  of all the above steps.so in that case you can ignore this . Finally Restart your Server.Ideally this will solve  the issue.Good Luck.  Next tip

share/install same datasource/ear with different schema in Weblogic 10.1

Create 2 Admin Server(one in each separate domain ) ,After that start the Admin Server which will   default run in ports 8860 and 8850.then either open the component atg/dynamo/Configuration in ACC,modify the rmiPort and DrpPort to 8861 and 8851  OR create a component(Configuration.properties)in  the path C:\ATG\ATGXXX\home\localconfig\atg\dynamo,set the properties rmiPort=8861,drpPort=8851,now start the second Admin Server(testServer),configure your datasources  and deploy the EAR. But in this method , if the Admin/test  Server is shutdown or stopped,you need to do the whole process again,also you need to make sure there is no component present at the initial server start up time. Pros :Easy and fast  to configure. Cons :There  is a chance of Port conflicts,if we are not deleting the       component from the path each/first time        When we start/restart the Servers.Chances o...

Configure multiple Admin Servers in different domains simultaneously

Create an Admin Server as usual(Admin Server - > localhost:7001) in base_domain with default port.For Configuring the second Admin Server follow the instructions below. Weblogic Changes -> Go to the Domain Configuration Wizard. 1. From Start Menu,select Programs->BEA Products >    Tools >ConfigurationWizard 2. Select "Create a new Weblogic domain". 3. Select "Generate a domain configured automatically...." and    click “Next”. 4. Select the username,password and the appropriate JDK(eg:    C:\jdk1.5.0_18). 5. After that you will get a screen to customize,answer yes to that    and change the port  to 7003 and leave the rest to default. 6. Give the name for the domain as “test_domain” and click “create”. 7. Create the new domain. 8. Start the Admin Server(testServer),Configure the required    datasources and deploy EAR. 9. Modify your weblogic startup   script    (C:...