Search
Calendar
juillet 2014
L Ma Me J V S D
« mai    
 123456
78910111213
14151617181920
21222324252627
28293031  
Share!
Archives

PostHeaderIcon (long tweet) How to display / modify Oracle XDB port?

Oracle XDB port runs by default on port 8080… which is quite an issue for Java web developpers, because of the collision with default port used by servlet engines such as Tomcat and Jetty.

To display Oracle XDB port, run:

select  DBMS_XDB.GETHTTPPORT from dual;

To change it (for instance to set it on port 9090), run

exec DBMS_XDB.SETHTTPPORT(9090);

PostHeaderIcon (long tweet) Could not find backup for factory javax.faces.context.FacesContextFactory.

Case

On deploying a JSF 2.2 / Primefaces 5 application on Jetty 9, I got the following error:

java.lang.IllegalStateException: Could not find backup for factory javax.faces.context.FacesContextFactory.

The issue seems linked to Jetty, since I could not reproduce the issue on Tomcat 8.

Quickfix

In the web.xml, add the following block:

    <listener>
        <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
    </listener>

PostHeaderIcon MultiException[java.lang.RuntimeException: Error scanning file]

Case

I run a project with JSF 2 / PrimeFaces 5 (BTW: it rocks!) / Spring 4 / Jetty 9 / Java 8:

MultiException java.lang.RuntimeException: Error scanning file SummerBean.class, java.lang.RuntimeException: Error scanning entry .../SummerService.class from jar file:/.../spring-tier-1.0-SNAPSHOT.jar, java.lang.RuntimeException: Error scanning entry .../SummerServiceImpl.class from jar file:/.../spring-tier-1.0-SNAPSHOT.jar
        at org.eclipse.jetty.annotations.AnnotationConfiguration.scanForAnnotations(AnnotationConfiguration.java:530)

Explanation

The error occurs because of a conflict on the JARs of ASM.

Fix

You have to override Jetty’s dependencies to ASM.
In Maven’s POM, amend Jetty plugin to force ASM versions:

<plugin>
   <groupId>org.eclipse.jetty</groupId>
   <artifactId>jetty-maven-plugin</artifactId>
   <version>${jetty.version}</version>
   <dependencies>
      <dependency>
         <groupId>org.ow2.asm</groupId>
         <artifactId>asm</artifactId>
         <version>5.0.2</version>
         </dependency>
         <dependency>
         <groupId>org.ow2.asm</groupId>
         <artifactId>asm-commons</artifactId>
         <version>5.0.2</version>
         </dependency>
      </dependencies>
<!-- ... -->
</plugin>

Then it should work ;-)

PostHeaderIcon SizeLimitExceededException: the request was rejected because its size (…) exceeds the configured maximum

Stacktrace

On deploying a WAR in Tomcat:

org.apache.tomcat.util.http.fileupload.FileUploadBase$SizeLimitExceededException: the request was rejected because its size (128938160) exceeds the configured maximum (52428800)

Quick fix

Edit the file $CATALINA_HOME/webapps/manager/WEB-INF/web.xml
Replace the block

  <multipart-config>
       <!-- 50MB max -->
        <max-file-size>52428800</max-file-size>
       <max-request-size>52428800</max-request-size>
        <file-size-threshold>0</file-size-threshold>
      </multipart-config>      

with:

  <multipart-config>
       <!-- 200 MB max -->
        <max-file-size>209715200</max-file-size>
       <max-request-size>209715200</max-request-size>
        <file-size-threshold>0</file-size-threshold>
      </multipart-config>
       

PostHeaderIcon Mount a shared drive with VirtualBox

Case

You have to share some content between the host (eg: Linux Mint) and the resident (eg: Windows 7) systems, with Virtual Box.

Solution

  • In the resident system, go to Virtual Box, then: Machine >Settings > Shared Folders > on the right:Add > check automount and permanent, browse to the folder, let’s say D:\sharedFolder
  • Launch the VM.
  • Execute a terminal in host system:
  • Grant rights of group vboxsf to user mint:

sudo gpasswd -a mint vboxsf

  • Create a « local » folder:

mkdir ~/sharedFolder

  • Mount the folder sharedFolder on /home/ :

sudo mount -t vboxsf -o uid=1000,gid=1000 sharedFolder ~/sharedFolder