eclipse-ee4j / glassfish

Eclipse GlassFish
https://eclipse-ee4j.github.io/glassfish/
386 stars 144 forks source link

EJBException: No EJBContainer provider available #10527

Closed glassfishrobot closed 15 years ago

glassfishrobot commented 15 years ago

In NetBeans I have very simple stateless session bean which I'm unit testing using Embeddable EJB container. Everything works fine and I can retrieve and test my EJB. It work under condition that GlassFish server is not running. If it is running and I try to test my EJB I get dozen of exceptions. See attached verbose log from "ant myproject test". Please advice whether something needs to change on configuration side or whether this is GF issue. Thanks.

Environment

Operating System: All Platform: All

Affected Versions

[V3]

glassfishrobot commented 6 years ago
glassfishrobot commented 15 years ago

@glassfishrobot Commented dkonecny said: Created an attachment (id=3599) 'ant test' verbose output

glassfishrobot commented 15 years ago

@glassfishrobot Commented dkonecny said: glassfish-v3-b69-10_20_2009

Product Version = NetBeans IDE Dev (Build 091021) (#1e488785999e) Operating System = Linux version 2.6.24-24-generic running on i386 Java; VM; Vendor = 1.6.0_16; Java HotSpot(TM) Client VM 14.2-b01; Sun Microsystems Inc. Runtime = Java(TM) SE Runtime Environment 1.6.0_16-b01 Java Home = /usr/lib/jvm/java-6-sun-1.6.0.16/jre

glassfishrobot commented 15 years ago

@glassfishrobot Commented mvatkina said: do you have remote interfaces in your test? If not, please attach your test. If yes, remote interfaces are not supported in embedded mode

glassfishrobot commented 15 years ago

@glassfishrobot Commented dkonecny said: Created an attachment (id=3600) netbeans project

glassfishrobot commented 15 years ago

@glassfishrobot Commented dkonecny said: Marina, no remote interface involved. Attached is my NetBeans project with 3 EJBs I'm using for testing (one of them is using JPA). You will need one of recent NB builds with registered GF V3 server (not running). Open attached project, start Derby DB and right click project node and choose Test. All 3 tests should pass. Then start GF server and rerun tests - that should fail.

Two more things:

glassfishrobot commented 15 years ago

@glassfishrobot Commented ksak said: One of the ejbs in the app declares a Remote interface, which causes the orb initialization and port access conflict if the server is running :

@Stateless @Remote(value=StatelessBeanLocal.class) public class StatelessBean implements StatelessBeanLocal {

Resolving as duplicate of 9950.

glassfishrobot commented 15 years ago

@glassfishrobot Commented dkonecny said: Mea culpa, sorry about that: I was positive there were no Remote interfaces involved but I remember know that I was using the same project for testing something else and I did renamed "local" to "remote" in that test case.

In any case I would expect GF code to be more defensive: it is a user's mistake which can happen often and Embeddable container should survive it without problems and just report (via log or exception) that Remote EJB will be ignored and not loaded.

glassfishrobot commented 15 years ago

@glassfishrobot Commented mvatkina said: Let's investigate the exceptions...

1. The BaseContainer cathches Throwable in initializeProtocolManager() but I don't see it's message in the log

2. There are NPEs from the CORBA code...

glassfishrobot commented 15 years ago

@glassfishrobot Commented mvatkina said: ...

glassfishrobot commented 15 years ago

@glassfishrobot Commented dkonecny said: One more issue to address: loading of (Remote) StatelessBean should fail even if GF server is not running. That's what contributed to my initial confusion - if test passes when GF is not running then it should pass even if GF is running. But the correct answer is that the test should fail regardless of GF server state with a message "no, no, no, you cannot load remote EJBs". Thx.

glassfishrobot commented 15 years ago

@glassfishrobot Commented mvatkina said: EJB container team disagrees with the last request . If it's possible to test remote interfaces without GF running in parallel, we shouldn't prohibit it.

glassfishrobot commented 15 years ago

@glassfishrobot Commented mvatkina said: I filed separate bugs (10588 and 10589) for the exceptions stack traces.

Added some wording about embedded container (in case it is an embedded container) to the existing RuntimeException thrown by the BaseContainer when ORB can't be initialized. When the other exceptions are gone or become less prominent, there is now a hint on what could've gone wrong.

glassfishrobot commented 15 years ago

@glassfishrobot Commented File: EmbeddableProject-IDE.tar.gz Attached By: dkonecny

glassfishrobot commented 15 years ago

@glassfishrobot Commented File: log.txt Attached By: dkonecny

glassfishrobot commented 15 years ago

@glassfishrobot Commented Issue-Links: depends on GLASSFISH-10588 GLASSFISH-10589

glassfishrobot commented 15 years ago

@glassfishrobot Commented Was assigned to mvatkina

glassfishrobot commented 7 years ago

@glassfishrobot Commented This issue was imported from java.net JIRA GLASSFISH-10527

glassfishrobot commented 15 years ago

@glassfishrobot Commented Reported by dkonecny

glassfishrobot commented 15 years ago

@glassfishrobot Commented Marked as fixed on Monday, October 26th 2009, 12:00:31 pm