Search
Calendar
May 2025
S M T W T F S
« Apr    
 123
45678910
11121314151617
18192021222324
25262728293031
Archives

Posts Tagged ‘JBoss’

PostHeaderIcon Cannot run this command because Java services are not enabled. A user with System Administrator (SA) role must reconfigure the system to enable Java.

Context

An object is marshallized and sent on TibcoRV 8.1. An instance of Mule ESB 2.2.1 listens to TibcoRV, reads the message, unmarshalls the object and builds an SQL insert query.

The query is very simple:

insert into myTable(dateColumn, stringColumn) values(...)

It is executed in a Jdbc connector declared on Mule configuration file:

    <jdbc:connector name="jdbcConnector" dataSource-ref="mySybaseDB" pollingFrequency="1000">
        <jdbc:query key="writeTest"
                    value="INSERT INTO myTable(dateColumn, stringColumn)
                              VALUES(#[map-payload:myJavaDate],#[map-payload:myJavaString])"/>
    </jdbc:connector>

The DB is Sybase. The first column is of type datetime, the second one is varchar. The values are retrieved from a java.util.Date and a java.lang.String.

Case

When the query is run, I get the error:

java.sql.SQLException: Cannot run this command because Java services are not enabled. A user with System Administrator (SA) role must reconfigure the system to enable Java.

(you may get a com.sybase.jdbc2.jdbc.SybSQLException instead of java.sql.SQLException)

Explanation – Fix

The error is related only to Sybase, and not to TibcoRV and Mule: by default, Sybase cannot manage Java Dates (java.util.Date). You have to start explicitly the Java services. To perform that:

  • login with an username owing the rights “sa_role
  • run the SQL query:
    sp_configure 'enable java', 1
  • the restart the Sybase server

Now it should work. A similar error may occur with JBoss.