We have WildFly full-ha profile with ejb dist cache in domain mode.
There is no SFSB in application.
But it looks like state transfer occurs on startup of nodes.
Is there any option view the objects in wildfly infinishapn ejb dist cache?
Related
I am doing EJB lookup on application deployed on liberty inside a Listener class (sessionDestroyed method).
I am not starting any new thread. Still getting the below error
javax.naming.NamingException: CWNEN1000E: "A JNDI operation on a java:comp/env name cannot be completed because the current thread is not associated with a Java Enterprise Edition application component. This condition can occur when the JNDI client using the java:comp/env name does not occur on the thread of a server application request. Make sure that a Java EE application does not run JNDI operations on java:comp/env names within static code blocks or in threads created by that application. Such code does not necessarily run on the thread of a server application request and therefore is not supported by JNDI operations on java:comp/env names"
Any thoughts/pointers regarding this ?
I was developing a simple Spring MVC application that invokes a Web Service over a JMS trasport. I need to deploy it on websphere application server. Everything seems to work fine when I reference the remote connection factory directly from my application, and even seems to work properly when I try to use a local JNDI Queue connection factory on my WAS, but then, I cannot shutdown my server.
It seems to be because its connections pool keeps locked by somebody. It never invokes Session.close over JMS session (it is managed by JAX-WS server framework, in this case Apache Axis2). I have done the same from an even simpler spring MVC application (just #Controller and views) and it stops fine. The application that makes pool to be locked just includes a more complex context with persistence and transaction management (annotation-driven).
Do you think that this transaction mananagement could affect JMS session management? Somebody have ever found a JMS connection pool locked by an spring application?
Thanks.
Regards.
That was the solution to avoid locking. We removed ServletContext.close, so our server can find the references to used resources, and can release connections on pool.
I'm struggling to find some idea, tutorial or sample how to put some of the configuration of the webapp into database. There will be static configuration put in properties files like database connection, but there is some configuration which can be changed like email account, facebook account and best location for this in the database. That configuration should be loaded as soon as possible when webapp starts. Ideally all the configuration should be in some bean named Configuration.
Thanks in advance.
When a Spring webapp starts, Spring instantiates and injects all its beans. Once the beans are instantiated and injected, if a bean has a method annotated with #PostConstruct, it calls this method.
So you just have to define such a method, read the config from the database and store it in the bean (if you want it to be cached).
Inject this bean everywhere you need access to the configuration properties.
I'm running an application which has a background process which runs every 5 minutes. It runs in a clustered environment (WAS 7.1) but the process should only run on one server at a time. For this reason I've opted for EJB Timer using the javax.ejb.TimedObject interface. The timer is initially scheduled via a Web application (Spring MVC) in the same EAR. This has been running fine for over a year.
Recently I have upgraded the application to Spring 3.2.4 and made use of profiles. Now when the server recreates the EJB as part of it's lifecycle it sometimes is complaining that it cannot find one of the bean definitions. This bean happens to be defined twice, once withing a beans tag with a profile of 'live' and another with 'test'. The Web Application that initially schedules the timer uses a contexParam in the web.xml of 'spring.profiles.active' set to 'live'. This ensures the timer initially starts with the 'live' configuration. I suspect that when the server recreates the EJB it is recreating the spring context but the profile parameter is being lost somewhere.
Has anyone come across this before or have any suggestions as to how this might be solved?
Thanks in advance.
I'm new to ejb. I've created the session bean in one computer. And i want to access that session bean from the another system. How to do this?
Thanks in advance :-)
Split the EJB into implementation and client jars, deploy the EAR, create a vendor-specific binding for the EJB, copy the client jar (with the newly created stubs) to the other system, do a JNDI lookup of the bean, and use PortableRemoteObject.narrow.