tag:blogger.com,1999:blog-364029982024-03-13T15:36:40.717+01:00Programming Notes and Examples[Java EE, ME, Glassfish, Design, Hibernate, Wildfly etc]Giuseppe Morrealehttp://www.blogger.com/profile/00118046399246659732noreply@blogger.comBlogger80125tag:blogger.com,1999:blog-36402998.post-57576341272972324282014-11-19T17:01:00.000+01:002014-11-19T17:01:38.878+01:00NCDU - How to detect larger directory in linuxIf you want search for big files, or big directory..
If you want to do maintenance for you free space,
You have to install NCDU.
I try it! It is wonderful..
It works with a intuitive text gui.
I install it by using
yum install ncdu
and launch by command ncdu after installing.Giuseppe Morrealehttp://www.blogger.com/profile/00118046399246659732noreply@blogger.com1tag:blogger.com,1999:blog-36402998.post-39864086646296004012014-10-07T12:00:00.000+02:002014-10-07T12:00:00.862+02:00Http Url and Wildfly HeartBeat For my projects I need a script that check for http response correctly with 200 or 301 and then check for wildfly process status.
So I write the following script.
The script write in a log file the various steps.
The mail dir is a directory where other daemon check for new file and send it to mail..
The lock files avoid to write too many file on mail dir in case of heart down. It rewrite theGiuseppe Morrealehttp://www.blogger.com/profile/00118046399246659732noreply@blogger.com0tag:blogger.com,1999:blog-36402998.post-89037476636673157222014-10-06T10:33:00.001+02:002014-10-06T10:33:40.426+02:00SSH won't Work - expecting SSH2_MSG_KEX_DH_GEX_GROUPShort Post for a little-big Problem.
If your firewall is open for ssh, telnet on ssh port works but ssh won't work.
Try to debug the ssh connection by using verbose debug
ssh -v user@yourip
if ssh hangs on
"expecting SSH2_MSG_KEX_DH_GEX_GROUP"
and then ssh returns with the following error: "Read from socket failed: Operation timed out"
Probably you have an MTU/fragmentation problem and Giuseppe Morrealehttp://www.blogger.com/profile/00118046399246659732noreply@blogger.com0tag:blogger.com,1999:blog-36402998.post-5239122385773044472014-09-15T16:16:00.000+02:002014-11-05T18:10:35.614+01:00Wildfly SSL Client Authentication
In order to ask for a client ssl authentication you have to setup standalone.xml, web.xml and jboss-web.xml in different section.
1) First of all say to UNDERTOW -> https listener that ssl authentication could occurs
<subsystem xmlns="urn:jboss:domain:undertow:1.1">
<buffer-cache name="default"/>
&Giuseppe Morrealehttp://www.blogger.com/profile/00118046399246659732noreply@blogger.com2tag:blogger.com,1999:blog-36402998.post-84840975858331810262014-09-14T15:53:00.000+02:002014-09-14T15:53:00.691+02:00Wildfly Deploy on different server and host
If you setup different <server> in undertow subsystem and each <server> has its own virtual host then when deploy a war you have to setup the jboss-web.xml correctly
<jboss-web>
<server-instance>default-server_secondary</server-instance> <!-- does mapping to server -->
<virtual-host>server.mydomain.com</Giuseppe Morrealehttp://www.blogger.com/profile/00118046399246659732noreply@blogger.com0tag:blogger.com,1999:blog-36402998.post-7310438841627845002014-09-13T15:49:00.000+02:002014-09-11T15:50:27.375+02:00Wildfly Multiple IP and Multiple SSL Certificate
Wildfly can manage different ip in the same standalone server.
The final target is two manage different ssl certificate for each ip.
Due to ssl handshake limitation each hostname needs to be associate with different ip
For example
https://localhost:8181 send certificate1
https://192.168.1.3:8181 send certificate 2
But first start to setup the new ip interface
<interfaces>
Giuseppe Morrealehttp://www.blogger.com/profile/00118046399246659732noreply@blogger.com1tag:blogger.com,1999:blog-36402998.post-44092200407357395542014-09-12T15:40:00.000+02:002014-09-11T15:49:57.415+02:00Wildfly Virtual Host Setup
Follow the next standalone.xml setup in order to configure more domain (i.e testfoo.com, localhost).
You have to add in undertow subsystem other <host ..> tag (see the green code)
<subsystem xmlns="urn:jboss:domain:undertow:1.1">
<buffer-cache name="default"/>
&Giuseppe Morrealehttp://www.blogger.com/profile/00118046399246659732noreply@blogger.com0tag:blogger.com,1999:blog-36402998.post-24619459633763575762014-09-11T15:17:00.000+02:002014-09-11T15:19:38.935+02:00From Glassfish to Wildfly - Mail & Realms - part 4
Mail Resource
Configuring WildFly to send emails with JavaMail is also slightly different from GlassFish. Every inbound and outbound communication through TCP/IP should be declared in the socket binding group. Since SMTP uses TCP/IP to communicate, then we have to create an Outbound Socket Binding for that. To proceed:
In the admin console, go to Profile > General Configuration > Giuseppe Morrealehttp://www.blogger.com/profile/00118046399246659732noreply@blogger.com1tag:blogger.com,1999:blog-36402998.post-22675104172989645402014-09-11T15:12:00.000+02:002014-09-11T15:36:12.081+02:00Widlfly Access Log
In order to enable the access log in a virutal host simply add tag in host standalone.xml configuration
example:
<host name="default-host" alias="localhost">
<location name="/" handler="welcome-content"/>
<access-log pattern="common" directory="${jboss.server.log.dir}" prefix="access"/>
<filter-ref name="server-header"/>
Giuseppe Morrealehttp://www.blogger.com/profile/00118046399246659732noreply@blogger.com0tag:blogger.com,1999:blog-36402998.post-68288252716973387762014-09-05T11:04:00.000+02:002014-09-11T15:14:24.347+02:00From Glassfish to Wildfly - HTTPS - part 5
How to make working https in widfly
Make a keystore with keytool and put it inside standalone/configuration
Take a note for keystore and certificate password.
Make a realm in standalone.xml in security-realms section
Example
<security-realm name="MySecurityRealm">
<Giuseppe Morrealehttp://www.blogger.com/profile/00118046399246659732noreply@blogger.com0tag:blogger.com,1999:blog-36402998.post-4828556446215921702014-06-24T14:42:00.000+02:002014-09-11T11:44:25.343+02:00From Glassfish to Wildfly - Shared lib dir - part 3
Shared lib dir in Wildfly
In glassifsh I was using a domains/domain1/lib/ directory as shared directory where to put all jars needed by all applications (ear, war, jar)
When install wildfly sure you will search for similiar directory..
Nope..
Wildfly hasn't a shared lib directory, but are using a module concept and other classloading system.
You can install module, global module or Giuseppe Morrealehttp://www.blogger.com/profile/00118046399246659732noreply@blogger.com0tag:blogger.com,1999:blog-36402998.post-41575088263736178942014-06-24T14:27:00.002+02:002014-09-11T11:44:25.340+02:00From Glassfish to Wildfly - Autodeploy directory - part 2In glassfish you have /autodeploy directory where to put ear, war and jar in order to auto deploy it in application server.
In Wildfly there is also autodeploy dir.. /opt/wildfly/standalone/deployments/
When you put an application in the directory deployment scanner start and deploy automatically the application.
I notice that deployment scanner stop to works when a large file is upload to Giuseppe Morrealehttp://www.blogger.com/profile/00118046399246659732noreply@blogger.com0tag:blogger.com,1999:blog-36402998.post-62258951036026836302014-06-23T17:14:00.000+02:002014-09-11T11:44:25.346+02:00From Glassfish to Wildfly - part 1
How to install wildfly on linux?
Simply by download and launching the following wonderful script:
https://gist.github.com/sukharevd/6087988
Wildfly is installed in /opt/wildfly
You can launch Wildfly by using /etc/init.d/wildfly start
Open Port and Remote Access
Find and launch add-users.sh in order to add user for management realm.
It is necessary for web console admin.
Find and edit Giuseppe Morrealehttp://www.blogger.com/profile/00118046399246659732noreply@blogger.com0tag:blogger.com,1999:blog-36402998.post-34770542742010261912012-08-02T18:35:00.004+02:002013-02-26T15:32:36.641+01:00Visure Easy - Direttamente sul tuo smartphoneOnline il nuovo sito per il reperimento semplice e veloce delle visure direttamente sul tuo cellulare!
Attraverso il browser del tuo smartphone potrai richiedere, pagare e scaricare la tua Visura!!
Visure Easy MobileGiuseppe Morrealehttp://www.blogger.com/profile/00118046399246659732noreply@blogger.com0tag:blogger.com,1999:blog-36402998.post-16608693819912342392011-04-15T13:15:00.003+02:002011-04-15T13:15:48.544+02:00Xcode 4 Tip: Automatically make IBOutlet, property, dealloc andXcode 4 Tip: Automatically make IBOutlet, property, dealloc and synthesize!G.MorrealeProblem:Are you bored to write always the same line of code in order to make an IBOutlet, property, synthesize, dealloc and then connect it to the gui in the interface builder?Solution:1) Open Xcode 42) Open the xib file3) Split the view so you can see the gui and the header file by clicking in the top on Giuseppe Morrealehttp://www.blogger.com/profile/00118046399246659732noreply@blogger.com0tag:blogger.com,1999:blog-36402998.post-21787114914398255962011-04-15T13:15:00.001+02:002011-04-15T13:15:38.979+02:00Xcode 4 Tip: Automatically make IBOutlet, property, dealloc andXcode 4 Tip: Automatically make IBOutlet, property, dealloc and synthesize!G.MorrealeProblem:Are you bored to write always the same line of code in order to make an IBOutlet, property, synthesize, dealloc and then connect it to the gui in the interface builder?Solution:1) Open Xcode 42) Open the xib file3) Split the view so you can see the gui and the header file by clicking in the top on Giuseppe Morrealehttp://www.blogger.com/profile/00118046399246659732noreply@blogger.com0tag:blogger.com,1999:blog-36402998.post-1885206556635804792011-04-15T13:08:00.001+02:002011-04-15T13:08:17.167+02:00Mac Os eject cd dvd problemMac Os Eject cd/dvd ProblemG.MorrealeProblem:Your cd/dvd drive can't eject the cd, by keyboard input?The finder can't show your cd/dvd drive?Solution:1) Open Terminal2) Type drutil tray ejectGiuseppe Morrealehttp://www.blogger.com/profile/00118046399246659732noreply@blogger.com0tag:blogger.com,1999:blog-36402998.post-3798747847522824542010-01-29T16:42:00.001+01:002010-01-29T16:42:50.539+01:00From Java To Objective-C: StringFrom Java To Objective C: StringsMy Notes (part 2)
This is a very short introduction from my notes.A good and complete starting point can be found by google.
The String.In java we have String Class that represent a string, in objective C there is a NSString object.Each string constant double quote in objective-c must be prefixed by @Also in objective C, NSString is immutable like java String..Giuseppe Morrealehttp://www.blogger.com/profile/00118046399246659732noreply@blogger.com12tag:blogger.com,1999:blog-36402998.post-23021452881215407672010-01-29T16:21:00.001+01:002010-01-29T16:26:23.837+01:00From Java To Objective-CFrom Java To Objective C My Notes (part 1)
This is a very short introduction from my notes.A good and complete starting point can be found by google.
I'm a java developer and when I'm going to learn objective-c for the iphone development the matching between the 2 languages became automatic.
Objective C is standard ansi C with object oriented extension.
So many OO arguments found in java Giuseppe Morrealehttp://www.blogger.com/profile/00118046399246659732noreply@blogger.com0tag:blogger.com,1999:blog-36402998.post-6860354080711981442009-11-02T10:30:00.001+01:002009-11-04T09:41:10.513+01:00Flex AS3 Webservice Proxy and Object BindingFlex AS3 Webservice Proxy and Object BindingIntroductionIn the previous article we see how a flex as3 can call webservice simply by using the Webservice class.Let's see about webservice resultformat and data binding.The Webservice Client Result Format in AS3The webservice client result format can be "Object, xml, or e4x".The Object(default resultFormat) return data in form of ObjectProxy. Giuseppe Morrealehttp://www.blogger.com/profile/00118046399246659732noreply@blogger.com1tag:blogger.com,1999:blog-36402998.post-27039606665296980672009-10-27T14:07:00.001+01:002009-10-28T15:05:27.879+01:00Java Hello WorldJava Hello World
G.Morreale
Introduzione:
The simplest programming language example!//define a class HelloWorld public class HelloWorld { //define a public static method in the class that make an entry point for the application. //It takes an array of String parameter public static void main(String[] args) Giuseppe Morrealehttp://www.blogger.com/profile/00118046399246659732noreply@blogger.com0tag:blogger.com,1999:blog-36402998.post-84702737724586971752009-10-26T10:04:00.001+01:002009-10-28T15:05:57.221+01:00Maintaining state in Java Webservice(JAX-WS)Maintaining state in Java Webservice(JAX-WS)IntroductionThis little article start point is the need of get the current session from a flash swf.I try to explain: The web application has a login form and after the user is authenticated a session is created and mantained, so the need is to access to this value into the session from flash that calls a webservice in the same Giuseppe Morrealehttp://www.blogger.com/profile/00118046399246659732noreply@blogger.com0tag:blogger.com,1999:blog-36402998.post-48807761184649617322009-10-19T14:00:00.001+02:002009-10-28T15:05:46.765+01:00Flex AS3 call a Java WebserviceFlex AS3 call a Java WebserviceIntroductionWebservice is a standard in soa architecture.Flex is a leading tecnology for client side so let's see how actionscript 3(the flex programming language) can call a java(jax-ws) webservice.Starting PointThe main step are:Make a WebProject with a WebserviceMake a MXML in flex side and code the callThe webservice:Two click with netbeans header and you can Giuseppe Morrealehttp://www.blogger.com/profile/00118046399246659732noreply@blogger.com0tag:blogger.com,1999:blog-36402998.post-19994954105413241332009-10-19T11:53:00.001+02:002009-10-19T12:46:23.011+02:00Java and BlazeDS by ExampleThe interaction between Java and Flash(part 3 - BlazeDS)BlazeDS - IntroductionLet's see how to make a simple example in order to get in communication a java server side(with blazeDS) and action script 3 client side inside Flash CS3 (No Flex!!)ExampleServer Side:Download the BlazeDS binary distribuitionhttp://opensource.adobe.com/wiki/display/blazeds/BlazeDS/The BlazeDS binary distribuition is a Giuseppe Morrealehttp://www.blogger.com/profile/00118046399246659732noreply@blogger.com2tag:blogger.com,1999:blog-36402998.post-6320159233881606532009-10-19T10:51:00.001+02:002009-10-19T12:46:23.011+02:00Make GUI with Flash and code by Flex!Flex and Flash CS3: How they works togetherIntroductionIn some previous article, I'd searched for a java ee to flash communications framework.Webservice as3 library disappears in the third version of action script after as2.Xml parsing and unmarshalling is too coding expensive.AMF works but by java side I can only with OpenAMF that supports the old AMF0 version.When I'm search for this solution Giuseppe Morrealehttp://www.blogger.com/profile/00118046399246659732noreply@blogger.com0