Mostrando postagens com marcador JBoss. Mostrar todas as postagens
Mostrando postagens com marcador JBoss. Mostrar todas as postagens

24 janeiro 2014

Hackathon de Java e Raspberry Pi na CPBr14


Você que é desenvolvedor Java e vai para a Campus Party na semana que vem de 27 de Janeiro a 2 de Fevereiro de 2014, não pode perder o Hackathon de Java e RaspberryPi promovido pelo SOUJava, com apoio da Oracle, trazendo kits, premiação, e mentoring! O objetivo é aprender, praticar e inovar, e todos os participantes ainda vão ganhar uma camiseta. Um dos projetos será selecionado para apresentação no palco principal!

Presença de grandes nomes da comunidade Java brasileira como:

Para maiores informações, consulte o site do SOUJava Hackathon de Java e Raspberry Pi na Campus Party.

11 novembro 2013

Reality of Open Source Users in Mobile and Cloud Era

- "I built my Android app entirely with Open Source products, both in the app, and in the backend server running on Amazon. I'm charging US$ 1,99 for it in the Google Play Store" 
- "That's wonderful! Where is the source code of your app? Have you contributed back to these Open Source products? Will you release your product as Open Source?"

In this new era of Cloud Computing and Mobile apps, there's an increasing number of for-profit products that takes advantage of Open Source products, but barely contribute anything back to them, either by buying support, or non-expensive things such as reporting bugs, fixes, or helping documentation. Developers are building SaaS applications for Salesforce.com, or Mobile apps for Android and iOS devices, and usually charge for these. Of course, they want to make money as anyone else.

Whenever I ask someone that makes money with _their_ software built on top of Open Source, if they will ever release the source code, they usually answer: "my case is different". Well, why is your case different? Why can't I buy your app from Google Play Store, and still access the code on GitHub? Or build it on my own, customize it, etc? That's the point of Open Source, right? Wrong, in their minds.

Majority of software developers actually tend to think that Open Source is free as in free beer. And that's it. No matter how hard you try to explain otherwise, the industry will almost always see Open Source software as free software. And due to the new way to sell software, I really think that Mobile apps and Cloud SaaS/PaaS offers will, sooner or later, kill good Open Source softwares, and leave this space only for conceptual and initial implementations for Open Standards and APIs, or for general use and development platforms and languages such as Java, Ruby, etc.

Perhaps you want to read Will Cloud kill Open Source? Is the Future Open Standards? Your thoughts are welcome :-)

10 setembro 2013

Java SE 7 update 40 e o Mission Control 5.2

Java SE Downloads
Chegou uma nova atualização do Java SE 7: update 40. Esta versão inclui várias novas funcionalidades como o Java Mission Control, Deployment Rule Set, suporta para o Retina display no Mac, e suporte a Hard Float ABI no Linux ARM v7. Também inclui diversas correções de bugs. Para quem desenvolve Applets e aplicações Java Web Start, este release, fica a atenção para conhecer e enteder as mudanças.

Deployment Rule Sets

Esta funcionalidade permite um administrador de desktops a controlar o nivel de compatibilidade para clientes Java assim como níveis de segurança para a empresa. Para maiores detalhes, veja a documentação do Deployment Rule Set.

Java Mission Control

O Mission Control era até então uma ferramenta disponível para clientes Oracle, e que foi lançada há muito tempo atrás junto com o JRockit (JRMC). Mas a Oracle agora disponibilizou a ferramenta junto com a JRE HotSpot 7u40. 

Esta ferramenta permite monitorar, gerenciar, introspectar, e detectar memory leaks nas suas aplicações Java, sem ter que introduzir códigos para isso, que normalmente degradam a performance da aplicação. Hoje esta ferramenta está agora disponível no download do Oracle HotSpot JDK 7u40!

Flight Recorder

Mas a principal e mais importante característica é o Flight Recorder. Este recurso funciona através da leitura de eventos produzidos pela JVM. Mesmo ativando a geração destes eventos, a sobrecarga total  para as suas aplicações ainda fica abaixo de 2%, que considerando o tipo e o valor de informação que você recebe, é quase nada. Um exemplo de evento é a chamada de um método de uma classe Java.

Com o profile de chamadas de métodos você pode descobrir onde o aplicativo está gastando a maior parte do tempo executando seu código Java. Este é, por exemplo, útil para otimizar a aplicação onde as otimizações realmente terão impacto. Isto sem precisar introspectar seu código manualmente!

Alem disso, você tem também uma visão de otimização para alocação de objetos. Você pode ver por exemplo, a alocação em tempo real de objetos na Old Gen da memória heap. diretamente no espaço de idade, além de outras abas que oferecem diversas informações importantes sobre o processamento de informações na sua aplicação Java. Leituras de arquivos I/O, Socket I/O e muito mais.

Se você precisa de mais informações sobre o Mission Control, entre na página da ferramenta em www.oracle.com/missioncontrol.

E obrigado ao Markus Eisele por ter cedido parte deste post! :-)

22 fevereiro 2013

Encontro SouJava na Oracle (JMS e Cache Distribuido)

No dia 21 de Fevereiro estreamos o novo escritório da Oracle abrindo as portas para o grupo de usuários do SouJava. Com a presença do Bruno Souza, Ricardo Ferreira, Edgar Silva, Vinicius Senger, Mauricio Leal e muitos outros, tivemos a participação ao todo de 26 pessoas.

Durante a reunião, apresentei As Novidades do JMS 2.0, parte importante do Java EE 7 e que teve votação do Public Review no dia 19/02. O SouJava votou a favor, não só pela qualidade mas também pela transparência da especificação.

A outra apresentação foi do Ricardo Ferreira, falando sobre Processamento de Dados em Memória usando Elastic Data Grid (In-Memory Computing), que demonstrou a importância do uso de cache distribuído em arquiteturas altamente escaláveis, com o Oracle Coherence.

No final, os participantes conheceram o novo escritório da Oracle e ainda foram muito bem recebidos com muita pizza. Confira as fotos do evento!

04 janeiro 2013

Issue dev'ing RESTful JSON services on NetBeans


Here is a tricky issue that you may find if you are developing RESTful services with Java EE on NetBeans and GlassFish or WebLogic. If you want to support the JSON format but need to access some implementation classes like @JsonIgnore, you need to add the JAX-RS RI, Jersey, to your project's Libraries definition. How to add the RI? You will probably do this:
  1. Open project's Properties (right click on the project)
  2. Go to Libraries
  3. Click on 'Add Library'
  4. Select 'Jersey 1.8 (JAX-RS RI)
But you won't have your service running fine. You may find these exceptions: (added here so Google can help future users)
1 - If you try to access your RESTful service to get a JSON format of it, you will get this exception:
com.sun.jersey.spi.inject.Errors$ErrorMessagesException
  at com.sun.jersey.spi.inject.Errors.processErrorMessages(Errors.java:170)
  at com.sun.jersey.spi.inject.Errors.postProcess(Errors.java:136)
at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:199)
2 - If you try to access your RESTful service to get an XML format, you will get this exception:
java.lang.RuntimeException: javax.naming.NameNotFoundException: Unable to resolve 'com.sun.jersey.config.CDIExtension'. Resolved 'com.sun.jersey.config'; remaining name 'CDIExtension'
  at com.sun.jersey.server.impl.cdi.CDIExtension.getInitializedExtension(CDIExtension.java:177)
  at com.sun.jersey.server.impl.cdi.CDIComponentProviderFactory.(CDIComponentProviderFactory.java:92)
  at com.sun.jersey.server.impl.cdi.CDIComponentProviderFactoryInitializer.initialize(CDIComponentProviderFactoryInitializer.java:75)
  at com.sun.jersey.spi.container.servlet.WebComponent.configure(WebComponent.java:576)
  at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.configure(ServletContainer.java:311)
 If you look at your server's log, (in my case, I was using WebLogic 12c) you may find this message somewhere:
WARNING:
**********
The application is using ServletContainerInitializer class com.sun.jersey.server.impl.container.servlet.JerseyServletContainerInitializer that is loaded from:file:/labs/wls1211/modules/com.sun.jersey.server_1.1.0.0_1-9.jar. This initializer overrides the one available in the system.
**********
When you added Jersey to your library, the "package" checkbox was checked by default. So the JAR ended up going into WEB-INF/lib of your project, conflicting to the already provided by the container. 
So, how to fix this issue? Follow these steps:
  1. Open project's Properties (right click on the project)
  2. Go to Libraries
  3. Uncheck the checkbox 'Package' for Jersey 1.8 (JAX-RS RI)
  4. Click on 'OK'
  5.  Clean & Build (right click on the project) ---> remember to clean and rebuild your project
  6. (re)Deploy application
Done! :_)
https://blogs.oracle.com/brunoborges/entry/issue_dev_ing_restful_json

20 junho 2012

JBoss 7.1.1 and CXF WS Client

JBoss 7.1.1 has a slightly small bug that prevents one to use a WS Client (implemented on JBoss with Apache CXF). This issue has already been reported to the JBoss WS component and fixed on JBoss EAP 6.0.0 ER 5 (see this specific issue ticket).

This is the stack trace you may see on your server.log:


Caused by: java.lang.ClassNotFoundException: org.springframework.beans.BeansException from [Module "org.apache.cxf:main" from local module loader @15cda3f (roots: /opt/dev/servers/jboss-as-7.1.1.Final/modules)]
  at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
  at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
  at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
  at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423)
  at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
  at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
  ... 96 more


If you have JBoss EAP and a license, just update it. But if you are on JBoss 7.1.1, you have two options to workaround this problem:

  1. One is updating JBoss WS to the upcoming 4.1.0 release (still in beta and it seems it has not been released publicly).
  2. Your best option is to add a Spring module to your JBoss instance and then add a dependency on Spring to the CXF module:

How to add a Spring module to JBoss AS 7?

First thing to do is to choose the best version of Spring. Prefer the latest one (in the time of this writing, 3.1.1). But if your application is using 3.0.x, pick the latest version of this branch.
  1. On the jboss-as-7.1.1-Final folder, create this path:
    • modules/org/springframework/spring/main
      • on Unix, you can do this using $ mkdir -p <path>
  2. Add the following module.xml to this newly created folder
  3. Download these JARs and add them to this  newly created folder
  4. Open this file
    • jboss-as-7.1.1-Final/modules/org/apache/cxf/main/module.xml
  5. At the end of this file, make sure you have this module dependency:
    • <module name="org.springframework.spring" />
Restart your application server.

19 junho 2012

Issue with JBoss and Camel

If you are like me and are trying to run Apache Camel on JBoss 7.1.1, you may face an issue related to this exception:
Error description: You receive a stacktrace with an inner exception
on the form below.
Caused by: java.lang.NullPointerException
at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.checkOverrideProperties(ClassBeanInfoImpl.java:205)
at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:186)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:509)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:528)
at com.sun.xml.bind.v2.runtime.property.ArrayReferenceNodeProperty.<init>(ArrayReferenceNodeProperty.java:87)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[ ... and a looong intermediary stack trace removed ... The stacktrace
ends with: ]
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:128)
at javax.xml.bind.ContextFinder.find(ContextFinder.java:277)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:372)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:337)
at org.apache.camel.spring.handler.CamelNamespaceHandler.createJaxbContext
This happens because there's a bug on JAXB 2.2.4, the version used by default on JBoss 7.1.1.
I honestly don't know if this also happens to any other JBoss 7 versions, but this is a bug only with JAXB 2.2.4, so if the version you have has this JAXB version, you also have this problem.

To fix this, follow these instructions:

  1. Download the new version of JAXB (from Maven Repo)
    1. jaxb-impl-2.2.5-2
    2. jaxb-xjc-2.2.5-2
  2. Put these files on this JBoss folder:
    1. jboss-as-7.1.1.Final/modules/com/sun/xml/bind/main
  3. Open the file module.xml
    1. replace the old version (2.2.4) with the new one (2.2.5-2)
  4. Done!
Now get back to work!

PS: part of this solution (updating JAXB) is thanks to this thread.
Contato

Email:bruno.borges(at)gmail.com

LinkedIn: www.linkedin.com/in/brunocborges
Twitter: www.twitter.com/brunoborges
Comprei e Não Vou
Rio de Janeiro, RJ Brasil
Oracle
São Paulo, SP Brasil