Search
Calendar
April 2024
S M T W T F S
« Sep    
 123456
78910111213
14151617181920
21222324252627
282930  
Your widget title
Archives

Archive for the ‘long tweets’ Category

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 (long tweet) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘type=InnoDB’ at line 1

Stacktrace

org.hibernate.tool.hbm2ddl.SchemaExport - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'type=InnoDB' at line 1

Quick fix

In JPA configuration, replace:
datasource.dialect = org.hibernate.dialect.MySQLInnoDBDialect
with:
datasource.dialect = org.hibernate.dialect.MySQL5InnoDBDialect
Actually, Java driver for MySQL 5.5+ is not backward compatible with the SQL dialect MySQLInnoDBDialect.

PostHeaderIcon (long tweet) Run MS-DOS command as super user

How to run a MS-DOS command terminal with administrator priviledges, in Windows 7?
Let’s say you need execute cmd with the account admin: launch runas /user:admin cmd.
Windows will ask you to enter the admin password and then will open a CMD prompt in admin mode.

PostHeaderIcon (long tweet) Glassfish / Unsupported major.minor version 51.0

Case

On launching Glassfish 4 under Windows, I got the following error:

asadmin.bat start-domain
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/glassfish/admin/cli/AsadminMain : Unsupported major.minor version 51.0

Quickfix

Glassfish 4 is JEE6-compatible, therefore run Glassfish 4 with JRE 7 instead of JRE 6.

As a reminder, here is the list of majors/minor versions:

J2SE 8 = 52,
J2SE 7 = 51,
J2SE 6.0 = 50,
J2SE 5.0 = 49,
JDK 1.4 = 48,
JDK 1.3 = 47,
JDK 1.2 = 46,
JDK 1.1 = 45