martedì 5 settembre 2017

You drive me crazy!! JBAS018037 ... zip file is empty

I don't know if you ever seen this kind of awful message during your deployment on JBoss via Eclipse

"Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS018037: Failed to process WEB-INF/lib/FIRSTAPP.jar
Caused by: java.util.zip.ZipException: error in opening zip file" 


If your answer is "Oh, yes I hope you may help me!" you have a chance.
Once upon a time, I had a need to include the FIRSTAPP web application as jar within my SECONDAPP  web application.
So after two sleepless googling days, I took a look at properties of my SECONDAPP  project and I discovered the "Resolved dependencies from Workspace projects" property ticked (it means that Eclipse during deployment phase is going to take FIRSTAPP.jar not from Maven dependency but directly from the the FIRSTAPP project).
You should just untick this property and everything will go easy.

Finally everything was quite and the sun shone bright.







venerdì 20 maggio 2016

Configurazione MySQL replication per n-Master ed 1-Slave (MultiMaster) su Windows


Sarà capitato a tutti (beh forse solo ad un piccolo gruppo di NERD alla ricerca disperata di una soluzione) di voler configurare una replica di più database MySQL sparsi per il mondo all'interno di un unico db centralizzato.
E bene, da MySQL 5.7 in poi, questa soluzione esiste e con pochi semplici passaggi.
Ecco come:


  • Configurazione tipica del Master (che potete trovare qui)  ed, inoltre, suggerirei di specificare il o i nomi dei db da replicare con il comando:
                                               binlog_do_db = dbdareplicare
  • Configurazione dello Slave settando le coordinate del Master (che potete trovare qui) cui dovete necessariamente aggiungere la configurazione della gestione delle info su tabella settando le variabili nel my.ini:


                                                master-info-repository=TABLE
                                             relay-log-info-repository=TABLE
  • Infine dovrete digitare i seguenti comandi per il CHANGE MASTER TO
mysql> change master to MASTER_HOST = '10.10.10.2',
    -> MASTER_USER = 'username_per_la_replica',
    -> MASTER_PASSWORD = 'psw_per_la_replica',
    -> MASTER_LOG_FILE = 'NOME_PRESO_DALLE_COORDINATE-bin.000001',
    -> MASTER_LOG_POS = NUMERO_PRESO_DALLE_COORDINATE
    -> FOR CHANNEL 'nome_inventato_univoco';

  • Enjoy yourself!!!