Friday, June 24, 2011

Rules of Serialization

Here is a summary of some rules of Java serialization:

  • An object is serializable only if its class or its superclass implements the Serializable (or Externalizable) interface.
  • An object is serializable (itself implements the Serializable interface) even if its superclass is not. However, the first superclass in the hierarchy of the serializable class, that does not implements Serializable interface, MUST have a no-arg constructor. If this is violated, readObject() will produce a java.io.InvalidClassException in runtime.
  • The no-arg contructor of every non-serializable superclass will run when an object is deserialized. However, the deserialized objects? constructor does not run when it is deserialized.
  • The class must be visible at the point of serialization.
  • All primitive types are serializable.
  • Transient fields (with transient modifier) are NOT serialized, (i.e., not saved or restored). A class that implements Serializable must mark transient fields of classes that do not support serialization (e.g., a file stream).
  • Static fields (with static modifier) are Not serialized.
  • If member vairiables of a serializable object reference to a non-serializable object, the code will compile but a RumtimeException will be thrown.

Thursday, June 23, 2011

EJB 2 vs EJB3

1) The deployment descriptors are no longer required; everything can be accomplished using metadata annotations.

2) The CMP has been simplified; it is now more like Hibernate or JDO.

3) Programmatic defaults have been incorporated. For example, the transaction model is set to REQUIRED by default. The value needs to be set only if a specific value other than the default value is desired.

4) The use of checked exceptions is reduced; the RemoteException is no longer mandatory on each remote business method.

5) Inheritance is now allowed; therefore, beans can extend some of the base code.

6) The native SQL queries are supported as an EJB-QL (Query Language) enhancement.

Wednesday, April 6, 2011

weblogic training 3

1) Jrocket jvm is better for intel platform.
2) Sun jdk is better for sun servers.
3) JMS server is engine which stores messages.
4) JMS module will have resources
Deploy a Queue to JMSServer is called subdeokoyment
5) Create jdbc resource.

SNMP
C:\devtools\bea10mp1\user_projects\domains>cd jms_domain

C:\devtools\bea10mp1\user_projects\domains\jms_domain>cd bin

C:\devtools\bea10mp1\user_projects\domains\jms_domain\bin>setDomainEnv.cmd
C:\devtools\bea10mp1\user_projects\domains\jms_domain>java snmptrap
Exception in thread "Main Thread" java.lang.NoClassDefFoundError: snmptrap

C:\devtools\bea10mp1\user_projects\domains\jms_domain>java snmptrapd



WorkManager--
Requestclass
1) Fair Share
2) Response time
3) User Context.


C:\devtools\bea10mp1\user_projects\domains>cd jms_domain

C:\devtools\bea10mp1\user_projects\domains\jms_domain>cd bin

C:\devtools\bea10mp1\user_projects\domains\jms_domain\bin>setDomainEnv.cmd
C:\devtools\bea10mp1\user_projects\domains\jms_domain>java weblogic.Admin -adminurl "t3://localhost:
7001" -username weblogic -password weblogic THREAD_DUMP
Thread Dump has been printed to the servers standard out (by default, the shell in which the server
is running).



C:\devtools\bea10mp1\user_projects\domains\jms_domain>



Server is in standby mode.
use different port.
click the resume mode.
See the status as admin -- from RUnning


JMS make them migratable/ JTS make them migratable.


Cluster domain
Migration - automatic.
Configuration- Migration - automatic



WLST command to take the backup

java weblogic.WLST

help('configToScript');

configToScript('.../jmsdemo','d:/scropts');



papa_rao@hotmail.com

93413 03004

Tuesday, April 5, 2011

weblogic clustering

1) Database level failover clustering.

2) Application level load balancing clustering.

3) admin server will not be part of the cluster.

4) Cluster can not span domains.

5) Domain and below are clusters.

6) http clustering DNS round robin, Proxy server, Hard ware

7) DNS will not work if port number are different.

8) Production server does not use DNS round robin.

9) Proxy server on client is called proxy.

10) Proxy on server is called reverse proxy.

11) Proxy's problem is round robin algorithm.

12) People mostly use Hardware servers.

13) Big IP, IBM edge load balancer.

14) Replication groups for http sessions.

15) Replication group can have the limit of 2.

16) Clustering does not have any limits.

17) Persistent session-J2ee concept.

18) web.xml specify storage-type persistent and jdbc parameter.

19) Heartbeats called mulitcasting.

20) TCP have following types communication. Unicasting 1-1, Broad casting 1-all, Mulitcasting 1- many.

21) One adapter for internal and one adapter for external. Use access and mutlicast address.

22) Class D is dedicated to multicasting.....

23) end with 255

24) Class A, B, C is for unicasting.

1-126 class A

127 look back

128 -191 class B

192 - 223 class C

224 - 239 class D

25) Heart beats and JNDI updates (mulitcasting are required)

26) create server ---> Create Proxy ---> Assign server to cluster

27) Start Node manager.

28) Start clusters.

29) C:\devtools\bea10mp1user_projects\domains\cluster_demo_domain\bin>startManagedWebLogic.cmd Mem2 http://localhost:7001


30) PersistantStoreType parameter weblogic.xml param value replicated. (Replica aware).

31) Change it to jdbc.

32) Use both inmemory + persistent store.

33) JMS Server in a singleton. JMS Server -- target weblogic instance 1. Create them as migratable target. JDBC

-Order of loading classes.

1. Kernel

2. JDBC

3. JMS (System resources.)

4. jars

5. wars

6. startup classes.

7.applications.


Startupclasses

Friday, March 25, 2011

weblogic training

1. TO create domain C:\devtools\bea10mp1\wlserver_10.0\common\bin>config.cmd
2. Security service provide api
3. Three security model basic, form, digest and
4. open ldap
5. volatile data store in the DB. non-volatile data store in ldap.
6. Roles does not come under weblogic administrator.
7. Security has algorithms. More permission are allowed. If denied, It will take precedence.
8. group level is precendence over user level.
9. Never assign permissions to the users.
10. Roles can be changed through admin console for quick fixes but not reliable as next build it will be lost. you need to have process to take care of it.
11. IpSec is used by VPN. IT is 2-way authentication. Encryption will be there.
12. weblogic replication is for localization of data. like manufacturing of data.
13. Failover and FailBack. Failback where primary becomes primary again.
14. Oracle mirroring is cheapest solution.
15. Log chaipping and configuring the mirror.
16. Multi Data Source are required because fail back server would have different instance names. Only clustering this is not required because of virtual address.
17. Mirroring also required multi data source because of same reason.
18. Create domain using config.cmd.
19. For trusted domains.
C:\devtools\bea10mp1\wlserver_10.0\common\nodemanager\nodemanager.domains
medrec=C\:\\devtools\\bea10mp1\\wlserver_10.0\\samples\\domains\\medrec
20. bea\wlserver\server\bin\startNodeManager.cmd apurang1 5556
21. Node Manager only starts the managed server. After that it is direct communication.
22. java weblogic.WLST to start wlst
C:\devtools\bea10mp1\wlserver_10.0\server\bin\
installNodeMgrSvc.cmd

installSvc.cmd command