Remote Method Invocation - glassfish

I have a session bean which implements a remote java interface.
Whenever a make a new remote method in interface and access it for the first time to access its session bean implemented method it throws an Error:
javax.ejb.AccessLocalException: Client not authorized for this invocation
Caused by: org.omg.CORBA.NO_PERMISSION:
vmcid: 0x2000 minor code: 1806 completed: Maybe
However when I re-deploy my application the error vanishes and it only happens for the very first time I access the remoted method of session bean.
My server is GlassFish 4.

This Happens if one tries to incrementally deploy the app on GlassFish server.
However, if the application is freshly deployed these errors won't come.

Related

Jboss 7 JNDI lookup class cast exception

I'm getting familiar with Jboss 7.
I'm writing some application to try out technologies.
So I wanted to have some simple monitoring service that will allow me to do some counter on business methods.
I wanted to access counters through jmx and jndi.
The 'counter service' is part of jmx bean. During jmx registration it is also registered in jndi context.
Then it is being used in some interceptors.
And here problem occurs, when I want to get reference from jndi I got class cast exception.
java.lang.ClassCastException: com.cybercom.pl.jbmon.SystemMonitorService cannot be cast to com.cybercom.pl.jbmon.SystemMonitorService
The reason for this i believe is that there classloaders are different.
During service startup it is:
ModuleClassLoader for Module "org.jboss.as.standalone:main" from local module loader #a4d593 ....
During execution it is:
ModuleClassLoader for Module "deployment.jboss-mon-app.ear.jboss-mon-web.war:main" from Service Module Loader
JMX beans, monitoring service and interceptor exists in same ejb module.
I finally did workaround for this, instead of going through jndi I used jmx client (https://github.com/michaljedryszka/jboss-sample-monitoring/commit/dcc4f05a4d6d50e592f0517bfe0454033f8e3659)
But still I don't know how to fix that CCE with jndi lookup.
What can You suggest?
Regards
You can try to create and install JBoss module with classes that are part of the JMX mbeans. This will cause to be loaded in same classloader for all access.
After you must add the dependency to the new module in the application, for example you can use jboss-deployment-structure.xml file.

Ping Connection Pool failed for jmspool. Could not create connection. Please check the server.log for more details

I'm GlassFish 3.1.2, ActiveMQ 5.1.1 and ActiveMQ 5.8 resource adapter (activemq-rar-5.1.1) I have created a GlassFish cluster with 2 instances. I reference http://geertschuring.wordpress.com/2012/04/20/how-to-connect-glassfish-3-to-activemq-5/ to assist with the initial deployment/configuration of activemq resource adapter After configuring the Connector Connection Pool via GlassFish Admin Console and enable Ping. When Ping is executed an error occurs: Ping Connection Pool for jms/ActiveMQConnectionFactory is Failed. Ping failed Exception - This pool is not registered with the runtime environment : jms/ActiveMQConnectionFactory Please check the server.log for more details. Ping failed Exception - This pool is not registered with the runtime environment : jms/ActiveMQConnectionFactory Please check the server.log for more details.
appreciate for your replay
by any chance is your glassfish instance in a cluster?. In our case it was failing with the same error message, and we figured out that if the instance is in a cluster, it doesn´t work. Though it works if it is not in a cluster.
We verified this also by checking in the activemq admin console the the consumers were active and receiving message, even if the ping command was failing.

How to connect to JMX service on Glassfish from within an EJB?

I have a message-driven EJB deployed to a Glassfish 2.x system. When I get a message that causes an exception or isn't able to be sent or consumed, I would like to do one of the following things:
Pause the EJB's subscription to the Topic/Queue
Shut down the EJB itself
Cease consuming messages until I give an 'all clear' or something equivalent
This is all so that I can stop repeatedly throwing exceptions after calling context.setRollbackOnly() on the message.
I've tried connecting to the server via JMX, but from what I've looked at in documentation says that I'd have to persist:
username
password
jmx url
in my EJB somewhere. Can't I access the JMX server from within the EJB in Glassfish without having to know that?

EntityManager injection fails in websphere 7.0.0.17 but same works in 7.0.0.0

I am successfully running an application in websphere 7.0.0.0 but it is failing in websphere 7.0.0.17. I am injecting the entitymanager using #PersistenceContext.
When I try to use entitymanager it is throwing NullPointerException. But the same code runs successfully in Websphere 7.0.0.0.
I am using JTA with defined data source in websphere.
My DAO is Stateless bean called from another stateless bean(DAO is Injected here). Both calling SLSB's method and DAO method are running in Trasaction scope(Transaction.Supported).
I am using openJPA 1.1 (default to websphere 7).
I tried to update the websphere runtime to the latest 7.0.0.23 but no use, still it is throwing Nullpointer exception whenever I am trying to inject Entity Manager.
Any help will be much appreciated.

How do I troubleshoot a WCF service with failing load tests?

I have a WCF 4 service running on IIS 7 (Windows Server 2008), deployed to a development server. The service works when I run a small website that consumes the service (click a button, the page calls the service, data is returned. It's very basic).
I also created some unit tests that call the service and placed them into a load test. In a nutshell, the "unit tests" call the service and write the byte[] streamed back from the service to a file. The service performs as expected when running the load test.
The problem is the load test fails after a very small number of iterations. Sometimes foour calls are successful, other times after five calls. Again, individually, the tests run fine but when I put them together to simulate a live environment (multiple users, multiple test iterations) this problem appears.
The exception thrown is:
Test method TestProject1.UnitTest1.RunReport threw exception:
System.ServiceModel.CommunicationException:
An error occurred while receiving the HTTP response to http://xx.xx.xx.xx:yy/Service.svc. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details. ---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
Update #1:
I just set the test iteration to 10 (run the test 10x) and the constant user load to 1. The test was able to complete succesfully. This was using the most basic of the unit tests. The second, more complicated test, was omitted for this run.
Look in your application event log (eventvwr.exe). Assuming you're operating in a mostly-normal environment, there will be an entry for the server-side error.