Friday, May 29, 2015

To configure mime-mappings in WebLogic, you have 2 ways.
One is to configure the whole domain, with a mimemappings.properties file.
This is the entry in config.xml (you can do it in console, domain, webapplications):

Mime Mapping File
Returns the name of the file containing mime-mappings for the domain.
Format of the file should be: extension=mime-type
Example:
htm=text/html
gif=image/gif
jpg=image/jpeg
If this file does not exist, WebLogic Server uses an implicit mime-mapping set of mappings defined in weblogic.utils.http.HttpConstants (DEFAULT_MIME_MAPPINGS). To remove a mapping defined in implicit map just set it to blank.
MBean Attribute:
WebAppContainerMBean.MimeMappingFile

Sunday, May 24, 2015

Don't expect a highly entertaining narrative in this book, it's simply a collection of examples illustrating the most important features of Netbeans 8 to build various kind of JEE applications, including Rest services, JMS messaging and JSF webapps. However it's kind of useful.

Saturday, May 23, 2015

I thought it was fun to hear the designer of so many different languages discuss on what is important in a language, and which rules to follow when designing a language and when writing an application.

Few of them seemed really to have clear ideas about language design.... and most statements contradict each others...so still in 2015 we don't have a clear, commonly agreed, scientific approach to language design...

Monday, May 18, 2015

When a weblogic server is hit by an OutOfMemory condition, it often agonizes for a while before finally collapsing. This is not very healthy for the poor beast, and for humanitarian reasons you might want to end its suffering sooner.

Monday, May 11, 2015

If you see a "java.security.cert.CertificateException: no trust anchor defined", most likely it means that someone has messed up the Certificate, for instance replacing a trusted CA certificate with a Self-Signed certificate.

you can use "openssl s_client -debug -connect yourhost:yourport" and check for the dreaded "verify error:num=18:self signed certificate"

Wednesday, May 6, 2015

I have recently applied for a job in Toptal - just to keep be busy on weekends, after my regular bicycle rides - and they asked me to build a small Web Application.
jQuery seemed a bit outdated, so I have decided to learn Angular 2
Here a useful presentation (just skip the first 10 minutes.... why people can't simply go straight to the point....)
http://www.infoq.com/presentations/angularjs-2
and the next thing you probably want to do is to go through the tutorial https://angular.io/docs/js/latest/quickstart.html

I know there are other products (Ember, React) but I don't have the time to examine them all.
This one is very good, about HTML5 and Angular 1:

This contains a really cool, simple example you can easily code yourself:

This one attempts to explain you the concepts, there are good things but I find it very very verbose:

(I might take the whole 7 hours course, it's only 19 USD)

Then this one is really good to show all the bits and pieces who put together form the AngularJS framework

Tuesday, May 5, 2015

a customer was complaining today about his stdour/stderr file being flooded by the message "OpenJPA will not be used".

The link above explains very well the story. The only issue is that not always it's advisable to redirect the stderr to the weblogic log file (I like very much the idea, but if already some monitoring mechanism is in place, it has to be adjusted)

Anyway in the config.xml you should have

for the domain:

<log-filter>
<name>OpenJPA</name>
<filter-expression>NOT(MESSAGE LIKE '%OpenJPA will not be used%')</filter-expression>
</log-filter>

See http://docs.oracle.com/cd/E24329_01/web.1211/e24972/using_toplink.htm#EJBAD1415 , possibly the application is setting the provider in the code : "Specify the provider in the javax.persistence.provider property passed to the Map parameter of the javax.persistence.Persistence.createEntityManagerFactory(String, Map) method."

Stateful interactions through hyperlinks. Every interaction with a resource is stateless; that is, request messages are self-contained. Stateful interactions are based on the concept of explicit state transfer. Several techniques exist to exchange state, such as URI rewriting, cookies, and hidden form fields. State can be embedded in response messages to point to valid future states of the interaction. This topic is discussed somewhat in Using Entity Providers to Map HTTP Response and Request Entity Bodies, is discussed somewhat in the section Building URIs in the JAX-RS Overview document, and may be discussed in more detail in a forthcoming advanced version of this tutorial.