OpenEJB Standalone -- Non-JMS MDB Fails to Deploy - java

I just want to go 'live' with the setup that is currently working beautifully in testing. I've downloaded the standalone OpenEJB server and put my EJBs in the /apps directory.
The output in the logs suggests the standalone server may not support non-JMS adapters:
Deployment 'SocketMDB' has message listener interface com.example.TCPMessageEndpoint but this MDB container only supports interface javax.jms.MessageListener
Note the other modules, including the RA itself seem to startup successfully. The only issue seems to be with creating consumers of non-JMS messages.
What else might I try to look at or configure? Thanks!

In the testing scenario we wrap all the modules we find in the classpath up into an EAR and deploy that. To mimic that environment, try putting your rar and ejbs into an EAR file and drop that into the apps/ directory. You should get the same results as with an embedded scenario.

I've ended up just driving an embedded OpenEJB container for further testing. Will try to post new results here when I have them.

Related

Re-deploy spring boot service without restart?

I have developed a micro service (Spring Boot REST service, deployed as executable JAR) to track all activities from third party projects as my requirement and its working now.
Currently it's working apart of some projects, and now I have updated service with some additional features.
But I can't move it to live server without restarting the existing service as it is deployed as jar. I'm afraid to restart my service, restart may be leads to lose data of integrated projects.
What improvements can I make in my architecture to solve my problem?
What about JRebel plugin. It worked perfectly for me, but, unfortunately, it's not a free app. Like alternative, (i used this approach with Spring MVC, with Spring Boot it could be otherwise), I set up a soft link in work directory on a compiled path in JBoss (in my case it was dir with name target and *.class and *.jar files). As for me, the first solution with JRebel is the most appropriate for you.
Finally got a solution as commented by #Gimby .
We can do it by deploying multiple instances of services and it bound to a service registry ,Here i achieved it by using eureka as registry service and also used zuul as proxy .

Java Web Container implementation independant development

One of the most important non-functional requirements of any project is the build process in my opinion and that's where I kinda get stuck in my java project, which has just one external dependency, a jdbc compatible database. All the tutorials about spring and deployment out there; I've read them all, but they either say:
run it with gradle bootRun applications.properties (yes works but on a webserver I'm not going to have any properties-files, but JNDI resource for example) or
build a deployable war file with JNDI resources (yes it works on the webserver, but not in my embedded webserver or I'm doing it wrong, but I cannot find any doc about how an embedded tomcat loads a context.xml from outside the jar file).
Now I tried to use the same setup as my server and installed tomcat7 and the #Asyc #Scheduled services run, but no servlets, like a simple /status page should return "OK" just for checking. catalina.out does not show any errors. My /manager from tomcat7-admin says deployment ok, and when I click start: "FAIL - Application at context path /xyz-0.1.0 could not be started
FAIL - Encountered exception org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/xyz-0.1.0]]"
And now I want to make a cut here and throw every "bootstrap" stuff away and start from zero.
So my question is, am I wrong when I say, that the big deal of my deployment is a jdbc JNDI resource provided from the web container, which is called 'jdbc/xyz' and everyone who wants to deploy my war needs that JNDI. That means so matter if you're using wildfly, jboss, tomcat, glassfish or any embedded server: your server impl has to provide that web container and jndi resource to make it run. And I don't want to configure any tomcat, glassfish or whatever implementation in my war.
Is that wrong?
It would be great, if you could help me. I'm playing around with that many weeks now :( and if A works B does not and vice versa. Would it be easier to use JEE?
Thank you.

java.lang.NoClassDefFoundError while calling RabbitMQ methods from ejb

I had written a custom ejb component with schedular attached to it. In the scheduled ejb method, I am calling the RabbitMQ methods to dequeue the messages. The whole thing works with in eclipse while debugging the individual java file. but the same while build and deployed on the Wildfly server, throws the "Caused by: java.lang.NoClassDefFoundError: com/rabbitmq/client/ConnectionFactory. Seems like a classpath issue but even adding the dependent jars in the manifest file doesn't help. I am blocked with this issue. Could anyone help me on this?
"
I converted the project to dynamic web project and added the Rabbit mq client libraries to the web-inf\lib folder. Now when I tried to deploy to the Wildfly server, its detecting the external assemblies and I am able to create the connection factory. Not sure its the right way to solve the issue.

how do i wait for service when another service depends on it

i'm about to deploy two different but dependent war-files into a single jboss (AS 4.2.x GA)
One implements some webservices (jax-ws) exposing their interfaces through
a wsdl. The other one is a (say) web frontend using the aformentioned webservices. When I drop both warfiles to $JBOSS_HOME/server/default/deploy at the same time I can see that the first gets deployed (somehow) but the second one gets stuck and the entire jboss is not responding.
When I deploy them one after another, everything is fine (it just works:)
Is there a way to tell jboss that deployment of warfile2.war has to wait
for warfile1.war to finish deployment before starting deployment of warfile2.war?
Is there a way to determine programatically wheter a given 'service' is deployed
and ready?
I'm wonder what happens when both wars are present and jboss is restarted?
Kind regards,
Jay Wee.
To answer your last question first, JBoss will deploy the contents of its deploy directory in alphabetical order. If you drop two WAR files into a running server's deploy directory, the results are unpredictable, but should be safe, so I'm not sure what's going on there.
By the way you describe the dependency, it sounds like when a user uses the frontend WAR, it calls the web service WAR, and that on startup there's no link between the two? Could anyone be trying to use the frontend WAR while the web service WAR is still deploying? Which WAR comes first alphabetically?
As a possible solution, when you have two WAR files that depend on each other, you should consider packing them both into a single EAR file. That way JBoss will deploy them together in a controlled way.
What about implementing a listener in the web frontend waiting for a successfull head request to the wsdl on localhost?
Thats right. backend.war is deployed before frontend.war.
I deployed it on my local jboss and nobody else has acces to it.
What I can see when i debug into jboss is that the frontend accesses the backend wsdl (https://localhost:9999/app/svc?wsdl ) hangs while jboss is not ready.
\at Arne Burmeister: the listener approach doesen't help. the listener is called to early in the process: I can connect to the backendWsdlUrl but backenWsdlUrl.getConnection().getOutputstream() hangs
I think I'll give the ear a try. Is there a good documentation on how
to pack things together in an ear? (skaffman already pointed me into the right direction)
Thanks a lot to all who help so far,
Jan

How do I push an update to a war file to clients?

Assuming my clients are running my J2EE WAR application on their intranet, and I have an update for them... how do I push the updated war file to them?
I'd like it to be automatic and require no human interaction on the client's side.
Can this be done?
Any help would be appreciated.
Tomcat (if this is your target container...) offers a manager interface that will allow you to deploy/start/stop applications.
I have used both ant and maven tasks to great effect in deploying wars remotely all while being built-in to the build process.
Depending on your deployment process, this may not work for you, but for dev & qa: highly recommended.
Edit: of course apache has to be configured for this type of access to be allowed.
See: Deployer how-to
Glassfish has documentation on deployment here.
Ant tasks are also available here.
Glassfish uses Tomcat internally, but the Tomcat Manager is not available as it is a separate application.
If the glassfish admin console can be accessed, it can be used to upload and deploy war files.
I'm not sure if you're comfortable giving them access to your source code repository...even in read-only mode.
If you are, then you could script up something in ANT to check out the latest version of the source code (using CVS task) and then build the .war file (using WAR task).
The only trick would be automatically deploying it once the war has been built. Tomcat will automatically deploy applications copied into a certain directory. For Websphere, see this question and this question.
For other J2EE servers I don't know how it would be done.

Categories

Resources