Tomee / OpenEJB migration from JBoss - jboss

I am newby to TomEE+. I just try to deploy my existings EJB (large application with about 100 jars) from JBoss, just copying in webapps.
It seems to work but when I start my client, It tries to call my ejb and fails due to bad port :
Client configuration :
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
java.naming.provider.url=localhost:1099
How can I change the openejb port listening ? Do I have many change to switch JBoss to TomEE ?
Thanks

How do you call EJBs from client? TommEE is not full profile certified Java EE6 server so if you are using something what is not in web profile, there's some chance that it's not yet implemented.

Related

REST Spring Boot Web Service on Websphere 9

I want to create a Spring Boot REST Web Service and deploy and publish it in Traditional Websphere 9 Application Server. Is it possible ?
What all challenges I might encounter? Can someone please provide me few pointers for reference?
Yes this can be done. It is not a good design, but yes it can be done. Back in the day when I was working for a big bank, they deployed java spring-boot microservices in IBM websphere(Not liberty).
How to do it?
1) Package your deployable as war. You can do this by editing your pom to package as WAR.
2) You can either add connection string config in your springboot starter class or get a JNDI created in the websphere instance. We observed that performance of the API's improved when the app used websphere JNDI as opposed to app created connection bean.
3) If you use IBM MQ, the best course of action is get a non-ssl and ssl based channel created at MQ and a JNDI for the MQ connection as well.
4) If you plan to create MQ connection beans within the app, like we did, ensure the JKS file has all the valid set of signers of your org.
Problems we faced
1) Our app used a lot of third party rule engine like drools, so ensure the websphere server.xml is configured to servlet version 3.1 or higher
2) Webshpere admin console is helpful, but don't just blindly believe if it says green to your container, always check your app logs for errors.
3) Common pain points are establishing a successful connection with IBM MQ host. Get a MQ server admin to troubleshoot all MQRC errors.
4) If you plan to use Oracle as backend, ensure the DBA has created a wallet for you to enable both SSL and Non SSL connections. Some organisations are picky with non-sssl db connections. It is easier to handle all this if you leverage webspehere JNDI for DB connections.
Let me know if this helped.
Both WebSphere Traditional and WebSphere Liberty support Spring boot.
Are you looking for something like this?
http://www.adeveloperdiary.com/java/spring-boot/deploy-spring-boot-application-ibm-liberty-8-5/

Tomcat Server gets unresponsive

I am new in JPA and java Web App development.Please help me.
Overview:
I am developing one java web application with Apache Tomcat Server [Version 7.0.70]. And It is multi-user system.
Platform : JVM Java 1.7
Framework : JPA
Database : My-Sql Workbench 6.3
Jars: MySQL Connector and Eclipse-link
Problem:
Once deploying war file into server 10 clients parallel accessing to the server with 10 unique log-in sessions . After sometime [Uncertain] server gets un-responssive and no database operations working.
After this it need to restart the tomcat server. and system gets work finely. its a continuous process to handle the system.
Image : My Tomcat Server Error
This image content that shows error when server gets un-responssive
Is there any caching problem
Image persistence.xml : Persistence Unit Cashing
Thank you,
Please give me solution.

Jboss EAR with EJB and webservice health monitoring and management

I am using Jboss5.1 and I have a EAR1 deployed which has a EJB3 component implemented using #Stateless annotation and the same EJB is also exposed as webservice using the annotation #webservice.
I want to check through a EJB service/management service bean(Packaged in another EAR2) from the start of deployment to un-deployment of EAR1 PERIODICALLY, if the EJB and Webservice is deployed and running properly and working normally and is not in deadlock/non responsive state.
I have looked into JMX and I am able to get notifications of create and destroy for EJB as well as webservice, but how to check periodically whether the EJB and webservice is working normally and is not in deadlock/non responsive state?
Also how to monitor Jboss ESB services?
Is the JMX is the only way or does jboss provides any other API's to do monitoring how about JBOSS MONITORING
Thanks in advance if you are looking at this.
Especially JBoss AS5.x is using the so called profile service (PS) as the main way to interact with the server. Unfortunately the PS is not JMX-based and on the other side you don't see all EJBs in the Platform MBean server.
RHQ has a plugin to monitor EJB instances inside AS5 as well as for other resource types like JBoss ESB or Apache Tomcat and is able to determine the availability of EJBs.
but how to check periodically whether the EJB and webservice is
working normally and is not in deadlock/non responsive state?
This is usually something that you can (only)(*) determine by hitting the relevant beans/methods and evaluating the outcome.
*) It may be possible to determine a bean in a deadlocked state by requesting a heap dump and looking for deadlocked periodically.

How things work after deployement in Application Server?

Till now I have been coding in Java.
Wanted to know - what happens after deployment in Application Server
Suppose I deployed my EAR in AppServer (WebSphere or Jboss and Assuming Deployed Successfully!)
EAR convert into tmp files.. etc etc
How request picks some EAR or WAR in 100's of EARs or WARs in
Application Server ?
How application server look for datasources ?
How Plugin-cfg.xml works.
..
..
etc...etc..many more
Is there any document or anything ?
That is a VERY VERY vague question, I would start here: http://pic.dhe.ibm.com/infocenter/wasinfo/v7r0/index.jsp
with the instructions for WebSphere Application server v7 "Developing and deploying applications" section.
I think the implementation of servers vary, so trying to put some basic principles.
How request picks some EAR or WAR in 100's of EARs or WARs in Application Server ?
Application Server keeps a list of WAR and bind URL patterns /* . If pattern matched, request goes to the application. Otherwise - error 404. Then application should be in memory, i.e. loaded by using specific classloader. After that methods like doGet called using reflection.
How application server look for datasources?
Application server collected all resources from xml description during startup and changes on request. Next, return it on call. Here is example from Tomcat source of taking datasource from Hashtable environment.

TC Server Vs JBoss Server

We are planning to migrate to a new WebServer (bye bye Websphere), the main considerations are
transaction management
persistence
message/event handling
maintainability
distributed architecture
MBD/EJB support
We are very happy with TC Server but the only problem is that it does not support EJB's and MDB's and we use them pretty heavily here, I head that you can use TC Server and JBoss together, did anybody try using it that way or is there other way that we can use EJB's and MDB's with TC Server ?
Any help appreciated
/srm
If by TC you mean Apache's Tomcat, then yes: JBoss AS is bundled with an embedded Tomcat Servlet/JSP container. So, if you are happy with Tomcat, then JBoss might be a good option for you. And it supports all things you've mentioned.
JTA
JPA/Hibernate
JMS and MDB
Yes, you can have JBoss AS in cluster provided your application supports it
Of course. JavaEE containers must support MDB and EJB.