2015年1月9日金曜日

Issue: Install iamsuite on Windows Server 2012

Error info:
Configure Security Store:execute the following command
oracle_common\common\bin\wlst.cmd
@ $ORACLE_HOME\common\tools\configureSecurityStore.py -d
@ $DOMAIN_HOME -c IAM -m create -p <OPSS_SCHEMA_PASSWORD>

Failed to get environment, environ will be empty: (0, u'Failed to execute
comman
d ([\'sh\', \'-c\', \'env\']): java.io.IOException: Cannot run program "sh":
Cre
ateProcess error=2, \x8Ew\x92\u80B3\x82\uA0BD\x83t\x83@\x83')
Problem invoking WLST - Traceback (innermost last):
  File
"C:\Users\Administrator\Desktop\Alice_setup\AliceMdw\Oracle_IDM1\common\t
@ ools\configureSecurityStore.py", line 42, in ?
  File
"C:\Users\ADMINI~1\Desktop\ALICE_~1\AliceMdw\WLSERV~1.3\common\wlst\modul
es\jython-modules.jar\Lib/javaos$py.class", line 256, in __getitem__
  File
"C:\Users\ADMINI~1\Desktop\ALICE_~1\AliceMdw\WLSERV~1.3\common\wlst\modul
es\jython-modules.jar\Lib/UserDict$py.class", line 14, in __getitem__
  File
"C:\Users\ADMINI~1\Desktop\ALICE_~1\AliceMdw\WLSERV~1.3\common\wlst\modul
es\jython-modules.jar\Lib/javaos$py.class", line 256, in __getitem__
  File
"C:\Users\ADMINI~1\Desktop\ALICE_~1\AliceMdw\WLSERV~1.3\common\wlst\modul
es\jython-modules.jar\Lib/UserDict$py.class", line 14, in __getitem__
KeyError: COMMON_COMPONENTS_HOME 


Workaround:
To solve this, we need to patch the jython-modules.jar. we need to go to C:\Oracle\Middleware\wlserver_10.3\common\wlst\modules and add in javashell.py "Windows Server 2012".

For example:
_osTypeMap = (
( "nt", ( 'nt', 'Windows NT', 'Windows NT 4.0', 'WindowsNT',
'Windows 2000', 'Windows 2003', 'Windows XP', 'Windows CE',
'Windows Vista', 'Windows Server 2008', 'Windows 7', 'Windows Server 2012' )),
( "dos", ( 'dos', 'Windows 95', 'Windows 98', 'Windows ME' )),
( "mac", ( 'mac', 'MacOS', 'Darwin' )),
( "None", ( 'None', )), 

2014年10月9日木曜日

HOW DO YOU DO: CREATE AD USER AND ADD THIS INTO GROUP

static void Main(string[] args)
       {
           try
           {
               string[] groups = new string[] { "Admin", "Back_End", "CSharp", "Developer", "Faserati", "Flex", "Front-End", "HTML", "JS", "SQL", "Teacher", "Tester" };

               DirectoryEntry root = new DirectoryEntry();
               root.Path = "LDAP://FAST.Faserati/CN=Users,DC=FAST,DC=Faserati";
               root.Username = "Administrator";
               root.Password = "P@$$w0rd";

               DirectoryEntry group = new DirectoryEntry();
               group.Path = "LDAP://FAST.Faserati";
               group.Username = "Administrator";
               group.Password = "P@$$w0rd";
               group.Children.SchemaFilter.Add("group");
               for (int i = 0; i < 10000; i++)
               {
                   Random r = new Random();
                   string g = groups[r.Next(0, 11)];

                   DirectoryEntry parent = group.Children.Find("CN=" + g);
                   parent.Invoke("Add", CreateUser(root, g + i.ToString()).Path.ToString());

               }
           }
           catch (COMException ex)
           {
               Console.WriteLine(ex.Message);
           }
       }

       static DirectoryEntry CreateUser(DirectoryEntry root, string userName)
       {
           using (var de = new DirectoryEntry())
           {
               de.Path = "LDAP://FAST.Faserati/CN=Users,DC=FAST,DC=Faserati";
               de.Username = "Administrator";
               de.Password = "P@$$w0rd";
               DirectoryEntry user = root.Children.Add("CN=" + userName, "user");
               user.Properties["company"].Add("Faserati");
               user.Properties["employeeID"].Add("4711");
               user.Properties["samAccountName"].Add(userName);
               user.Properties["userPrincipalName"].Add(userName + "@explorer.local");
               user.Properties["sn"].Add("Doe");
               user.Properties["mail"].Add(userName + "@Faserati.com");
               user.Properties["userPassword"].Add("someSecret");
               user.Properties["userAccountControl"].Add(544);
               user.CommitChanges();

               return user;
           }

http://technet.microsoft.com/en-us/library/cc783256(v=ws.10).aspx

Understanding unique attributes in Active Directory

http://wenku.baidu.com/link?url=LewnAPwN0b7KLzTqm6L6yUWIL4s8ulFAZS4beoBoAAEtQ0AkFNZJC0p27n9ynArElwXlDOqq86VvkPyJMapTiAk8yjg8_BvcXWIkcL9apkm

Diagnosing Intermittent Authentication Failures and User Lock-Outs in Oracle WebLogic

2014年7月8日火曜日

Android: Gen already exists but is not a source folder

Error info:
Gen already exists but is not a source folder.

Workaround-1:
1. Right click project, and select "Properties"
2. Select "Java Build Path"
3. Open "Source"
4. Click "Add Folder..."
5. Select "gen", click "OK", Click "YES",and click "OK"
6. Right click project, select "Android Tools"-->"Fix Project Properties"

Workaround-2:
This error's root cause is classpath issue,and look likes following format.
-----------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
-----------------------------------------------
You can modify this file's following tags:
------------------------------
kind="src"
kind="con"
kind="lib"
kind="output"
-------------------------------------------------

2014年6月30日月曜日

How to Install Java 7(JDK 7u60) On RHEL 6

Step1 Download File
http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
#tar xzf jdk-7u60-linux-x64.gz

Step2 Install JAVA using Alternatives
#cd /home/oracle/alice/jdk1.7.0_60
#[oracle@infbjvm1XX jdk1.7.0_60]$ sudo -i
[root@infbjvm1XX ~]# alternatives --install /usr/bin/java java /home/oracle/alice/jdk1.7.0_60/bin/java 2
[root@infbjvm1XX ~]# alternatives --config java
There are 3 programs which provide 'java'.
  Selection    Command
-----------------------------------------------
*+ 1           /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java
   2           /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
   3           /home/oracle/alice/jdk1.7.0_60/bin/java
Enter to keep the current selection[+], or type selection number: 3
#

Now you may also required to setup javac and jar commands path using alternatives:
[root@infbjvm1XX ~]# alternatives --install /usr/bin/jar jar /home/oracle/alice/jdk1.7.0_60/bin/java
[root@infbjvm1XX ~]# alternatives --install /usr/bin/javac javac /home/oracle/alice/jdk1.7.0_60/bin/java
[root@infbjvm1XX ~]# set jar /home/oracle/alice/jdk1.7.0_60/bin/java
[root@infbjvm1XX ~]# set javac /home/oracle/alice/jdk1.7.0_60/bin/javac

Step3 Check JAVA Version
# java -version
java version "1.7.0_60"
Java(TM) SE Runtime Environment (build 1.7.0_60-b19)
Java HotSpot(TM) 64-Bit Server VM (build 24.60-b09, mixed mode)

Step4 Setup Environment Variables
export JAVA_HOME=/home/oracle/alice/jdk1.7.0_60/
export JRE_HOME=/home/oracle/alice/jdk1.7.0_60/jre
export PATH=$PATH:/home/oracle/alice/jdk1.7.0_60/bin:/home/oracle/alice/jdk1.7.0_60/jre/bin

Problem starting Weblogic Server 10.3.6

Error info:
<Jun 30, 2014 2:46:15 PM CST> <Critical> <Health> <BEA-310006> <Critical Subsystem PersistentStore._WLS_AdminServer has failed. Setting server state to FAILED.
Reason: weblogic.store.PersistentStoreFatalException: [Store:280105]The persistent file store "_WLS_AdminServer" cannot open file _WLS_ADMINSERVER000000.DAT.>
<Jun 30, 2014 2:46:15 PM CST> <Critical> <WebLogicServer> <BEA-000385> <Server health failed. Reason: health of critical service 'PersistentStore._WLS_AdminServer' failed>
<Jun 30, 2014 2:46:15 PM CST> <Error> <Store> <BEA-280061> <The persistent store "_WLS_AdminServer" could not be deployed: weblogic.store.PersistentStoreFatalException: [Store:280105]The persistent file store "_WLS_AdminServer" cannot open file _WLS_ADMINSERVER000000.DAT.

Workaround:
Navigating to
/user_projects/domains/<<Domain_name>>/servers/AdminServer/data/store/default/

directory and delete the _WLS_ADMINSERVER000000.DAT file.
After deleting the file, try restart the server again.
This action is detailed out in Oracle Support doc if 957377.1.

java.lang.OutOfMemoryError: PermGen space with weblogic

Error info:
java.lang.OutOfMemoryError: PermGen space
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at weblogic.utils.classloaders.GenericClassLoader.defineClass(GenericClassLoader.java:343)
at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:302)
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:270)
at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:64)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:179)
at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:43)
at oracle.cabo.ui.laf.base.xhtml.InlineMessageRenderer._isAccessKeyNotOnPrompt(Unknown Source)
at oracle.cabo.ui.laf.base.xhtml.InlineMessageRenderer._createContentNode(Unknown Source)
at oracle.cabo.ui.laf.base.xhtml.InlineMessageRenderer.__registerMarlinRenderer(Unknown Source)
at oracle.cabo.ui.laf.base.xhtml.XhtmlLookAndFeel._registerDependentRenderers(Unknown Source)
at oracle.cabo.ui.laf.base.xhtml.XhtmlLookAndFeel.createDefaultFactory(Unknown Source)
at oracle.cabo.ui.laf.base.xhtml.XhtmlLookAndFeel.<clinit>(Unknown Source)
at oracle.cabo.ui.laf.base.desktop.BaseDesktopUtils.registerLookAndFeel(Unknown Source)
at oracle.cabo.ui.laf.LookAndFeelManager.createDefaultLookAndFeelManager(Unknown Source)
at oracle.cabo.ui.laf.LookAndFeelManager.getDefaultLookAndFeelManager(Unknown Source)
at oracle.sysman.emSDK.chart.EmChartCacheManager.init(EmChartCacheManager.java:105)
at oracle.sysman.emSDK.svc.ServiceUtil.initService(ServiceUtil.java:94)
at oracle.sysman.eml.app.ContextInitializer.contextInitialized(ContextInitializer.java:600)
at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:481)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:181)
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1868)
at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3154)
at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1518)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:484)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
java.lang.OutOfMemoryError: PermGen space
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at weblogic.utils.classloaders.GenericClassLoader.defineClass(GenericClassLoader.java:343)
at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:302)
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:270)
at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:64)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:179)
at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:43)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:190)
at oracle.sysman.emSDK.svc.ServiceUtil.initService(ServiceUtil.java:91)

Work around:
The reference bug is listed following:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4957990

In my case the solution was to edit the DOMAIN\bin\setDomainEnv.cmd file. The following modifications were made before the server would start as intended:
The -Xms and -Xmx values were increased;
the -XX:PermSize and -XX:MaxPermSize values were increased too
and lastly, but probably most importantly
the if "%JAVA_VENDOR%"=="Sun" (conditions were changed to if "%JAVA_VENDOR%"=="Oracle" ) in order to properly recognize my JVM.

Reference Doc:
http://www.cnblogs.com/pipijiqimao/archive/2013/03/06/2946344.html