Yesterday our build system had problem. It was caused by our Maven 2 process receiving response code 401. I looked up for the meaning of this 401. Google showed me that it is an Authentication Error.
[sourcecode lang="shell"]
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error deploying artifact: Failed to transfer file: http://localhost:9999/artifactory/libs-snapshots-local/com/companyname/modulename/artifactname-1.2.0-20090528.051102-1.jar. Return code is: 401
[/sourcecode]
We use Apache Maven 2 as our standard build cycle. Some component depends on snapshots of other components. All software components were stored in our local Maven 2 repository, server by an Artifactory server; also running in the same application server with Hudson. The problem that I mentioned before was caused by Artifactory didn't really accept the authentication sent by Maven client process.
I dig up some more, and eventually found out that somehow we were missing the settings.xml file which was supposed to be there before. It is located in your $USER_HOME/.m2 folder. So I copied back the file, restart the application server. It works again like magic.
Friday, May 29, 2009
Monday, March 23, 2009
Get 'This project needs to migrate WTP metadata' error on Eclipse/Maven 2
Today I took a look of old source code base which I had not maintain for such a long time. It is a mock object of a web service. I wrote an XML-RPC client for a vendor specific API, and I need a mock servlet to test the code.
Today I decided to mavenize the project, as now I believe that's the best way to maintain my source code base. Because the servlet is a web application, I create the maven source try.
Oh ya, by the way I'm using these:
Eclipse 3.4 (Ganymede)
Apache Maven 2.0.9
Eclipse IAM == Maven Integration for Eclipse plugin == Q4E plugin (still prefer to call it Q4E)
After creating the source tree base I created the Eclipse configuration file using the Maven's Eclipse plugin.
I just need to invoke this maven task:
[sourcecode lang="shell"]
mvn eclipse:eclipse
[/sourcecode]
Then I opened the project in Eclipse. I found my project caught a chicken pox (a part of the project got the red rashes - errors). I tried to rebuild, and got this message:
I knew I missed something, but it's been 2 months since last time I configured Maven 2 web application, and I have totally forgotten the exact steps to do it.
Later I realised that I need to specify the WTP version, so here's the solution:
1) Clean up the project file, run the Maven 2 Eclipse plugin clean task
[sourcecode lang="shell"]
mvn eclipse:clean
[/sourcecode]
2) Create the Eclipse configuration, now specifying the WTP version
[sourcecode lang="shell"]
mvn eclipse:eclipse -Dwtpversion=2.0
[/sourcecode]
3) Open the Maven 2 project in Eclipse IDE, refresh the project so that changes made on the file system is reflected in the Eclipse project as well
4) Remove the library references that contains M2_REPO
Because I'm using Q4E plugin and seemed that the Maven 2 Eclipse plugin was configured for use with other plugin (Mevenide or m2clipse), they specified the M2_REPO variable and repository which you don't need when using Q4E.
Just right click on the project, select Properties - Build Path, remove the libraries that contains M2_REPO.
4) Right click on the Project, select - Maven 2 - Use Maven Dependency Management
If it's already checked, then what you need to do is to uncheck it. After that refresh the project, and then check it again.
Today I decided to mavenize the project, as now I believe that's the best way to maintain my source code base. Because the servlet is a web application, I create the maven source try.
Oh ya, by the way I'm using these:
Eclipse 3.4 (Ganymede)
Apache Maven 2.0.9
Eclipse IAM == Maven Integration for Eclipse plugin == Q4E plugin (still prefer to call it Q4E)
After creating the source tree base I created the Eclipse configuration file using the Maven's Eclipse plugin.
I just need to invoke this maven task:
[sourcecode lang="shell"]
mvn eclipse:eclipse
[/sourcecode]
Then I opened the project in Eclipse. I found my project caught a chicken pox (a part of the project got the red rashes - errors). I tried to rebuild, and got this message:
This project needs to migrate WTP metadataI knew I missed something, but it's been 2 months since last time I configured Maven 2 web application, and I have totally forgotten the exact steps to do it.
Later I realised that I need to specify the WTP version, so here's the solution:
1) Clean up the project file, run the Maven 2 Eclipse plugin clean task
[sourcecode lang="shell"]
mvn eclipse:clean
[/sourcecode]
2) Create the Eclipse configuration, now specifying the WTP version
[sourcecode lang="shell"]
mvn eclipse:eclipse -Dwtpversion=2.0
[/sourcecode]
3) Open the Maven 2 project in Eclipse IDE, refresh the project so that changes made on the file system is reflected in the Eclipse project as well
4) Remove the library references that contains M2_REPO
Because I'm using Q4E plugin and seemed that the Maven 2 Eclipse plugin was configured for use with other plugin (Mevenide or m2clipse), they specified the M2_REPO variable and repository which you don't need when using Q4E.
Just right click on the project, select Properties - Build Path, remove the libraries that contains M2_REPO.
4) Right click on the Project, select - Maven 2 - Use Maven Dependency Management
If it's already checked, then what you need to do is to uncheck it. After that refresh the project, and then check it again.
Wednesday, March 18, 2009
Hudson Build Stuck on the Build Queue
These few days we have had problem with our Hudson server. The build seems to be stuck in the build queue, there are some executors (I setup 2 executors) available though. I suspected that there are some thread starvation going on or lacking of worker thread in the application server?
We used Apache Tomcat 6.0 to run the Hudson server. We also run artifactory for local maven2 repository on the same application server.
These few days the problem could be temporarily fixed by restarting the application server. I did it several times, but seems this problem is a chronic problem that keeps recurring every 10-20 builds.
This morning I figured out something new, Hudson seems to complain that the executor was frozen (showing that both executors status is "Offline"). Then I take a look, I discovered that there is a configuration for the executor when you click on the [Build executor status] positioned on the bottom of the left menu.
From here I can see the problem clearly:
Hudson displays the name of the executor nodes (as it supports build on multiple nodes), the response time for each node, free swap space and free disk space and some other stuff.
On my machine Hudson showed a warning that the disk space is low (less than 1GB). So this is the reason why Hudson froze the executors. It prevents itself to bring down the machine buy hogging the disk space.
Then I try to find a solution for this problem. I know that on our Windows server Hudson is running as Default User on the user's home. So, there is high probability to fix this problem by moving Hudson to other user of moving this user's space to location other than C: drive.
The simplest working solution to this problem turned to be:
We used Apache Tomcat 6.0 to run the Hudson server. We also run artifactory for local maven2 repository on the same application server.
These few days the problem could be temporarily fixed by restarting the application server. I did it several times, but seems this problem is a chronic problem that keeps recurring every 10-20 builds.
This morning I figured out something new, Hudson seems to complain that the executor was frozen (showing that both executors status is "Offline"). Then I take a look, I discovered that there is a configuration for the executor when you click on the [Build executor status] positioned on the bottom of the left menu.
From here I can see the problem clearly:
Hudson displays the name of the executor nodes (as it supports build on multiple nodes), the response time for each node, free swap space and free disk space and some other stuff.
On my machine Hudson showed a warning that the disk space is low (less than 1GB). So this is the reason why Hudson froze the executors. It prevents itself to bring down the machine buy hogging the disk space.
Then I try to find a solution for this problem. I know that on our Windows server Hudson is running as Default User on the user's home. So, there is high probability to fix this problem by moving Hudson to other user of moving this user's space to location other than C: drive.
The simplest working solution to this problem turned to be:
- specifying Hudson home (other than the default $USER_HOME/.hudson) on the Apache Tomcat service configuration
- specifying Artifactory home (other than the default $USER_HOME/.artifactory) on the Apache Tomcat service configuration
- copy the content of $USER_HOME/.hudson to a new hudson home
- copy the content of $USER_HOME/.artifactory to a new artifactory home
- restart Apache Tomcat service
Labels:
build tool,
continuous integration,
hudson,
java,
maven,
tomcat
Tuesday, March 17, 2009
Cannot install WebLogic Connector on Eclipse 3.4 Ganymede...
Today I tried to install Eclipse Connector for WebLogic 10.3.
The connector component is a software component that responsible for deploy/undeploy/get status/configure the application server from within Eclipse.
I used the old way:
1) Right click on the Servers view, New - Server
2) Click "Download additional server adapters".
Eclipse will do traverse several sites to get the connectors for application servers, such as to http://www.webtide.com/eclipse for Jetty connetor, etc. Then Eclipse would display list of servers (Geronimo, Jetty Generic Server Adaptor, Oracle WebLogic Server Tools, WASCE, etc.).
3) I chose the "Oracle WebLogic Server Tools" (v1.1.0.200903091141).
4) Click the Next button
5) Choose "Accept" radio button, then click "Finish" button
Eclipse displayed: "Support for Oracle WebLogic Server Tools will now be downloaded and installed. You will be prompted to restart once the installation is complete."
6) Click "OK"
Then nothing happened. Looks like Eclipse tried to display something error dialog, but it disappeared very fast.
I have been using the previous version of WebLogic Server 10.3 Tech Preview before on Eclipse 3.3 (Europa), and it worked fine with the online server connectors/adaptors download. But for now my Eclipse 3.4 Ganymede it has problem (at least on my laptop). That time WebLogic Server was still with BEA Systems, prior to the acquisition by Oracle Corp.
I try to find it on the Net if other people also have the same problem.
Then I found out that I need this software component:
Oracle Enterprise Pack for Eclipse 1.0
You need to update from this update site for Eclipse 3.4 (Ganymede) as follows:
1) On the menu, choose: Help - Software Updates...
2) Select Available Software tab, click "Add Site" button
3) Enter this url: "http://download.oracle.com/otn_software/oepe/ganymede"
For previous version of Eclipse 3.3 (Europa) from this site:
http://download.oracle.com/otn_software/oepe/europa
4) When done adding site, check the box to the left of "Oracle Enterprise Pack for Eclipse Update Site"
5) Click "Install" button
Eclipse will display which components will be installed.
6) Select all components, then click "Next"
7) Accept the term/license
8) Click "Finish" button
9) When finished, restart Eclipse, here are the details:
After the installation it will display a dialog box asking you to participate in User Experience something program.
After that I got a warning that if I run Eclipse under JDK 6 I need to enable option in -Dsun.java.classloader.enableArraySyntax=true something in your eclipse.ini file. The installer would do it for you and ask you whether you want to restart? LOL.
Nah, now I got the WebLogic connector on my Eclipse.
The connector component is a software component that responsible for deploy/undeploy/get status/configure the application server from within Eclipse.
I used the old way:
1) Right click on the Servers view, New - Server
2) Click "Download additional server adapters".
Eclipse will do traverse several sites to get the connectors for application servers, such as to http://www.webtide.com/eclipse for Jetty connetor, etc. Then Eclipse would display list of servers (Geronimo, Jetty Generic Server Adaptor, Oracle WebLogic Server Tools, WASCE, etc.).
3) I chose the "Oracle WebLogic Server Tools" (v1.1.0.200903091141).
4) Click the Next button
5) Choose "Accept" radio button, then click "Finish" button
Eclipse displayed: "Support for Oracle WebLogic Server Tools will now be downloaded and installed. You will be prompted to restart once the installation is complete."
6) Click "OK"
Then nothing happened. Looks like Eclipse tried to display something error dialog, but it disappeared very fast.
I have been using the previous version of WebLogic Server 10.3 Tech Preview before on Eclipse 3.3 (Europa), and it worked fine with the online server connectors/adaptors download. But for now my Eclipse 3.4 Ganymede it has problem (at least on my laptop). That time WebLogic Server was still with BEA Systems, prior to the acquisition by Oracle Corp.
I try to find it on the Net if other people also have the same problem.
Then I found out that I need this software component:
Oracle Enterprise Pack for Eclipse 1.0
You need to update from this update site for Eclipse 3.4 (Ganymede) as follows:
1) On the menu, choose: Help - Software Updates...
2) Select Available Software tab, click "Add Site" button
3) Enter this url: "http://download.oracle.com/otn_software/oepe/ganymede"
For previous version of Eclipse 3.3 (Europa) from this site:
http://download.oracle.com/otn_software/oepe/europa
4) When done adding site, check the box to the left of "Oracle Enterprise Pack for Eclipse Update Site"
5) Click "Install" button
Eclipse will display which components will be installed.
6) Select all components, then click "Next"
7) Accept the term/license
8) Click "Finish" button
9) When finished, restart Eclipse, here are the details:
After the installation it will display a dialog box asking you to participate in User Experience something program.
After that I got a warning that if I run Eclipse under JDK 6 I need to enable option in -Dsun.java.classloader.enableArraySyntax=true something in your eclipse.ini file. The installer would do it for you and ask you whether you want to restart? LOL.
Nah, now I got the WebLogic connector on my Eclipse.
Monday, February 23, 2009
Batch Process in Clustered Environment
This week I have to answer some questions relating to the running of batch process in clustered environment. Our prospective client, a big corporation with the sophisticated infrastructure wants to make sure that the application to be deployed could run well in their clustered environment. Having a nice clustered server for high availability with fail over fault-tolerance is really nice. But a single point of failure in the batch process would surely spoil the fun.
It seems like they have encountered problems in the past with batch processing that could clutter the production application. That's why they need to make sure every applications to be installed are robust enough to some disturbance and provide the same level of resilience with their software components running on the JEE application servers counterpart.
When talking about clustered environment, usually we aim for high availability and fail over. The data that we are processing should be consistent and the application should not get crippled when one of those clustered machine goes down, both intentionally or unintentionally.
When talking about batch processing, the point that we are trying to achieve are:
As it is common for the batch process to be in the class of long running processes, usually it will be very expensive for them if they have to start the whole thing from the beginning again.
For example, if you have a batch process that calculate the billing for public utility company, the billing generation itself could easily take 10 hours. If after 9 hours the machine crashes, powercuts, et cetere, it would then be too expensive to restart the whole billing generation again from scratch.
In some way this kind of long running process should maintain the state at certain check points, and pick up at that certain check point and then continue.
I remember the time when we have to generate 400MB dummy data to test our system. The generation itself took more than 3 days to run (running simple SQL INSERT statements). If you put all the rows in one transaction, both commit and roll back process will take a very long time. The other way also pose the same problem. If you use auto commit and commit the rows every INSERT operation, the performance will also be very very poor.
We decided then to commit the INSERTSs every certain number of rows (we chose 10,000 rows in PostgreSQL), we sacrifice atomicity for performance. We have to maintain the state when were the last time we generate and not repeating ourself.
Same thing happens when we are running a long running batch process in a clustered deployment. We expect the component to be able to pickup where it has left in case a failure happened. We don't want the component to assume it has finished, nor we want it to restart from the beginning.
It seems like they have encountered problems in the past with batch processing that could clutter the production application. That's why they need to make sure every applications to be installed are robust enough to some disturbance and provide the same level of resilience with their software components running on the JEE application servers counterpart.
When talking about clustered environment, usually we aim for high availability and fail over. The data that we are processing should be consistent and the application should not get crippled when one of those clustered machine goes down, both intentionally or unintentionally.
When talking about batch processing, the point that we are trying to achieve are:
- restartability
- idempotence or rerunabilty
As it is common for the batch process to be in the class of long running processes, usually it will be very expensive for them if they have to start the whole thing from the beginning again.
For example, if you have a batch process that calculate the billing for public utility company, the billing generation itself could easily take 10 hours. If after 9 hours the machine crashes, powercuts, et cetere, it would then be too expensive to restart the whole billing generation again from scratch.
In some way this kind of long running process should maintain the state at certain check points, and pick up at that certain check point and then continue.
I remember the time when we have to generate 400MB dummy data to test our system. The generation itself took more than 3 days to run (running simple SQL INSERT statements). If you put all the rows in one transaction, both commit and roll back process will take a very long time. The other way also pose the same problem. If you use auto commit and commit the rows every INSERT operation, the performance will also be very very poor.
We decided then to commit the INSERTSs every certain number of rows (we chose 10,000 rows in PostgreSQL), we sacrifice atomicity for performance. We have to maintain the state when were the last time we generate and not repeating ourself.
Same thing happens when we are running a long running batch process in a clustered deployment. We expect the component to be able to pickup where it has left in case a failure happened. We don't want the component to assume it has finished, nor we want it to restart from the beginning.
Tuesday, October 21, 2008
The Long Awaited JDK 6 Update 10 has been released
Here is the link where you could download the latest JDK.
http://java.sun.com/javase/downloads/index.jsp
I have heard about this long awaited release, JDK6u10 since the time I attended the Sun Developers' Day 2008, on June this year. Joey Shen presented what's new in this version.
Though the version name seems to be only minor update to the JDK 6, actually this version contains a whole bunch of improvement.
The most notable one explained by Joey Shen is the modular approach in downloading JRE. Now the JRE could be downloaded very fast, the initial will only be download only small piece of jar. Later other components will be downloaded on demand.
Why jump straight away from update 7 to update 10?
I believe these features weren't released as JDK 7 because JDK 7 has been released to the community as OpenJDK in which Sun Microsystems doesn't have the direct control over the release. There were some long discussion on what features should be in, not mentioning also when to release. Inherent problem with community driven release of such SDK is the delay caused by strong disagreement among the community.
So I guess that Sun just put a certain number for the next version, which turned out to be update 10 while we were in the update 5 or 6 just to be safe and give some lead time to complete the job. As there are lots of full timers and experienced employees working on the version Sun Microsystems could be better drive the release of update 10. Eventually they finished long before update 8 being used, thus the number jumps from update 7 to update 10!
http://java.sun.com/javase/downloads/index.jsp
I have heard about this long awaited release, JDK6u10 since the time I attended the Sun Developers' Day 2008, on June this year. Joey Shen presented what's new in this version.
Though the version name seems to be only minor update to the JDK 6, actually this version contains a whole bunch of improvement.
The most notable one explained by Joey Shen is the modular approach in downloading JRE. Now the JRE could be downloaded very fast, the initial will only be download only small piece of jar. Later other components will be downloaded on demand.
Why jump straight away from update 7 to update 10?
I believe these features weren't released as JDK 7 because JDK 7 has been released to the community as OpenJDK in which Sun Microsystems doesn't have the direct control over the release. There were some long discussion on what features should be in, not mentioning also when to release. Inherent problem with community driven release of such SDK is the delay caused by strong disagreement among the community.
So I guess that Sun just put a certain number for the next version, which turned out to be update 10 while we were in the update 5 or 6 just to be safe and give some lead time to complete the job. As there are lots of full timers and experienced employees working on the version Sun Microsystems could be better drive the release of update 10. Eventually they finished long before update 8 being used, thus the number jumps from update 7 to update 10!
Tuesday, September 30, 2008
Using HTTP-based Subversion Repository for Local Maven 2 Repository
Maven 2 repository could be exposed to public using several protocols. The protocol will be reflected by how we access the repository. The popular ones are HTTP, HTTPS, Subversion, and of course direct file system access which should be reflected by URIs:
Here is how we do it.
- http://repo1.maven.org/maven2
- https://localmaven.jugi.or.id
- svn://kutukupret
- file:///opt/maven2/repo
Subversion which is a source code management (SCM) software could also be exposed to public through HTTP/HTTPS protocol.
Because most developers should have at least read only access to the source code base of the SCM software, any SCM software that is exposed through HTTP/HTTPS protocol could be easily tuned to be Maven 2 local repository as well. I will show the way to use SCM as Maven 2 repository using Subversion but the principles will apply to any HTTP/HTTPS based SCMs.
Here is how we do it.
When you look to Maven 2 repositories such as http://repo1.maven.org/maven2, the structure is quite simple.
We need to break down this URL into these fields:
- artifactId: openjpa
- groupId: org.apache.openjpa
- version: 1.2.0
- Maven 2 repository root URL: http://repo1.maven.org/maven2/
Subscribe to:
Posts (Atom)