23 Aralık 2009 Çarşamba

weblogic Dump thread

Weblogic te bir sıkıntı yaşadığımızda yapacağımız ilk iş dump thread olmalıdır.

Unix sistemlerinde ps -ef | grep java ile listelenen listeden dump almak istediğini weblogic sürecinin numarasını (pid) alın. yada direk ps -ef|grep SoaServer3 şeklinde weblogic managed serverın direk adını yazabilirsiniz.

kill -3 komutunu çalıştırdığınızda o anki thread durumunu çıktı dosyasına(weblogic.out) veya standart çıkışa basar.

Eğer Nodemanager nodeları başlatmış ise çıktı dosyaları weblogic in nodemanager dizini altında bulunur.

örneğin /opt/weblogic/weblogic81/common/nodemanager/NodeManagerLogs
altında

buradaki logları

yusuke.homeip.net/samurai/?english

adresinde Samurai jar uygulamasını kullanarak gözlemleyebilirsiniz.


Windows da thread dump almak için weblogic in çalıştığı komut satırı penceresi üzerinde Ctrl + Break yapılır. Çıktı büyük olacağı için pencereden akıp gidecektir. Pencerenin ayarlarından satır sayısını arttırabilirsiniz.

16 Kasım 2009 Pazartesi

cluster da JMS tanımlama

referans: http://biemond.blogspot.com/2009/02/high-available-weblogic-cluster.html

12 Kasım 2009 Perşembe

Configuring the boot.properties File

weblogic user ve password değiştirdiysen

boot.properties dosyasını açıp yeni kullanıcı adı ve şifreyi girdikten sonra kaydedip çıkıyoruz.
sonra
./startManagedWebLogic.sh OracleSOAServer3 gibi consoledan başlatıyoruz

ilgili link
http://www.oracle.com/technology/obe/fusion_middleware/wls103/InstallConfig/enable_auto_login/Boot_identity_file.htm

Weblogic Üzerinde DBAdapter için Connection Factory Ayarlama

Weblogic üzerinde SOA Suite 10.1.3.x için DBAdapter'e Connection factory yapmanın adımlarını aşağıda bulabilirsiniz

1- $BEA_HOME/user_projects/apps/soaApps/DBAdapter/META-INF dizinine gidin.
2- ra.xml dosyasını açın ve adı xADataSourceName özelliğinin value kısmına jdbc/XADataSourc yazın. Adı dataSourceName özelliğin de value kısmına jdbc/DataSource yazın. Yeni dosya şu şekilde olmalıdır:
[ad#metin]
<config-property>
<config-property-name>xADataSourceName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>jdbc/XADataSource</config-property-value>
</config-property>


<config-property>
<config-property-name>dataSourceName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>jdbc/DataSource</config-property-value>
</config-property>


3- WebLogic Console'a gidip Change Center'daki Lock & Edit butonuna tıklayın.
4- Domain Structure altındaki Deployments'a tıklayın.
5- Deployments list kısmında DBAdapter'ü seçin ve Update'e tıklayın.
6- "Redeploy this application using the following deployment files" seçeneğini seçin ve Next'e tıklayın.
7- Finish'e tıklayın.
8- Activate Changes butonuna tıklayın.
9- Deployments list'e tekrar gelip DBAdapter'ü seçin, stop ve yes butonlarına tıklayın.
10- Lock & Edit butonuna tıklayın.
11- Domain Structure tree'de Services > JDBC'yi açın ve Data Sources seçin.
12- Data Sources sayfasında New butonunu tıklayın.
13- JDBC Data Source Properties sayfasında, aşağıdaki bilgileri girin:

Name - JDBC data source için bir adı.
Örnek: SOATurkiyeDataSource
JNDI Name - Data source'un olacağı yerdeki JNDI name'ini girin. Örnek: jdbc/SOATurkiyeDataSource
Database Type - Bağlanmak istediğiniz veritabanının tipini seçin. Örnek: Oracle.
Database Driver - Veritabanına bağlanmak için kullanacağınız database driver'ını seçin. Örnek: oracle için Thin XA.

14- Sonraki iki sayfada Next'e tıklayın.
15- Connection Properties sayfasında aşağıdaki değerleri girin:

Database Name - Bağlanmak istediğiniz veritabanının adını yazın. O veritabanının SID'si olabilir örneğin.
Host Name - Veritabanı sunucusunun IP'si.
Port - Veritabanı sunucusunun portu.
Database User Name - Veritabanı kullanıcı adı.
Password/Confirm Password - Veritabanı şifresi.

16- Sonra Next'e tıklayın.
17- Sonraki sayfada Test Configuration'a tıklayıp bağlantıyı kontrol edin. Düzgün bir şekilde bağlanmışsa Next'e tıklayın. Yoksa önceki adımları kontrol edip hatanın nerden kaynaklandığını bulmaya çalışın.
18- Targets sayfasında OracleSOAServer seçin.
19- Finish deyip Activate Changes yapın.
20- Lock & Edit yapın.
21-Soldaki menüden Deployments'ı seçin.
22- DBAdapter'ü tıklayın. Gelen menüde Configuration/Outbound Connection Pools'a girin.
23- New butonuna tıklayın ve avax.resource.cci.ConnectionFactory seçip Next deyin.
24- JNDI name'inizi girin ve Finish'e tıklayın. Örnek: eis/DB/SOATurkiye.

25- META-INF seçip Finish'e tıklayın.
26- javax.resource.cci.ConnectionFactory'deki + işaretine tıklayın. Oluşturmuş olduğunuz eis/DB/SOATurkiye'yi tıklayın.
27- connection string, dataSourceName, password and username değerlerini silin, boş bırakın. Değerleri sildikten sonra Enter'a basmazsanız yaptığınız değişiklik kaydedilmez.

Farklı veritabanları için platformClassName değerleri
































DatabasePlatformClassName
Oracle9+ (including 10g)oracle.toplink.platform.database.Oracle9Platform
Oracle8oracle.toplink.platform.database.Oracle8Platform
Oracle7oracle.toplink.platform.database.OraclePlatform
DB2oracle.toplink.platform.database.DB2Platform
Informixoracle.toplink.platform.database.InformixPlatform
Sybaseoracle.toplink.platform.database.SybasePlatform
SQLServeroracle.toplink.platform.database.SQLServerPlatform
Any other databaseoracle.toplink.platform.database.DatabasePlatform



28- Next'e tıklayın sonrasında xADataSourceName'da BPELSamplesDataSource'u seçin ve Save butonuna tıklayıp kaydedin.
29-Activate Changes yapın, sonra Deployments/DBAdapter'ü seçin ve Start butonuna basın.

Connection factory kullanılmaya hazır. Artık jdeveloperda oluşturduğunuz projeleri weblogic'e deploy ederken, partnerliklerin wsdl'lerindeki connection tanımlarını(mcf) silebilirsiniz, çünkü o değerleri bu yaptığımız değişiklikler sonucu buradan alacaktır.

iyi günler diliyorum
<table width="552" border="0">
<tr>
<td><strong>Database</strong> </td>
<td><strong>PlatformClassName</strong></td>
</tr>
<tr>
<td>Oracle9+ (including 10g) </td>
<td>oracle.toplink.platform.database.Oracle9Platform</td>
</tr>
<tr>
<td>Oracle8 </td>
<td>oracle.toplink.platform.database.Oracle8Platform</td>
</tr>
<tr>
<td>Oracle7 </td>
<td>oracle.toplink.platform.database.OraclePlatform</td>
</tr>
<tr>
<td>DB2 </td>
<td>oracle.toplink.platform.database.DB2Platform</td>
</tr>
<tr>
<td>Informix</td>
<td>oracle.toplink.platform.database.InformixPlatform</td>
</tr>
<tr>
<td>Sybase </td>
<td>oracle.toplink.platform.database.SybasePlatform</td>
</tr>
<tr>
<td>SQLServer </td>
<td>oracle.toplink.platform.database.SQLServerPlatform</td>
</tr>
<tr>
<td>Any other database</td>
<td>oracle.toplink.platform.database.DatabasePlatform</td>
</tr>
</table>

18 Ağustos 2009 Salı

OWSM client IP bilgisi loglama

http://www.oracle.com/technology/obe/fusion_middleware/owsm/custom%20steps/custom%20steps.htm

adresindeki adımları izleyerek custom step tanımlanıyor fakat weblogic üzerinde çalışması için ayrıca

jar dosyasını

\user_projects\apps\soaApps\ccore\ccore.war\WEB-INF\lib

\user_projects\apps\soaApps\gateway\gateway.war\WEB-INF\lib

bu klasörlere de kopyalamalısın.daha sonra weblogic console dan sunucuyu resetle.
opmn/bin/opmnctl stopall
opmn/bin/opmnctl startall yaparak owsm tekrar çalıştır.

24 Haziran 2009 Çarşamba

Create mail session with Weblogic

Create mail session with Weblogic

The aim of the mailsession in Weblogic is avoid to parameter your session in your java code and obtain a dynamic mail server without to recode your application.

Here are the steps :
  1. In your Administration console, go to Service, Mail Sessions.Then click on New.
  2. Fill the information like the screen :


The "name" is for weblogic, but the "JNDI" Name will be the session name used in your java code to retrieve the server mail parameters.

  • then you have to put the parameters of your mail server in the "JavaMail Properties" box :
PropertyDescriptionDefault
mail.store.protocolProtocol for retrieving email. Example: mail.store.protocol=imapimap
mail.transport.protocolProtocol for sending email. Example: mail.transport.protocol=smtpsmtp
mail.hostThe name of the mail host machine. Example: mail.host=mailserverLocal machine
mail.userName of the default user for retrieving email. Example: mail.user=postmasterValue of theuser.name Java system property.
mail.protocol.hostMail host for a specific protocol. For example, you can set mail.SMTP.host andmail.IMAP.host to different machine names. Examples:mail.smtp.host=mail.mydom.com mail.imap.host=localhostValue of themail.hostproperty.
mail.protocol.userProtocol-specific default user name for logging into a mailer server. Examples:mail.smtp.user=weblogic mail.imap.user=appuserValue of themail.userproperty.
mail.fromThe default return address. Examples: mail.from=master@mydom.comusername@host
mail.debugSet to True to enable JavaMail debug output.False

in my case :


you also can specify more information (report to the tab before) like user login and hostname.

  • Click Next, check your Managed server and click Finish.
Now the Java code part :

  • The imports :
import java.util.*;
import javax.activation.*;
import javax.mail.*;
import javax.mail.internet.*;
import javax.naming.*;
  • Load your Weblogic MailSession :
InitialContext ic = new InitialContext();
Session session = (Session) ic.lookup("myMail");
  • If you need to override the Weblogic parameters you can do with the following code and the java.util.Properties Object (OPTIONAL)
Properties props = new Properties();
props.put("mail.transport.protocol", "imap"); // new protocol instead of smtp
props.put("mail.smtp.host", "mailhost");
// use mail address from HTML form for from address
props.put("mail.from", emailAddress);
Session session2 = session.getInstance(props);
  • Construct a MimeMessage
    Message msg = new MimeMessage(session2);
    msg.setFrom();
    msg.setRecipients(Message.RecipientType.TO,
    InternetAddress.parse(to, false));
    //"to" and "subject" are strings define by the user or developer
    msg.setSubject(subject);
    msg.setSentDate(new Date());
    // Content is stored in a MIME multi-part message
    // with one body part
    MimeBodyPart mbp = new MimeBodyPart();
    mbp.setText(messageTxt);
    Multipart mp = new MimeMultipart();
    mp.addBodyPart(mbp);
    msg.setContent(mp);
  • Send the message
Transport.send(msg);
For more informations on How to use javamail API with Jdeveloper : http://edocs.bea.com/wls/docs90/programming/javamail.html

Now you have a mail sent through your application with a dynamic smtp or mail server ! (you just need to change java properties in your MailSession in Weblogic)



17 Haziran 2009 Çarşamba

BEA-101216 BEA-149231 (Startup Hataları)

Rac kurulumdan dolayı kaynaklanan gateway ve policymanager db bağlantı hatasında
şağıdaki config dosyalarını güncellemen lazım

/oracle/product/10.1.3.1/soasuite/owsm/config/policymanager/policymanager-config-installer.properties dosyasında

policymanager.policyRepository.url=jdbc:oracle:thin:@//10.6.119.130:1521/TTSOA2

satırını

policymanager.policyRepository.url=jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=on)(ADDRESS=(PROTOCOL=TCP)(HOST=10.6.119.129) (PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=10.6.119.130) (PORT=1521))(CONNECT_DATA=(SERVICE_NAME=TTSOA)))

şekline getirmelisiniz.

ayrıca
policymanager.componentRepository.url=jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=on)(ADDRESS=(PROTOCOL=TCP)(HOST=10.6.119.129) (PORT=1521)

şekline getirilecek.

/oracle/product/10.1.3.1/soasuite/owsm/config/gateway/gateway-config-installer.properties dosyasında

gateway.repository.url=jdbc:oracle:thin:@//10.6.119.130:1521/TTSOA2

satırını

gateway.repository.url=jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=on)(ADDRESS=(PROTOCOL=TCP)(HOST=10.6.119.129) (PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=10.6.119.130) (PORT=1521))(CONNECT_DATA=(SERVICE_NAME=TTSOA)))

şekline çevirilmeli.

24 Mayıs 2009 Pazar

web service security

Java web service lerinde güvenlik için şu adreslere bakabilirsin.

http://www.oracle.com/technology/products/jdev/howtos/1013/wssecure/10gwssecurity_howto.html

http://www.oracle.com/technology/products/jdev/101/howtos/securews/index.html

http://download.oracle.com/docs/cd/B31017_01/web.1013/b28976/intro.htm

13 Nisan 2009 Pazartesi

java.lang.OutOfMemoryError hatasında yapılacaklar

Weblogic üzerinde ilgili server(SOAServer yada bpel server) a gidilip serverstart tabında Arguments paramatlerinde aşağıdaki gibi değişikli yapmalısınız.

You need to increase the JVM settings. Here is are some recommendations for a Linux Box with 4GB of memory and 2 CPUs. (If you are using a different platform from Linux, these parameters may not apply.)

-Xmn1228m -XX:+AggressiveHeap -Xms2048m -Xmx2048m


-Xmn1228m
Garbage collector (Oracle recommends sizing the Eden space to be 60 to 70 percent of the total
heap size.)

-XX:+AggressiveHeap
Recommended if you are using two or more CPUs.
The -XX:+AggressiveHeap option inspects the system resources (size of memory and number of processors) and attempts to set variousparameters to be optimal for long-running, memory allocation-intensive jobs.

-Xms2048m
Iniatial heapsize. The heap size controls the amount of memory the JVM uses

-Xmx2048m
Maximum heapsize

10 Nisan 2009 Cuma

Errors must be corrected before proceeding

yeni bir kullanıcı tanımlarken
Errors must be corrected before proceeding

hatası alıyorsan şifre uzunluğu 8 karakterden küçük olduğu içindir