Mot-clé - javaEE

Fil des billets - Fil des commentaires

NetBeans

Apache NetBeans est l'environnement de développement Java initialement proposé par Sun, puis racheté par Oracle et finalement cédé à la fondation Apache.

Il s’agit du concurrent direct d'Eclipse sur le marché des environnements Open Source, mais il semble être passé au second plan...

Lire la suite

SQL "matching found rows" vs "affected rows"

Lors de modifications (UPDATE, DELETE) comment différencier le nombre d'enregistrement qui matche au critère WHERE et le nombre d'enregistrement réellement modifiés par la requête ?

  • "found (matched) rows" le nombre d'enregistrements trouvés (potentiellement modifiable)
  • "affected (changed) rows" le nombre d'enregistrements véritablement changés parmi les trouvés

Lire la suite

MariaDB Connector/Java You need to set exactly 1 parameters on the prepared statement

Exception in thread "main" java.sql.SQLException: You need to set exactly 1 parameters on the prepared statement
Query is : INSERT INTO my_table (my_col) VALUES ('m_val')null;
Caused by: org.mariadb.jdbc.internal.util.dao.QueryException: You need to set exactly 1 parameters on the prepared statement
Query is : INSERT INTO my_table (my_col) VALUES ('m_val')null;

Lire la suite

JBoss6 serve external file static content docBase vhost

There are no more "virtual directories" in JBoss 6. Apparently this went out with JBoss 5. The only availables options or solutions I've found are :

  • Way 1 : using 2 war, one for your project, one other to publish static files (under another
  • Way 2 : symlink (to a simple file system or on a war folder with inside a blank /WEB-INF)

Using ExternalDirectories doesn't work with JBoss 6

<Host name="localhost" ...>
        <!-- ADD static images DIRECTORY -->
        <Context path="/images" 
                docBase="/home/myuser/images"
                reloadable="true">
        </Context>
        <!-- The rest of your Host entity -->
</Host>

This Context deployement result :

ERROR [AbstractKernelController] Error installing to Start: name=WebServer state=Create: org.jboss.xb.binding.JBossXBException: Failed to parse source: xml_stream@163,112

Caused by: org.jboss.xb.binding.JBossXBRuntimeException: DefaultContext not found as a child of Host in unordered_sequence: Listener* Valve* Alias* Realm? attributes?

Caused by: org.jboss.xb.binding.JBossXBRuntimeException: Context not found as a child of Host in unordered_sequence: Listener* Valve* Alias* Realm? attributes?

Caused by: org.jboss.xb.binding.JBossXBRuntimeException: Context not found as a child of Context in unordered_sequence: Valve* Parameters* Loader? Overlay* InstanceListener* WrapperListener* Listener* SessionCookie? WrapperLifecycle* Manager? Realm? attributes? Resources?

DEPLOYMENTS IN ERROR:
 Deployment "WebServer" is in error due to the following reason(s): **ERROR**, org.jboss.xb.binding.JBossXBRuntimeException: DefaultContext not found as a child of Host in unordered_sequence: Listener* Valve* Alias* Realm? attributes?
 Deployment "jboss.web:service=WebServer" is in error due to the following reason(s): ** NOT FOUND Depends on 'jboss.web:service=WebServer' **

Lire la suite