2011年11月3日 星期四
Syn with node agent memory JVM options
Making sure the synchronous actions occur when your start your instance-cluster.
Answer: By default, running the command, asadmin start-node-agent NODE-AGENT-NAME will not actually register synchronization for all entries/parameters/configuration for the cluster configuration in GlassFish V2 update 1 or Application Server 9.1 when starting up the cluster... To make sure synchronization kicks in when starting the cluster use the following two commands;
./asadmin start-node-agent --startinstances=false NODE-AGENT-NAME
./asadmin start-cluster CLUSTER-NAME
2011年9月26日 星期一
JDeveloper: ADF: Custom Converter
1. Create Converter:
package com.pyramid.misc;
import java.util.Map;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
public class PhoneConverter implements Converter {
public PhoneConverter() {
}
public Object getAsObject(FacesContext facesContext,
UIComponent uiComponent, String value) {
if (value == null || (value.trim().length() == 0))
{
return value;
}
// format phone numbers to display correctly
String phone = value.trim();
if (phone.length() == 10) {
phone = phone.substring(0, 3) + "-" + phone.substring(3, 6) + "-" + phone.substring(6, 10);
}
else if (phone.matches("\\d{10}\\s*\\d+")) {
phone = phone.replaceAll("\\s+", "");
phone = phone.substring(0, 3) + "-" + phone.substring(3, 6) + "-" + phone.substring(6, 10) + " x" + phone.substring(10);
}
return phone;
}
public String getAsString(FacesContext facesContext,
UIComponent uiComponent, Object value) {
String phoneNumber = (String)value;
if (phoneNumber == null || (phoneNumber.trim().length() == 0))
{
return "";
}
String phone = phoneNumber.trim();
if (phone.length() == 10) {
phone = phone.substring(0, 3) + "-" + phone.substring(3, 6) + "-" + phone.substring(6, 10);
}
else if (phone.matches("\\d{10}\\s*\\d+")) {
phone = phone.replaceAll("\\s+", "");
phone = phone.substring(0, 3) + "-" + phone.substring(3, 6) + "-" + phone.substring(6, 10) + " x" + phone.substring(10);
}
return phone;
}
}
<af:outputText value="#{row.Phone}" id="ot3">
<f:converter converterId="PhoneConverter"/>
</af:outputText>
package com.pyramid.misc;
import java.util.Map;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
public class PhoneConverter implements Converter {
public PhoneConverter() {
}
public Object getAsObject(FacesContext facesContext,
UIComponent uiComponent, String value) {
if (value == null || (value.trim().length() == 0))
{
return value;
}
// format phone numbers to display correctly
String phone = value.trim();
if (phone.length() == 10) {
phone = phone.substring(0, 3) + "-" + phone.substring(3, 6) + "-" + phone.substring(6, 10);
}
else if (phone.matches("\\d{10}\\s*\\d+")) {
phone = phone.replaceAll("\\s+", "");
phone = phone.substring(0, 3) + "-" + phone.substring(3, 6) + "-" + phone.substring(6, 10) + " x" + phone.substring(10);
}
return phone;
}
public String getAsString(FacesContext facesContext,
UIComponent uiComponent, Object value) {
String phoneNumber = (String)value;
if (phoneNumber == null || (phoneNumber.trim().length() == 0))
{
return "";
}
String phone = phoneNumber.trim();
if (phone.length() == 10) {
phone = phone.substring(0, 3) + "-" + phone.substring(3, 6) + "-" + phone.substring(6, 10);
}
else if (phone.matches("\\d{10}\\s*\\d+")) {
phone = phone.replaceAll("\\s+", "");
phone = phone.substring(0, 3) + "-" + phone.substring(3, 6) + "-" + phone.substring(6, 10) + " x" + phone.substring(10);
}
return phone;
}
}
2. Register on faces-config.xml file (or faces configuration file)
<faces-config
...
...
<converter>
<description>A Converter for phone number</description>
<converter-id>PhoneConverter</converter-id>
<converter-class>
com.pyramid.misc.PhoneConverter
</converter>
<description>A Converter for phone number</description>
<converter-id>PhoneConverter</converter-id>
<converter-class>
com.pyramid.misc.PhoneConverter
</converter>
...
</faces-config>
3. Use in field:
<af:outputText value="#{row.Phone}" id="ot3">
<f:converter converterId="PhoneConverter"/>
</af:outputText>
2011年9月20日 星期二
SharePoint 2007: Display Attachment List
Display file links:
foreach (String fileAtt in attachmentsAtt)
{
String attachmentAbsoluteURL =
item.Attachments.UrlPrefix // gets the containing directory URL
+ fileAtt;
// Add ToDo here
}
Get SPFile from Attachment:
SPAttachmentCollection attachmentsAtt = item.Attachments;
foreach (String fileAtt in attachmentsAtt)
{
SPFile file = web.GetFile(attachmentsAtt.UrlPrefix + fileAtt);
// Add ToDo here
}
2011年9月15日 星期四
Glassfish: ReflectPermission suppressAccessChecks error
If you get something like on glassfish:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name '__ContractService': Initialization of bean failed; nested exception is java.security.AccessControlException: access denied (java.lang.reflect.ReflectPermission suppressAccessChecks)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)
Go to Admin console => Configurations => [target] => security
Uncheck Security Manager.
2011年9月12日 星期一
Weblogic: Create new and start up Managed Server
Create a new managed Server
1. Go to console.
2. Click Environment => Servers => New
3. Give a new name and use different port from other servers.
4. Save
Add library into new managed Server:
1. Go to console
2. Click on Deployment => adf.oracle.domain(1.0,11.1.1.0.0) => Target
3. Choose new managed server
4. Save
5. Repeat the 1-4 actions on library:
- adf.oracle.domain.webapp(1.0,11.1.1.1.0)
- jsf(1.2,1.2.9.0)
- jstl(1.2,1.2.0.1)
- ohw-rcf(5,5.0)
- ohw-uix(5,5.0)
- UIX(11,11.1.1.1.0)
- oracle.adf.dconfigbeans(1.0,11.1.1.0.0)
- oracle.adf.management(1.0,11.1.1.1.0)
- oracle.dconfig-infra
- oracle.jrf.system.filter
- oracle.jsp.next(11.1.1,11.1.1)
- oracle.sdp.client(11.1.1,11.1.1)
- oracle.soa.workflow.wc(11.1.1,11.1.1)
- oracle.webcenter.framework(11.1.1,11.1.1)
- oracle.webcenter.framework.view(11.1.1,11.1.1)
- oracle.webcenter.jive.dependency(11.1.1,11.1.1)
- oracle.webcenter.skin(11.1.1,11.1.1)
- oracle.wsm.seedpolicies(11.1.1,11.1.1) – only if you have installed Oracle Webservices Manager.
- oracle.portlet-producer.jpdk(11.1.1,11.1.1)
- oracle.portlet-producer.wsrp(11.1.1,11.1.1)
- DMS application
- wsm-pm
6. Go to console => Environment/Startup and Shutdown Classes:
7. Choose each item and add target to new managed server.
Start up new server on Windows:
1. Start up the domain
2. Go to %oracle_home%/user_projects/domains/[your domain]/bin
3. Create a shortcut on startManagedWebLogic.cmd on Desktop
4. Go to properties on the shortcut => Shortcut tab
5. Add [manage server name] & into target like C:/..../startmanagedWebLogic.cmd newManagedServer &
6. Double click on Shortcut.
Following is from
Oracle recommends creating a separate MDS schema to store custom Webcenter application metadata. Using existing MDS schemas may corrupt seeded repositories.
- Run rcu from RCU_HOME/bin folder. Skip the first screen.
- Specify Database connection parameters in the next step.
- From “Select Components” screen, specify “ORAFMWSCHOOL” for “Create a new Prefix”. Select Oracle AS Repository Components –> AS Common Schemas –> Metadata Services. Click Next.
- Enter schema password and confirm the same.
- Click Next and then Finish.
This creates ORAFMWSCHOOL_MDS schema in the database.
Login to Enterprise Manager console using http://localhost:7001/em
Click on “Metadata Repositories” link from left sidebar.
Click on “mds-soa” to bring up SOA MDS repository detail screen. From “Metadata Repository” menu under mds-soa, select Administration –> Register/Deregister.
From Database Repositories section, click on “Register…”. Enter database details and click on Query.
Select ORAFMWSCHOOL_MDS from the list of displayed Metadata Repositories. Enter a Repository Name and Schema password we created in Step 2.
This completes registration of repository with Oracle Weblogic server domain.
2011年7月28日 星期四
ava.security.AccessControlException: access denied (java.lang.RuntimePermission createClassLoader)
System got error when you deploy EJB or War file:
ava.security.AccessControlException: access denied (java.lang.RuntimePermission createClassLoader)
Go to Admin Console => Configuration => Security
Do not check Security Manager
restart app server.
Reference to http://java.dzone.com/articles/hudson-security-manager
ava.security.AccessControlException: access denied (java.lang.RuntimePermission createClassLoader)
Go to Admin Console => Configuration => Security
Do not check Security Manager
restart app server.
Reference to http://java.dzone.com/articles/hudson-security-manager
2011年7月21日 星期四
Db2 Backup
You have to turn on Administration Server.
C:.../> DB2ADMN SETID [username] (Enter)
C:.../> DB2ADMIN START
Then go to edit window and do the backup.
OR
CONNECT TO [schema Name];
QUIESCE DATABASE IMMEDIATE FORCE CONNECTIONS;
CONNECT RESET;
BACKUP DATABASE [schema Name]TO "C:\db2data" WITH 2 BUFFERS BUFFER 1024 PARALLELISM 1 WITHOUT PROMPTING;
CONNECT TO [schema Name];
UNQUIESCE DATABASE;
CONNECT RESET;
C:.../> DB2ADMN SETID [username] (Enter)
C:.../> DB2ADMIN START
Then go to edit window and do the backup.
OR
CONNECT TO [schema Name];
QUIESCE DATABASE IMMEDIATE FORCE CONNECTIONS;
CONNECT RESET;
BACKUP DATABASE [schema Name]TO "C:\db2data" WITH 2 BUFFERS BUFFER 1024 PARALLELISM 1 WITHOUT PROMPTING;
CONNECT TO [schema Name];
UNQUIESCE DATABASE;
CONNECT RESET;
2011年7月12日 星期二
2011年6月2日 星期四
Oracle: Startup sequence
1. Get in SQLPlus:
C:/>sqlplus /nolog
2. Log in as sysdba
SQL> conn username/password as sysdba
3. Startup databas
SQL> startup mount;
4. Start up listener:
Go back to command line: C:/lsnrctl start
5. start instance
Log in as sysdba SQL> alter database open;
6. startup console
Go back to command line: emctl start dbconsole
C:/>sqlplus /nolog
2. Log in as sysdba
SQL> conn username/password as sysdba
3. Startup databas
SQL> startup mount;
4. Start up listener:
Go back to command line: C:/lsnrctl start
5. start instance
Log in as sysdba SQL> alter database open;
6. startup console
Go back to command line: emctl start dbconsole
訂閱:
文章 (Atom)
