2012年7月11日 星期三

SharePoint 2010: Update Web.config Feature with Access Denied

Start > Microsoft SharePoint 2010 Products > SharePoint 2010 Management Shell

$contentService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$contentService
.RemoteAdministratorAccessDenied =
 $false
$contentService
.Update()
 

2012年6月27日 星期三

SharePoint 2010 Installation issue: Cannot Login to Central Administration

Check on this:

  • UAC Enabled on the machine
    • Start => Administrator Tools => Server Manager => Configure IE ESC under Security Information.
  • User Account Control setting blocks the access.
    • Control Panel => User Accounts => User Accounts => Change user Account Control settings

2012年6月20日 星期三

Oracle: identifier 'UTL_FILE' must be declared

RUN SQL command:
grant execute on utl_file to public;

Oracle: create directory

Create directory:

create or replace directory [mydir] as ‘C:/temp’

Grant user:
grant read,write on directory [mydir] to [username]

List directory:
select * from dba_directories;


2012年3月29日 星期四

Windows 7: Hide User on Login screen


GO regedit

GO: HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon

In the left panel, right click on Winlogon and click New and click Key.

Type SpecialAccounts and press Enter

In the left panel, right click on SpecialAccounts and click New and click Key.

Type UserList and press Enter.

In right panel of UserList, right click on a empty area and click New then click DWORD (32bit) Value.

Type in the [user account] that you want to hide and press Enter.eg: Everyday Account.

 In the right panel, right click on the user account name and click Modify.

 To hide the user account – Type 0 and click OK. (number zero not the letter)
Whenever you want to use the account just unhide the it by typing 1 instead of zero.


2012年3月28日 星期三

Oracle connection drop repeatedly on Weblogic/WebCenter


If Oracle connection is dropped repeatedly for unknown reason. Try to do this:

sqlplus sys/welcome1@XE as sysdba
show parameter session
show parameter processes
alter system reset sessions scope=spfile sid='*';
alter system set processes=200 scope=spfile;
shutdown immediate

exit
net stop OracleServiceXE
net start OracleServiceXE
sqlplus sys/welcome1@XE as sysdba
show parameter session
show parameter processes
exit

2012年2月24日 星期五

SharePoint 2010: Access Denied on update web.config Feature

Start > Microsoft SharePoint 2010 Products > SharePoint 2010 Management Shell


$contentService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$contentService.RemoteAdministratorAccessDenied = $false
$contentService.Update()

2012年1月11日 星期三

JPA: How To Dynamic Set up Default Schema for Different Environment on Spring

In the property file:

<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="persistenceUnitName" value="xxxunitname" />
<property name="jpaProperties" ref="hibernateProperties" />
</bean>
<bean id="hibernateProperties"  
     class="com.pa.test.CustomPropertiesFactoryBean">
    <property name="nullable">
        <map>
            <entry key="hibernate.default_schema" value="xxx"/>
        </map>
    </property>
 </bean>

Create your own class:

public class  CustomPropertiesFactoryBean extends PropertiesFactoryBean {

private Map nullable;

public Map getNullable ( )
{
   return nullable;
}

public void setNullable ( Map nullable )
{
   this.nullable = nullable;
}

@Override
protected Object createInstance ( ) throws IOException
{
   Properties result = super.mergeProperties();
 
   String defaultschema =
                     {get from other place like other database or JNDI option or JVM option}
   if (StringUtils.hasText(defaultschema)) {
    result.put("hibernate.default_schema", defaultschema);
   } else {
   for (String key : nullable.keySet())
   {
       if (StringUtils.hasText(nullable.get(key)))
       {
           result.put(key, nullable.get(key));
       }
   }
   }

   return result;
}
}



2012年1月9日 星期一

Glassfish won't start up by error "EMBEDDED Broker start failure:code = 1"

if you get error: EMBEDDED Broker start failure:code = 1 and can't start up the app server.

  • Go to C:\Sun\AppServer\domains\domain1\imq\instances\imqbroker
  • Delete "lock" file.
  • Start up server

2011年12月1日 星期四

Add Command Window on Right-click Properties

Create a text file named command.prompt.reg


  • Add command



Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\Command Prompt\Command]
@="cmd.exe /k pushd %L"



  • Save it.
  • Run the file.