bila repo belum di update
contoh untuk hapus yg lama dan update ke yg baru :
rm -fr ~/.m2/repository/com/sun/xml
rm -fr ~/.m2/repository/com/sun/tools
untuk menghapus bagian xml dan tools
bila tidak di update maka ketika build ada tampilan mirip2 :
[INFO] Scanning for projects…
[INFO] ————————————————————————
[INFO] Building EasywebAdmin-Engine
[INFO] task-segment: [package]
[INFO] ————————————————————————
Downloading: http://mvn03.src.dev.imocha.com.my/nexus/content/groups/public/com/sun/xml/bind/jaxb-impl/2.0-SNAPSHOT/jaxb-impl-2.0-SNAPSHOT.pom
Downloading: http://mvn03.src.dev.imocha.com.my/nexus/content/groups/public/com.sun.xml.bind/poms/jaxb-impl-2.0-SNAPSHOT.pom
Downloading: http://mvn03.src.dev.imocha.com.my/nexus/content/groups/public/com/sun/xml/bind/jaxb-impl/2.0-SNAPSHOT/jaxb-impl-2.0-SNAPSHOT.pom
Downloading: http://mvn03.src.dev.imocha.com.my/nexus/content/groups/public/com/sun/xml/bind/jaxb-xjc/2.0-SNAPSHOT/jaxb-xjc-2.0-SNAPSHOT.pom
Downloading: http://mvn03.src.dev.imocha.com.my/nexus/content/groups/public/com.sun.xml.bind/poms/jaxb-xjc-2.0-SNAPSHOT.pom
Downloading: http://mvn03.src.dev.imocha.com.my/nexus/content/groups/public/com/sun/xml/bind/jaxb-xjc/2.0-SNAPSHOT/jaxb-xjc-2.0-SNAPSHOT.pom
Downloading: http://mvn03.src.dev.imocha.com.my/nexus/content/groups/public/com/sun/xml/bind/jaxb-impl/2.0-SNAPSHOT/jaxb-impl-2.0-SNAPSHOT.jar
Downloading: http://mvn03.src.dev.imocha.com.my/nexus/content/groups/public/com.sun.xml.bind/jars/jaxb-impl-2.0-SNAPSHOT.jar
Downloading: http://mvn03.src.dev.imocha.com.my/nexus/content/groups/public/com/sun/xml/bind/jaxb-impl/2.0-SNAPSHOT/jaxb-impl-2.0-SNAPSHOT.jar
Downloading: http://mvn03.src.dev.imocha.com.my/nexus/content/groups/public/com/sun/xml/bind/jaxb-xjc/2.0-SNAPSHOT/jaxb-xjc-2.0-SNAPSHOT.jar
Downloading: http://mvn03.src.dev.imocha.com.my/nexus/content/groups/public/com.sun.xml.bind/jars/jaxb-xjc-2.0-SNAPSHOT.jar
Downloading: http://mvn03.src.dev.imocha.com.my/nexus/content/groups/public/com/sun/xml/bind/jaxb-xjc/2.0-SNAPSHOT/jaxb-xjc-2.0-SNAPSHOT.jar
[INFO] ————————————————————————
[ERROR] BUILD ERROR
[INFO] ————————————————————————
[INFO] Failed to resolve artifact.
Missing:
———-
1) com.sun.xml.bind:jaxb-impl:jar:2.0-SNAPSHOT
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=com.sun.xml.bind -DartifactId=jaxb-impl -Dversion=2.0-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=com.sun.xml.bind -DartifactId=jaxb-impl -Dversion=2.0-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
Path to dependency:
1) com.sun.tools.xjc.maven2:maven-jaxb-plugin:maven-plugin:1.0
2) com.sun.xml.bind:jaxb-impl:jar:2.0-SNAPSHOT
2) com.sun.xml.bind:jaxb-xjc:jar:2.0-SNAPSHOT
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=com.sun.xml.bind -DartifactId=jaxb-xjc -Dversion=2.0-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=com.sun.xml.bind -DartifactId=jaxb-xjc -Dversion=2.0-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
Path to dependency:
1) com.sun.tools.xjc.maven2:maven-jaxb-plugin:maven-plugin:1.0
2) com.sun.xml.bind:jaxb-xjc:jar:2.0-SNAPSHOT
———-
2 required artifacts are missing.
for artifact:
com.sun.tools.xjc.maven2:maven-jaxb-plugin:maven-plugin:1.0
from the specified remote repositories:
nexus (http://mvn03.src.dev.imocha.com.my/nexus/content/groups/public)
[INFO] ————————————————————————
[INFO] For more information, run Maven with the -e switch
[INFO] ————————————————————————
[INFO] Total time: 15 seconds
[INFO] Finished at: Wed Feb 04 16:13:59 WIT 2009
[INFO] Final Memory: 8M/98M
[INFO] ————————————————————————
awal php install server xampp versi linux
su ## login sebagai super user (root)
tar xvfz xampp-linux-1.6.tar.gz -C /opt ## ekstrak lampp ke folder /opt
/opt/lampp/lampp start ## untuk menjalankan lampp
/opt/lampp/lampp php4 ## menjalankan lampp memakai php v4
/opt/lampp/lampp php5 ## menjalankan lampp memakai php v5 /opt/lampp/lampp phpstatus ## melihat status versi php
/opt/lampp/lampp stop ## menghentikan lampp
/opt/lampp/lampp restart ## me-restart (stop-start) lampp
rm -rf /opt/lampp ## meng-uninstall lampp
cp /opt/lampp/lampp /etc/init.d/lampp
# ln -s /etc/init.d/lampp /etc/rc2.d/S86lampp
# ln -s /etc/init.d/lampp /etc/rc3.d/S86lampp
pasang log4j
import org.apache.log4j.Logger;
public class aha {
private static final Logger log = Logger.getLogger(aha.class);
private String coba=”percobaan log4j”;
log.info(“LOGNYA:”+coba);
}
untuk keterangan tempat log.. lihat di log4j.properties
Converter variable Java
Java – comparing strings
Use == for primitive data types like int
If (mystring == null)
Use the equals() method to compare objects
Use .equals for strings : if (a.equals(“cat”))
Java – Converting int to string
String myString = Integer.toString(my int value)
or
String str = “” + i
Java – Converting String to int
int i = Integer.parseInt(str);
or
int i = Integer.valueOf(str).intValue();
double to String :
String str = Double.toString(i);
long to String :
String str = Long.toString(l);
float to String :
String str = Float.toString(f);
String to double :
double d = Double.valueOf(str).doubleValue();
String to long :
long l = Long.valueOf(str).longValue();
or
long l = Long.parseLong(str);
String to float :
float f = Float.valueOf(str).floatValue();
decimal to binary :
int i = 42;
String binstr = Integer.toBinaryString(i);
decimal to hexadecimal :
int i = 42;
String hexstr = Integer.toString(i, 16);
or
String hexstr = Integer.toHexString(i);
or (with leading zeroes and uppercase)
public class Hex {
public static void main(String args[]){
int i = 42;
System.out.print
(Integer.toHexString( 0×10000 | i).substring(1).toUpperCase());
}
}
hexadecimal (String) to integer :
int i = Integer.valueOf(“B8DA3″, 16).intValue();
or
int i = Integer.parseInt(“B8DA3″, 16);
ASCII code to String
int i = 64;
String aChar = new Character((char)i).toString();
integer to ASCII code (byte)
char c = ‘A’;
int i = (int) c; // i will have the value 65 decimal
integer to boolean
b = (i != 0);
boolean to integer
i = (b)?1:0;
belajar validasi sederhana
Name : String with a maximum length of 50 characters
Age : Integer between 1 and 120
Email : A valid email address
The sample screen is given below.

First we need an action class to display the new customer form.
CustomerNewAction.java – Action class to dispatch to customer data capture form
- package validation.action;
- import com.opensymphony.xwork2.ActionSupport;
- public class CustomerNewAction extends ActionSupport {
- public String execute(){
- return SUCCESS;
- }
- }
package validation.action; import com.opensymphony.xwork2.ActionSupport; public class CustomerNewAction extends ActionSupport { public String execute(){ return SUCCESS; } }
customer_new.jsp – Form to capture customer data
- <%@ taglib prefix=“s” uri=“/struts-tags” %>
- <html>
- <head>
- <s:head/>
- </head>
- <body>
- <s:form action=“CustomerSaveAction”>
- <h2>Enter Customer Details</h2>
- <s:textfield label=“Name” name=“name”></s:textfield>
- <s:textfield label=“Age” name=“age”></s:textfield>
- <s:textfield label=“Email” name=“email”></s:textfield>
- <s:submit label=“Save” name=“Save”></s:submit>
- </s:form>
- </body>
- </html>
<%@ taglib prefix=”s” uri=”/struts-tags” %> <html> <head> <s:head/> </head> <body> <s:form action=”CustomerSaveAction”> <h2>Enter Customer Details</h2> <s:textfield label=”Name” name=”name”></s:textfield> <s:textfield label=”Age” name=”age”></s:textfield> <s:textfield label=”Email” name=”email”></s:textfield> <s:submit label=”Save” name=”Save”></s:submit> </s:form> </body> </html>
One important thing to note here is the use of s:head tag. This injects the required stylesheets for error display after validation. The default theme used here is xhtml.
As you can see the input form is submitted to CustomerSaveAction. This will save the data and will dispatch to a page customer_save_success.jsp.
CustomerSaveAction.java – This is responsible for saving customer data. In this example, actual save is not implemented.
- package validation.action;
- import com.opensymphony.xwork2.ActionSupport;
- public class CustomerSaveAction extends ActionSupport {
- private String name;
- private int age;
- private String email;
- public String getName() {
- return name;
- }
- public void setName(String name) {
- this.name = name;
- }
- public int getAge() {
- return age;
- }
- public void setAge(int age) {
- this.age = age;
- }
- public String getEmail() {
- return email;
- }
- public void setEmail(String email) {
- this.email = email;
- }
- public String execute(){
- return SUCCESS;
- }
- }
package validation.action; import com.opensymphony.xwork2.ActionSupport; public class CustomerSaveAction extends ActionSupport { private String name; private int age; private String email; public String getName() { return name; } public void setName(String name) { this.name = name; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String execute(){ return SUCCESS; } }
customer_save_success.jsp
- <%@ taglib prefix=“s” uri=“/struts-tags” %>
- <html>
- <head>
- </head>
- <body>
- <h2>Customer information saved successfully</h2>
- </body>
- </html>
<%@ taglib prefix=”s” uri=”/struts-tags” %> <html> <head> </head> <body> <h2>Customer information saved successfully</h2> </body> </html>
Now we need to apply the declarative validation to CustomerSaveAction. To do that create a file CustomerSaveAction-validation.xml in the same folder which contains CustomerSaveAction.java. In Struts2, validation rules for an action class X is saved in a file X-validation.xml.
CustomerSaveAction-validation.xml
- <!DOCTYPE validators PUBLIC ”-//OpenSymphony Group//XWork Validator 1.0.2//EN”
- “http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd”>
- <validators>
- <field name=“name”>
- <field-validator type=“requiredstring”>
- <message>You must enter a value for Name</message>
- </field-validator>
- <field-validator type=“stringlength”>
- <param name=“maxLength”>50</param>
- <message>
- Name cannot contain more than 50 characters
- </message>
- </field-validator>
- </field>
- <field name=“age”>
- <field-validator type=“int”>
- <param name=“min”>1</param>
- <param name=“max”>120</param>
- <message>Age must between 1 and 120</message>
- </field-validator>
- </field>
- <field name=“email”>
- <field-validator type=“email”>
- <message>Please enter a valid email address</message>
- </field-validator>
- </field>
- </validators>
<!DOCTYPE validators PUBLIC “-//OpenSymphony Group//XWork Validator 1.0.2//EN” “http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd”> <validators> <field name=”name”> <field-validator type=”requiredstring”> <message>You must enter a value for Name</message> </field-validator> <field-validator type=”stringlength”> <param name=”maxLength”>50</param> <message> Name cannot contain more than 50 characters </message> </field-validator> </field> <field name=”age”> <field-validator type=”int”> <param name=”min”>1</param> <param name=”max”>120</param> <message>Age must between 1 and 120</message> </field-validator> </field> <field name=”email”> <field-validator type=”email”> <message>Please enter a valid email address</message> </field-validator> </field> </validators>
For more details on each of the validators and their parameters, please see here.
Let us connect everything together using struts.xml. Note the extra result tag (input) for CustomerSaveAction. It indicates the page to be displayed in case of input error.
struts.xml
- <?xml version=“1.0″ encoding=“UTF-8″ ?>
- <!DOCTYPE struts PUBLIC
- “-//Apache Software Foundation//DTD Struts Configuration 2.0//EN”
- “http://struts.apache.org/dtds/struts-2.0.dtd”>
- <struts>
- <package name=“validation” extends=“struts-default”>
- <action name=“CustomerNewAction”
- class=“validation.action.CustomerNewAction”>
- <result>/validation/customer_new.jsp</result>
- </action>
- <action name=“CustomerSaveAction”
- class=“validation.action.CustomerSaveAction”>
- <result name=“input”>/validation/customer_new.jsp</result>
- <result>/validation/customer_save_success.jsp</result>
- </action>
- </package>
- </struts>
<?xml version=”1.0″ encoding=”UTF-8″ ?> <!DOCTYPE struts PUBLIC “-//Apache Software Foundation//DTD Struts Configuration 2.0//EN” “http://struts.apache.org/dtds/struts-2.0.dtd”> <struts> <package name=”validation” extends=”struts-default”> <action name=”CustomerNewAction” class=”validation.action.CustomerNewAction”> <result>/validation/customer_new.jsp</result> </action> <action name=”CustomerSaveAction” class=”validation.action.CustomerSaveAction”> <result name=”input”>/validation/customer_new.jsp</result> <result>/validation/customer_save_success.jsp</result> </action> </package> </struts>
web.xml
- <?xml version=“1.0″ encoding=“UTF-8″?>
- <web-app xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”
- xmlns=“http://java.sun.com/xml/ns/javaee”
- xmlns:web=“http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd”
- xsi:schemaLocation=“http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd”
- id=“WebApp_ID” version=“2.5″>
- <display-name>struts2</display-name>
- <filter>
- <filter-name>struts2</filter-name>
- <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
- </filter>
- <filter-mapping>
- <filter-name>struts2</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
- </web-app>
<?xml version=”1.0″ encoding=”UTF-8″?> <web-app xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns=”http://java.sun.com/xml/ns/javaee” xmlns:web=”http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd” xsi:schemaLocation=”http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd” id=”WebApp_ID” version=”2.5″> <display-name>struts2</display-name> <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> </web-app>
To invoke this sample, access the URL http://localhost:8080/struts2/CustomerNewAction.action. This is how the screen appears after validation,

english – indonesia – english
http://www.speedytown.com/kimyong/translator.html
update plugin eclipse … reminder
subversion
http://download.eclipse.org/technology/subversive/0.7/update-site/
Subversive Integrations
http://www.polarion.org/projects/subversive/download/integrations/update-site/
Subversive SVN Connectors
http://www.polarion.org/projects/subversive/download/eclipse/2.0/update-site/
maven
http://m2eclipse.sonatype.org/update-dev/
badan sehat , tubuh pun Quartz
// samain nilai ctime = jam kamu
long ctime = System.currentTimeMillis();
SchedulerFactory schedulerFactory = new StdSchedulerFactory();
Scheduler scheduler = schedulerFactory.getScheduler();
// job detail itu buat nentuin action apa yg bakal di kerjain , klo di sini sih yg mau jalanin simpleQuartz.class
JobDetail jobDetail = new JobDetail(“detailKeteranganHonda”, “detailKeteranganGroup”, simpleQuartz.class);
// trigger ibarat bom alarm ,isinya cuma setting waktu kapan meledak dan mau berapa kali meledak
SimpleTrigger simpleTrigger = new SimpleTrigger(“HondaTrigger”, “NamaGroup”);
// si trigger bakal langsung mulai soalnya starttimenya sekarang juga, jalannya tiap 1 detik dan ngulang selama 4 kali (jadi total jalannya 5 kali )
simpleTrigger.setStartTime(new Date(ctime));
simpleTrigger.setRepeatInterval(1000);//berjalan tiap 1 seconds
simpleTrigger.setRepeatCount(4);// berjalan 5 kali
// yang paling penting dan utama sebenarnya cuma 2 baris dibawah ini
scheduler.scheduleJob(jobDetail, simpleTrigger);
scheduler.start();
=================================================
cronTtrigger di pakai untuk parameter waktu yang lebih detail dari simpletrigger ,
contohnya seperti berikut :
CronTrigger ct = new CronTrigger(“QuartzCronTrigger”,”QuartzCtGrup”);
ct.setName(“QuartzCronTrigger”);
ct.setGroup(“QuartzCtGrup”);
ct.setCronExpression(“0/2 17 * * * ?”);// jalan tiap 2 detik selama menit ke 17 tiap jam tiap hari
scheduler.scheduleJob(jobDetail, ct);
Contoh2 parameter waktu untuk CronExpression ada di :
| Expression | Meaning | |
|---|---|---|
"0 0 12 * * ?" |
Fire at 12pm (noon) every day |
|
"0 15 10 ? * *" |
Fire at 10:15am every day |
|
"0 15 10 * * ?" |
Fire at 10:15am every day |
|
"0 15 10 * * ? *" |
Fire at 10:15am every day |
|
"0 15 10 * * ? 2005" |
Fire at 10:15am every day during the year 2005 |
|
"0 * 14 * * ?" |
Fire every minute starting at 2pm and ending at 2:59pm, every day |
|
"0 0/5 14 * * ?" |
Fire every 5 minutes starting at 2pm and ending at 2:55pm, every day |
|
"0 0/5 14,18 * * ?" |
Fire every 5 minutes starting at 2pm and ending at 2:55pm, AND fire every 5 minutes starting at 6pm and ending at 6:55pm, every day |
|
"0 0-5 14 * * ?" |
Fire every minute starting at 2pm and ending at 2:05pm, every day |
|
"0 10,44 14 ? 3 WED" |
Fire at 2:10pm and at 2:44pm every Wednesday in the month of March. |
|
"0 15 10 ? * MON-FRI" |
Fire at 10:15am every Monday, Tuesday, Wednesday, Thursday and Friday |
|
"0 15 10 15 * ?" |
Fire at 10:15am on the 15th day of every month |
|
"0 15 10 L * ?" |
Fire at 10:15am on the last day of every month |
|
"0 15 10 ? * 6L" |
Fire at 10:15am on the last Friday of every month |
|
"0 15 10 ? * 6L" |
Fire at 10:15am on the last Friday of every month |
|
"0 15 10 ? * 6L 2002-2005" |
Fire at 10:15am on every last friday of every month during the years 2002, 2003, 2004 and 2005 |
|
"0 15 10 ? * 6#3" |
Fire at 10:15am on the third Friday of every month |