Questions tagged [ejb]
3824 questions
0
votes
0
answer
2
Views
web application in linux environment throws javax.ejb.ConcurrentAccessTimeoutException Unable to get read lock on singleton ejb method
I have deployed EJB web application in tomcat,linux machine. This application connects to AWS RDS through JNDI lookup that presents in @singleton ejb class. Every minute my application prints the DB content in console. In initial startup of application, DB connection is achieved once using @PostCons...
0
votes
0
answer
3
Views
What is blocking the network connection ? Unable to do a EJB lookup between Client -server WebSphere
I have disabled 'Enable administrative security' on both client and server. using Cport i can able to see the connection is established. But still, I am getting Connection refused
Please help and save my day. below is the log
18:34:49:235 IST] 000000ba SystemErr R at com.ibm.ws.util.ThreadPoo...
1
votes
0
answer
73
Views
Error while accessing secured EJB (@RolesAllowed) deployed on Glassfish 4 payara server
I am getting below error while accessing secured EJB (@RolesAllowed) deployed on GlassFish-A ,
I am accessing this EJB from Application deployed on Glassfish-B.
Caused by: java.lang.RuntimeException: Cannot propagate
username/password required by target when using run as identity at
com.sun.enter...
1
votes
2
answer
133
Views
Why Java EE Timers are not clustering?
I am working with Java EE EJB timers and Wildfly 8.2.1 server with oracle database.When run a scheduler in my application at cluster environment not working fine,even though selected Transaction Isolation: TRANSACTION_SERIALIZABLE in Wildfly.I am deploying in two nodes it accessing from two node but...
1
votes
0
answer
37
Views
How do I fix this Glassfish-4 EJB(@RolesAllowed) lookup issue
I am trying to lookup a bean Deployed on different Glassfish instance.
My app is running on another glassfish instance.
The EJB has @RoleAllowed('APPUSERS') annotation at class level.
I have created custom realm and JACC provider on both the instances.
When I try to lookup the Bean it gives NamingE...
1
votes
0
answer
43
Views
Facing java.lang.IllegalAccessError for a base abstract class when trying to inject its implementation in wildfly 10
We are receiving the following exceptions in one of our code :
java.lang.IllegalAccessError: tried to access class base.BaseMessage from class message.beans.TerminalPowerCommandProducer$Proxy$_$$_WeldSubclass
Our class structure is as follows :
The Base Message creator class with default message pro...
1
votes
0
answer
492
Views
How to change jdbc-connection-pool properties dynamically at glassfish-resources.xml?
Basically I have two enviroments which run my Application, I use the preconfigured Docker enviroment on AWS to deploy my applications. So, it gets the connection properties by the glassfish-resources.xml, with Glassfish 4.1.1, everytime I need to deploy a new version to any enviroment It is needed t...
1
votes
0
answer
263
Views
Java batch - inject ejb to batchlet
I have a startup bean. I want to start some batchlet job in this.
I annotated the batchlet class by use @Nemed and @Dependent . I want to use some ejb like ReportService in batchlet but Injection not work. How can I inject EJB to my batchlet?
I deployed below example on wildfly 11.0.0.Alpha1 and got...
1
votes
1
answer
250
Views
What is locking my stateful bean
I have implemented a circuit breaker pattern in my java EE application and since it holds a state(how many failed requests, average response time, locked/unlocked and so on) I've set inte to be @Stateful.
And to avoid having issues with it being serialized because of container locking I've added @Co...
1
votes
0
answer
71
Views
compress responses in EJB GZip and Jersey 1.6?
I wish to selectively compress responses for certain apis.
I found this very nice article explaining exactly what i needed :
gzip compression with jax-2x
However, my application uses JAX-1.6 (I have worked with Spring, life was easy, until i have to work with EJB-Jersey now).
How can I achieve the s...
1
votes
0
answer
102
Views
Jboss 7.1.0 EJB2.0 Stub classes creation with Ant
We are trying to migrate my application from Websphere 6.1 to JBOSS server 7.1.0.
In my application we are using EJB2.0 and EJB JARs are generated by using IBM ejbdeploy.bat through an Ant script. Stub classes are created by ejbdeploy.bat for the EJB interfaces (we have only interfaces and bean clas...
1
votes
0
answer
45
Views
JMS Transaction Context vs JPA Transaction Context
I am trying to rollback an MDB message but I dont want the JPA transaction to be rolled back. At the same time, I don't want to run database updates off a new transaction context using TransactionAttribute.REQUIRES_NEW to minimize connection resource usage.
using mdb.setRollbackOnly() rolls back bot...
1
votes
0
answer
202
Views
java.lang.NoClassDefFoundError when jndi lookup for API
I am having a NoClassDefFoundError exception when I execute a jndi lookup for an API in an EJB. Here is what my project looks like :
java project
In my project I have 2 APIs, 2 EJBs and 2 Clients. Both my clients work. What I am trying to do is make a function of EJB ejb-admin-bean call ejb-31-enti...
1
votes
0
answer
33
Views
Multiple remote EJB interfaces?
Consider the following stateful EJB (3.x):
First remote interface:
@Remote
public interface Interface1
{
public void setValue(int v);
}
Second remote interface:
@Remote
public interface Interface2
{
public int getValue();
}
Implementation of the interfaces:
@Stateful
public class TheEJB implements I...
1
votes
0
answer
435
Views
Timeout after [300] seconds waiting for service container stability while finalizing an operation
I'm getting many errors like a timeout awaiting for service container stability and IllegalStateException becaus component is stopped but I'm not sure what is provoking this misperformance
My project consist of three modules an ear, an ejb and an war, and ejb has beans.xml on resources/META-INF and...
1
votes
0
answer
475
Views
java.io.IOException: Connection reset by peer wildfly 10
I am trying to do remote ejb lookup in wildfly 10 server. Below is the code for lookup.
private static Object lookup() throws Exception {
Properties properties = new Properties();
properties.put('java.naming.factory.url.pkgs',
'org.jboss.ejb.client.naming');
properties.put('jboss.naming.client.ejb....
1
votes
0
answer
100
Views
JASPIC authentication not honoured at EJB layer in JBoss EAP 7
I have an EAR that contains a WAR within. A JAAS based security domain is configured for the EAR (inside jboss-app.xml) and a JASPIC based one for the WAR (inside jboss-web.xml). The EAR contains EJBs that I wanted to be protected using JAAS. The WAR was added recently to provide JAX-RS endpoints fo...
1
votes
0
answer
324
Views
Wildfly 12 - EJB invocations from remote servers under domain controller (Elytron)
I am following the instructions from this link: https://developer.jboss.org/people/fjuma/blog/2017/09/08/getting-started-with-ejbs-and-elytron-part-2
Trying to replicate those configurations under domain controller but without success.
I have two server groups, one is client of other. But the server...
1
votes
1
answer
85
Views
Why can't classes that use EJB @Schedule be abstract Classes?
I need to schedule a task and I'm using EJB @Schedule to do so. It's working fine, however I thought I might try to generalize my design so that I can extend from some abstract scheduler, inherit certain functionality, and specify additional functionality in the sub classes extending the abstract cl...
1
votes
0
answer
27
Views
Determine Application State in Presentation Layer or Business Layer
I’m looking for some guidance on whether the presentation layer or business layer of an application should be responsible for determining the application state and what actions should be presented in the response when interacting with a resource.
The project I’m working on is a Java EE based app...
1
votes
0
answer
36
Views
How to stop and start EJB scheduler from JBoss console?
Below method is executing every 10 seconds I want to stop this scheduler from JBoss
[email protected](value = 14400)@Schedule(dayOfWeek = '*', hour ='*',minute='*',second='10',persistent =false)public void AddFinDocs(){log.info('AddFinDocs:Scheduler Started...');}
1
votes
0
answer
126
Views
SimplePrincipal cannot be cast to KeycloakPrincipal
I'm using Keycloak to secure an enterprise application. I want to obtain the token stored in the application context and the username logged in that application.
This is my class:
@Stateless
public class ContextoSesionEJB {
@Resource
SessionContext sessionContext;
/**
* Atributo utilizado para el re...
1
votes
0
answer
112
Views
weblogic.management.DeploymentException: java.lang.IllegalArgumentException: interface javax.persistence.Entity is not visible from class loader
On deploying EJB application on weblogic 12c , I am getting exception :-
'weblogic.management.DeploymentException:
java.lang.IllegalArgumentException: interface javax.persistence.Entity is
not visible from class loader'
Below is the configuration in weblogic-application.xml
antlr.*
javax.persisten...
1
votes
1
answer
74
Views
Share an EJB application into a rest service
(Sorry for my english, that not my first language, but I will try to be the more clear possible).
I have to make an application based on Java EJB that can communicate with other projects through RMI for some services. But I also want to make some other services - that allow to proceed business func...
1
votes
1
answer
249
Views
EntityManager is null in DAO using @PersistenceContext with transaction-type=“JTA”
I am facing issue to inject Entity Manager in DAO class, i searched lot of solutions but couldn't solve this issue.
I have EJB Bean Class
@Stateless(name = 'MyBean', mappedName = 'MyBean')
@Remote(MYRemoteBeanI.class)
public class MyBeanImpl implements MYRemoteBeanI {
@EJB
MyDAO dao; // This DAO get...
1
votes
0
answer
60
Views
Advantage of using @EJB to inject @Stateless Bean or using directly @inject
I am working on an old project developed in EJB.
I have serviceImpl as @Stateless(mappedName = 'adminService'). I have seen in my project injecting this class in other classes by
@EJB(mappedName = 'java:app/adminServices/adminServiceImpl')
and other classes are part of the same EAR but different m...
1
votes
0
answer
219
Views
failed to unmarshal interface java.util.List after changing JNDI URL protocol vom t3 to iiop
We are running an application on 4 WLS-Nodes on different UNIX machines.
OS: Sun 5.10.
WLS: WebLogic Server 12.2.1.3.0
Java: jdk1.8.0_144
Most of the communication between the nodes is done via EJB.
For a long time we have set up the JNDI URL with the T3 protocol:
JNDI_URL=t3://xxxsixb10001:8001,x...
1
votes
0
answer
32
Views
Propagating Usernametoken username to EJB in Liberty Profile
I have a web service that is authenticated with Usernametoken without a password. Usernames are in LDAP and LDAP is configured in server.xml. When calling from Web service a stateless EJB where roles are defined with annotations for different users I always have an error: CWWKS9400A: Authorization f...
1
votes
0
answer
86
Views
NullPointerException when I try to inject the SessionContextImpl in wildfly 9.0.2
I'm migrating a jboss 5.1.0 GA application to Wildfly 9.0.2, in which I manage EJB, in a stateless bean the EJBContext was injected in this way in jboss 5 and it works:
import javax.ejb.EJBContext;
@Stateless
@SecurityDomain (SystemSetting.SECURITY_DOMAIN)
@PermitAll
public class SystemServiceBean i...
1
votes
0
answer
205
Views
WildFly 13 remote ejb fails with Server rejected authentication
I want to make remote EJB calls on a secured EJB deployed in WildFly 13.
The EJB is secured with Elytron but for some reason the client app always fails with
Suppressed: javax.security.sasl.SaslException: SCRAM-SHA-1: Server rejected authentication
which in turns comes from
2018-07-23 13:19:25,116...
1
votes
1
answer
156
Views
Completable future & Executor service and Java EE or application server - etier
I am creating flood of async tasks and executing them with the help of completablefuture supply async by passing custom executor service with the thread pool that i created.
In tomcat i don't have to do anything specifically to manage the executor or task completion stage.
The question is do i nee...
1
votes
0
answer
97
Views
Deploy jar from another EAR
I have 4 applications that rely on the same jar (where some EJBs are located), but, because of the explicit dependency in pom.xml, I’m having problems with the build that not always consider the right version, that’s why I had the idea of doing the deploy of my jar as an ear and reference it as...
1
votes
0
answer
30
Views
In the class that implements EmptyInterceptor, need to create an EntityManager and save the new object
in project I have a class that implements EmptyInterceptor,where I intercept the change entity
public class PlainUserInterceptor extends EmptyInterceptor {
private static Logger LOGGER = LoggerFactory.getLogger(PlainUserInterceptor.class);
private Set updates = new HashSet();
@Override
public bool...
1
votes
0
answer
29
Views
EJBTimerService stop working
I have a question about EJBTimerService.
EJBTimerService is central controller, which the use java.util.Timer.
java.util.Timer jdkTimer = ejbContainerUtil.getTimer();
jdkTimer.schedule(timerTask, timerExpiration);
My problem is java.util.Timer.mainLoop stop working and new task not scheduled.
After...
1
votes
0
answer
26
Views
cannot fetch the exact dto returned from ejb to liferay controller
I am doing a liferay project which use ejb at back end. so my ejb method looks like this:-
@Override
public List getEpaymentDetails(String ebpCode) {
Query q = entityManager.createQuery('select s from EpaymentBo s where s.ebpCode=:ebpcode')
.setParameter('ebpcode',ebpCode);
@SuppressWarnings('unchec...
1
votes
1
answer
475
Views
Wildfly 13 and EJB 2.1 compatibility issue and RelativeContext Classcast issue
Can anyone help to solve the below issue:
I am trying to upgrade my application server from JBOSS 6 to Wildfly 12/13.
My Application is EJB based. When i am using Jboss 6, I was using Jdk 1.7
Now for Wildfly, I'm using jdk 1.8.
And, while upgrading to Wildfly, previous jndi settings wasn't working...
1
votes
0
answer
109
Views
CDI Injected Bean from super class has null fields in child
I'm pretty new to the general procedure of bean injection. I've googled a lot but haven't found a solution to my problem.
Additional Information
Running Wildfly 9.0.1 final
EJB Vers. : 3.1
CDI Vers. : 2.2.16 (SP1)
JSF Vers. : 2.2
import javax.annotation.PostConstruct;
import javax.ejb.Stateless;
im...
1
votes
1
answer
133
Views
Glassfish error while deploying ear web application with multiple EJB references
Continuation of Glassfish error while deploying ear web application
Im trying to solve this error when i deploy the EAR project with a glassfish server. It's already solved for one of the class and now i get the same error in another. I can't apply the same solution because in this new class there a...
1
votes
0
answer
100
Views
Access remote EJB from separate Wildfly Swarm
My goal:
To access @Remote EJB from separate Wildfly Swarm server
Current code:
Bean on wildfly swarm:
@Startup @Singleton
public class Bean1 {
@Inject private LoginFacade loginFacade;
@PostConstruct void setup() {
System.out.println(loginFacade.getCurrentUserWithoutSession());
}
}
Config bean on sw...
1
votes
0
answer
49
Views
javax.resource.ResourceException: IJ000459 Transaction is not active
I am using JBOSS EAP7 and EJB3.0.
I have some functionality like whenever I got some Exception, I need to log it.
But when I get a Exception and trying to log it, I am getting an exception like Transaction is not active. I am using Container Managed Transaction and Attribute type as Required.
Please...