1

I am migrating from Seam 3 to DeltaSpike on WildFly 8 (Java EE 7). What is the equivalent DeltaSpike file to Seam's seam-beans.xml? Could you tell me any more info?

Edit:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:j="urn:java:ee" xmlns:s="urn:java:seam:core" xmlns:c="urn:java:xxx.xxxxxxxxx.core.model">

    <c:Configuration>
        <j:modifies />
        <c:tradingEnabled>false</c:tradingEnabled>
        <c:defaultCurrency>USD</c:defaultCurrency>
        <c:defaultPeriodLength>300000</c:defaultPeriodLength>
        <c:updateTime>5</c:updateTime>
    </c:Configuration>
    ....

This what I did with seam-beans.xml, which did not work for me in beans.xml (values are not injected).

Thanks

mitchkman
  • 6,201
  • 8
  • 39
  • 67
  • Depends on what's in there. EE7 has made `beans.xml` optional. Every war/ear you deploy is a bean archive as far as CDI is concerned. – mabi Feb 24 '14 at 11:14
  • seam-beans.xml != beans.xml – mitchkman Feb 25 '14 at 19:03
  • Well, yes. You were asking about the equivalent in CDI. I'm just saying the equivalent is `beans.xml` and it's largely made optional. – mabi Feb 25 '14 at 19:05
  • Hi mabi, yes you are completely right. But I was asking for the DeltaSpike equivalent file to seam-beans.xml and DeltaSpike is not CDI. – mitchkman Feb 25 '14 at 21:26
  • Yeah, I should've been more verbose. The DeltaSpike frontpage says: "DeltaSpike consist of a number of portable CDI extensions". It's really just a pack of classes on top of CDI (Weld in your case). And that gets configured via `beans.xml` (or with Wildfly: also by the lack of it). Thus my first sentence: if you show us what you have in your old file, we can tell you what to put in your `beans.xml`. – mabi Feb 25 '14 at 21:37
  • Hi mabi, thanks. I've updated the question above with a seam-beans.xml snippet. – mitchkman Feb 25 '14 at 22:15
  • DeltaSpike is all about type-safe configs - no XML. You can implement your own org.apache.deltaspike.core.spi.config.ConfigSource for your own XML configs. – Dar Whi Feb 27 '14 at 12:22

1 Answers1

1

You need to create a producer and put these values in a normal properties file instead. Look at @Produces

This should probably have been tagged CDI too because some problems you solved with Seam is of course solved directly with CDI core and not Deltaspike.

This example will get you there: Depedency inject request parameter with CDI and JSF2

Instead of producing from the request parameter map you will produce from your resourceBundle.

I also think deltaspike may have a functionality for this either done or in the works but it would be good practice for you to write this producer and it is very minimal anyways

Community
  • 1
  • 1
Karl Kildén
  • 2,415
  • 22
  • 34