Skip to main content

Posts

Showing posts from 2011

*.out.xml file error

When you run an Android application, you may get error "Error in an XML file" with a strange *.out.xml file. Why does this cause? If a xml file on your IDE (probably Eclipse) was  selected when you run your app, this error can happen. What is the solution? Just remove the *.out.xml and select the project not xml file. And then run again.

[JBOSS]Installation and running

JBoss is an Application Server, which is support fully JEE (known as formally J2EE) specifications. It support EJB2/3, JSP/Servlet, JMS, JSF and other Java Enterprise Environment technologies. Other Application servers are WebLogic(Oracle), WebSphere(IBM), GlassFish(Oracel) and so on. At this time I am writing, you can download JBOSS stable version and latest versions from the following site: http://www.jboss.org/jbossas/downloads http://sourceforge.net/projects/jboss/files/JBoss/JBoss-6.0.0.Final (Direct link from SourceForge) I downloaded JBoss 6.0.0 Final (stable version). Latest version 7.0.0.Beta3 at the moment. And then upzip the downloaded file under c drive(Any folder you want) and then you will get the C:\jboss-6.0.0.Final directory. You can see several folders under it. Web root directory is install_dir /server/default and you can find install_dir /server/default/ROOT.war. When you goto http://localhost:8080 , JBoos will display install_dir /server/default/ROOT.war/inde

[JSF] Changes of source code in JSF in Action

JSF in Action I got this book 3 years years ago and I am reviewing these days. In this book, old version of JSF is used. (I can't find the exact version is using in the book)  During the time, something has changed. So, when I tried to execute sample Project Track project in the book, it caused errors. I was struggling the errors and searched API to soleve them. Finally I could see inbox page after I fixed some code. Origianally, the source code in login() method in AuthenticationBean was like following: Visit visit = new Visit(); visit.setUser(newUser); visit.setAuthenticationBean(this); setVisit(visit); //Constants.VISIT_KEY_SCOPE => sessionScope. //Constants.VISIT_KEY => visit getApplication().createValueBinding("#{" + Constants.VISIT_KEY_SCOPE +          Constants.VISIT_KEY + "}").setValue(facesContext, visit); The createValueBinding() method comes from Java EE API and it is deprecated now. Refferring Java EE API,  it is recommended to ca

[JDBC] java.lang.ClassNotFoundException:com.mysql.jdbc.Driver

Recently, I downloaed JDBC driver for MySQL to test a JSF page. The downloaded file was mysql-connector-java-5.1.16.zip and I put it into WEB-INF/lib directory. I set the class path including the file. When I compiled my code, the Eclipse console was complaining "java.lang.ClassNotFoundException:com.mysql.jdbc.Driver" vomitting many lines of red messages. What's wrong? I already added the JDBC connector and set the class path correctly. So I opened then dowloaded file by an unzip untility and there was no .class file but .java. I got a .jar file and put it into lib folder and executed my code... then it worked well. I felt like that I was cheated by Oracle. (Because MySQL was merged by Oracle.) In addition, you can download JDBC file for MySQL with .jar format from the following site: http://www.jarfinder.com/index.php/java/info/com.mysql.jdbc.Driver

[TOMCAT]How to set external path to app root

Testing environment is following: Windows XP Professional ServicePack 2 Tomcat 6.0.32 Java 6.0 (JDK 1.6.0.24) Directory Structure of Tomcat (Version 6.x above) I wanted my tomcat project to be located in different directory from sub of webapp folder. Above Tomcat 6, Tomcat has a config fiile for the application. See the Tomcat_Installed_Dir\conf\Catalina\Host_Name (ex. c:\tomcat\Catalina\localhost) directory and then you can find configuraion files XMF format. If the application name is "faces" then tomcat directories will look like following: tomcat_installed_dir   - bin   - conf      - Catalina         - localhost            - faces.xml   - logs   - temp   - webapps      - faces         - WEB-INF            - classes            - lib      - ROOT     - work Configuration XML file for application context Create tomcat_installed_dir/conf/Catalina/localhost/faces.xml (same name with application) and edit the file like following. The docBase attribute m