[EJB 3.0] - Re: Why cant JBoss 4.0.4 GA deploy these Beans?
by jnorris10
"bill.burke(a)jboss.com" wrote : You can break the circular dependency by adding the @IgnoreDependency annotation to the injected @EJB
|
|
| | @Stateless
| | public class MyBean implements ... {
| |
| | @EJB
| | @IgnoreDependency
| | private AnotherEJB another;
| |
| | }
| |
| |
|
| Or use the XML version.
|
|
| | <jboss>
| | <enterprise-beans>
| | <session>
| | <ejb-name>Session1Bean</ejb-name>
| | <ejb-ref>
| | <ejb-ref-name>session2</ejb-ref-name>
| | <ignore-dependency/>
| | </ejb-ref>
| | </session>
| | </enterprise-beans>
| | </jboss>
| |
| |
|
The EJB3 spec doesn't seem to have anything to say about this. I have a few circular dependencies in my code (for which the JBoss solution of @IgnoreDependency works really well) but I am wondering should they be refactored out, or is circular injection a conceptually valid thing to do?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4089093#4089093
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4089093
18 years, 7 months
[JBoss Seam] - Unable to bootstrap testNG...
by joeyxxx
I'm trying to run the basic testng cases generated by seam-gen and I get the errors embedded below. Besides modifying build.xml to get the target to run, I haven't changed any test related stuff.
My project is just a vanilla Seam 2(cvs 09/24/07) project on AS 4.2 and jdk 1.5_07. I saw a few other posts about a problem like mine but what I gathered was that, the users were running Java 6 which had some incompatibilities with jboss-embedded-all.
|
| compiletest:
| [javac] Compiling 121 source files to /Users/goldfinger/Projects/Test-Build
| [javac] Note: Some input files use unchecked or unsafe operations.
| [javac] Note: Recompile with -Xlint:unchecked for details.
|
| copytestclasses:
|
| buildtest:
| [copy] Copying 1 file to /Users/goldfinger/Projects/Test-Build/META-INF
| [copy] Copying 1 file to /Users/goldfinger/Projects/Test-Build
|
| test:
| [testng] [Parser] Running:
| [testng] /Users/goldfinger/Projects/Test-Build/AccountServicesTest.xml
| [testng] /Users/goldfinger/Projects/Test-Build/BalancesActionTest.xml
| [testng] /Users/goldfinger/Projects/Test-Build/ControlPanelTest.xml
| [testng] /Users/goldfinger/Projects/Test-Build/HistoryActionTest.xml
| [testng] /Users/goldfinger/Projects/Test-Build/PositionsActionTest.xml
| [testng] /Users/goldfinger/Projects/Test-Build/RegisterTest.xml
| [testng] /Users/goldfinger/Projects/Test-Build/RequestStatusTest.xml
| [testng] /Users/goldfinger/Projects/Test-Build/UserHelperTest.xml
| [testng] /Users/goldfinger/Projects/Test-Build/UserProfileActionTest.xml
| [testng] /Users/goldfinger/Projects/Test-Build/WsodGatewayTest.xml
|
| [testng] WARN 26-09 17:23:13,677 [org.jboss.mx.loading.UnifiedLoaderRepository3.addClassLoader():675] Tried to add non-URLClassLoader. Ignored
| [testng] ERROR 26-09 17:23:13,690 [org.jboss.dependency.plugins.AbstractController.incrementState():350] Error installing to Start: name=JMXKernel state=Create
| [testng] java.lang.NoSuchMethodError: org.jboss.system.ServiceController.setKernel(Lorg/jboss/kernel/Kernel;)V
| [testng] at org.jboss.embedded.adapters.JMXKernel.start(JMXKernel.java:160)
| [testng] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| [testng] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| [testng] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| [testng] at java.lang.reflect.Method.invoke(Method.java:585)
| [testng] at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:55)
| [testng] at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:107)
| [testng] at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
| [testng] at org.jboss.kernel.plugins.dependency.KernelControllerContextActions.dispatchJoinPoint(KernelControllerContextActions.java:100)
| [testng] at org.jboss.kernel.plugins.dependency.KernelControllerContextActions$LifecycleAction.installAction(KernelControllerContextActions.java:582)
| [testng] at org.jboss.kernel.plugins.dependency.KernelControllerContextActions$KernelControllerContextAction.install(KernelControllerContextActions.java:175)
| [testng] at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
| [testng] at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:226)
| [testng] at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:593)
| [testng] at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:346)
| [testng] at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:438)
| [testng] at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:379)
| [testng] at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:225)
| [testng] at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:151)
| [testng] at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBean(AbstractKernelDeployer.java:291)
| [testng] at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBeans(AbstractKernelDeployer.java:261)
| [testng] at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deploy(AbstractKernelDeployer.java:117)
| [testng] at org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer.deploy(BeanXMLDeployer.java:95)
| [testng] at org.jboss.embedded.Bootstrap.deployBaseBootstrapUrl(Bootstrap.java:150)
| [testng] at org.jboss.embedded.Bootstrap.bootstrapURL(Bootstrap.java:162)
| [testng] at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:201)
| [testng] at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:214)
| [testng] at org.jboss.seam.mock.EmbeddedBootstrap.startAndDeployResources(EmbeddedBootstrap.java:11)
| [testng] at org.jboss.seam.mock.BaseSeamTest.startJbossEmbeddedIfNecessary(BaseSeamTest.java:968)
| [testng] at org.jboss.seam.mock.BaseSeamTest.init(BaseSeamTest.java:893)
| [testng] at org.jboss.seam.mock.SeamTest.init(SeamTest.java:42)
| [testng] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| [testng] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| [testng] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| [testng] at java.lang.reflect.Method.invoke(Method.java:585)
| [testng] at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:604)
| [testng] at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:394)
| [testng] at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:142)
| [testng] at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:79)
| [testng] at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:165)
| [testng] at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:103)
| [testng] at org.testng.TestRunner.runWorkers(TestRunner.java:678)
| [testng] at org.testng.TestRunner.privateRun(TestRunner.java:624)
| [testng] at org.testng.TestRunner.run(TestRunner.java:495)
| [testng] at org.testng.SuiteRunner.runTest(SuiteRunner.java:300)
| [testng] at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:295)
| [testng] at org.testng.SuiteRunner.privateRun(SuiteRunner.java:275)
| [testng] at org.testng.SuiteRunner.run(SuiteRunner.java:190)
| [testng] at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:792)
| [testng] at org.testng.TestNG.runSuitesLocally(TestNG.java:765)
| [testng] at org.testng.TestNG.run(TestNG.java:699)
| [testng] at org.testng.TestNG.privateMain(TestNG.java:824)
| [testng] at org.testng.TestNG.main(TestNG.java:802)
| [testng] FAILED CONFIGURATION: @BeforeClass init
| [testng] java.lang.RuntimeException: Unable to bootstrap:
| [testng] at org.jboss.embedded.Bootstrap.bootstrapURL(Bootstrap.java:167)
| [testng] at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:201)
| [testng] at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:214)
| [testng] at org.jboss.seam.mock.EmbeddedBootstrap.startAndDeployResources(EmbeddedBootstrap.java:11)
| [testng] at org.jboss.seam.mock.BaseSeamTest.startJbossEmbeddedIfNecessary(BaseSeamTest.java:968)
| [testng] at org.jboss.seam.mock.BaseSeamTest.init(BaseSeamTest.java:893)
| [testng] at org.jboss.seam.mock.SeamTest.init(SeamTest.java:42)
| [testng] Caused by: org.jboss.kernel.spi.registry.KernelRegistryEntryNotFoundException: Entry not found with name: MainDeployer
| [testng] at org.jboss.kernel.plugins.registry.AbstractKernelRegistry.getEntry(AbstractKernelRegistry.java:89)
| [testng] at org.jboss.embedded.Bootstrap.bootstrapURL(Bootstrap.java:163)
| [testng] ... 28 more
| [testng] ... Removed 22 stack frames
| [testng] SKIPPED CONFIGURATION: @BeforeMethod begin
| [testng] SKIPPED CONFIGURATION: @AfterMethod end
| [testng] SKIPPED CONFIGURATION: @AfterClass cleanup
| [testng] SKIPPED: test
|
| [testng] ===============================================
| [testng] AccountServices Test
| [testng] Tests run: 1, Failures: 0, Skips: 1
| [testng] Configuration Failures: 1, Skips: 3
| [testng] ===============================================
|
|
| [testng] ===============================================
| [testng] AccountServices Tests
| [testng] Total tests run: 1, Failures: 0, Skips: 1
| [testng] Configuration Failures: 1, Skips: 3
| [testng] ===============================================
|
| [testng] FAILED CONFIGURATION: @BeforeClass init
| [testng] java.lang.RuntimeException: Unable to bootstrap:
| [testng] at org.jboss.embedded.Bootstrap.bootstrapURL(Bootstrap.java:167)
| [testng] at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:201)
| [testng] at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:214)
| [testng] at org.jboss.seam.mock.EmbeddedBootstrap.startAndDeployResources(EmbeddedBootstrap.java:11)
| [testng] at org.jboss.seam.mock.BaseSeamTest.startJbossEmbeddedIfNecessary(BaseSeamTest.java:968)
| [testng] at org.jboss.seam.mock.BaseSeamTest.init(BaseSeamTest.java:893)
| [testng] at org.jboss.seam.mock.SeamTest.init(SeamTest.java:42)
| [testng] Caused by: java.lang.IllegalStateException: Already installed ServerConfig
| [testng] at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:149)
| [testng] at org.jboss.kernel.plugins.dependency.AbstractKernelController.install(AbstractKernelController.java:79)
| [testng] at org.jboss.embedded.Bootstrap.bootstrapURL(Bootstrap.java:161)
| [testng] ... 28 more
| [testng] ... Removed 22 stack frames
| [testng] SKIPPED CONFIGURATION: @BeforeMethod begin
| [testng] SKIPPED CONFIGURATION: @AfterMethod end
| [testng] SKIPPED CONFIGURATION: @AfterClass cleanup
| [testng] SKIPPED: test
|
| [testng] ===============================================
| [testng] BalancesAction Test
| [testng] Tests run: 1, Failures: 0, Skips: 1
| [testng] Configuration Failures: 1, Skips: 3
| [testng] ===============================================
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4089088#4089088
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4089088
18 years, 7 months
[JBoss Seam] - FacesMessage not showing up
by stephen.friedrich
By default EntityHome throws an exception if an entity cannot be found.
(For example when somebody else already deleted an entity and you want to edit it.)
I managed to get rid of that exception by overriding handleNotFound in my EntityHomes:
| protected T handleNotFound() {
| setId(null);
| T instance = createInstance();
| setInstance(instance);
|
| getFacesMessages().add( SEVERITY_INFO, "Object has already been deleted.");
| return instance;
| }
|
The only problem is that the message never makes it to the result page (same as originating page). No errors in the log. No nothing.
The edit that caused the call to handleNotFound is triggered like this:
| <s:link view="/departments.xhtml">
| <f:param name="departmentId" value="#{department.id}"/>
| <img src="images/edit.gif" alt="#{department.id}" border="0"/>
| </s:link>
|
The default messages (like "Successfully updated") _are_ shown.
What am I doing wrong? (Seam 1.2.1)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4089083#4089083
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4089083
18 years, 7 months
[JBoss Seam] - Can I manually commit a Transaction?
by JakeC
In my Seam app, I upload a file, create a record for it in the DB, persist() and flush() it, then move the file to a folder for processing.
The problem is that sometimes my file processing application gets the file before the record is visible in the DB.
There isn't anything else happening in the method after moving the file, but apparently, Seam isn't quite speedy enough on committing the Transaction.
There is no @PostCommit event, and @PostPersist is still too early. What I'd like to do is just commit the Transaction, then move the file. However, entityManager.getTransaction() throws "java.lang.IllegalStateException: JTA EntityManager cannot access a transactions".
How do I move my files after the Transaction is committed? All I can really think of is manually committing the Transaction, but that doesn't seem to be allowed. Is there a way to do it? I don't want ALL my Transactions to require manual commit, just this one instance. Do I need to create a second core:managed-persistence-context in components.xml that points to a different persistence-unit in persistence.xml?
Or is there some other way of doing this? I've seen the @Asynchronous annotation. If I call a method annotated with this from within a Transaction, am I guaranteed that it won't be triggered until after the Transaction has committed?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4089082#4089082
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4089082
18 years, 7 months
[JBoss Seam] - Trinidad Support?
by smithbstl
I know there is an example of Trinidad in the examples but how good is Trinidad support?
I went down the Trinidad road with seam before Trinidad had a real release (using JSF 1.1) and found it to a headache. I moved to Rich Faces which made my life much easier.
I now find myself in need of a couple of components that Trinidad offers (ie Multi-Select Tables)
Does anyone have any real apps that use both libraries? Are there any pitfalls to watch out for? Or do the component sets play nicely together?
Also is there any way to skin trinidad components to look consistent with Rich Faces? I suppose I will have to create a custom skin for trinidad that tries to resemble RF.
Thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4089081#4089081
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4089081
18 years, 7 months