Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 951205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:41:48+00:00 2026-05-15T23:41:48+00:00

Scenario: 1) create maven ear project, create war project inside 2) add beans.xml to

  • 0

Scenario:
1) create maven ear project, create war project inside
2) add beans.xml to war project`s WEB-INF/
3) creat simple @Steateless bean

project – http://drp.ly/1j5C3t

ejb bean :

@Stateless
@LocalBean
public class TestEjb {


    @Inject
    Logger log;

    public TestEjb() {
    }

    @Schedule(hour = "*", minute = "*", second = "*/15")
    public void print1Partner() {
        log.info("Yrjaaaa");
        System.out.println("This is test");

    }


}

maven pom-xml of war project :

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>Testo</artifactId>
        <groupId>ua.co.testo</groupId>
        <version>1.0</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>Testo-web</artifactId>

    <packaging>war</packaging>

     <properties>
        <project.build.sourceEncoding>
            UTF-8
        </project.build.sourceEncoding>

        <project.reporting.outputEncoding>
            UTF-8
        </project.reporting.outputEncoding>        
    </properties>



    <dependencies>

        <dependency>
            <groupId>ua.eset.oasys</groupId>
            <artifactId>utopia</artifactId>
            <version>1.0</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>ua.eset.oasys</groupId>
            <artifactId>fenix</artifactId>
            <version>1.0</version>
            <scope>provided</scope>
        </dependency>


        <!-- SL4J API -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.6.0</version>
            <scope>provided</scope>
        </dependency>

        <!-- SLF4J JDK14 Binding  -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-jdk14</artifactId>
            <version>1.6.0</version>
            <scope>provided</scope>
        </dependency>

        <!-- Injectable Weld-Logger -->
        <dependency>
            <groupId>org.jboss.weld</groupId>
            <artifactId>weld-logger</artifactId>
            <version>1.0.0-CR2</version>
            <scope>provided</scope>
        </dependency>
            <!--CDI-->
       <!-- <dependency>
            <groupId>javax.enterprise</groupId>
            <artifactId>cdi-api</artifactId>
            <scope>provided</scope>
            <version>1.0-CR4</version>
        </dependency>-->



        <dependency>
            <groupId>javax.faces</groupId>
            <artifactId>jsf-api</artifactId>
            <version>2.0.2-FCS</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.faces</groupId>
            <artifactId>jsf-impl</artifactId>
            <version>2.0.2-FCS</version>
            <scope>provided</scope>
        </dependency>


        <!--J2EE-->
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-api</artifactId>
            <version>6.0</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>javax.ejb</artifactId>
            <version>3.0</version>
            <scope>provided</scope>
        </dependency>



        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>javax.servlet</artifactId>
            <version>3.0</version>
            <type>jar</type>
            <scope>provided</scope>
        </dependency>


    </dependencies>

    <build>
        <finalName>testo-web</finalName>

        <plugins>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.0.2</version>
                <configuration>
                    <encoding>utf8</encoding>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>

        </plugins>
    </build>

</project>

maven pom.xml of ear project :

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>Testo</artifactId>
        <groupId>ua.co.testo</groupId>
        <version>1.0</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>Testo-ear</artifactId>
    <packaging>ear</packaging>

    <properties>
        <project.build.sourceEncoding>
            UTF-8
        </project.build.sourceEncoding>

        <project.reporting.outputEncoding>
            UTF-8
        </project.reporting.outputEncoding>

    </properties>

    <dependencies>



        <!--weld-->
        <!-- SL4J API -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.6.0</version>
        </dependency>

        <!-- SLF4J JDK14 Binding  -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-jdk14</artifactId>
            <version>1.6.0</version>
        </dependency>

        <!-- Injectable Weld-Logger -->
        <dependency>
            <groupId>org.jboss.weld</groupId>
            <artifactId>weld-logger</artifactId>
            <version>1.0.0-CR2</version>
        </dependency>
<!--
        <dependency>
            <groupId>javax.enterprise</groupId>
            <artifactId>cdi-api</artifactId>

            <version>1.0-CR4</version>
        </dependency>-->

        <dependency>
            <groupId>ua.co.testo</groupId>
            <artifactId>Testo-web</artifactId>
            <version>1.0</version>
            <type>war</type>
        </dependency>


    </dependencies>

    <build>
        <finalName>testo</finalName>
        <plugins>
            <plugin>
                <!--<groupId>org.apache.maven.plugins</groupId>-->
                <artifactId>maven-ear-plugin</artifactId>
                <version>2.4.1</version>
                <configuration>
                    <modules>

                        <webModule>
                            <bundleFileName>testo-web.war</bundleFileName>
                            <groupId>ua.co.testo</groupId>
                            <artifactId>Testo-web</artifactId>
                        </webModule>



                        <!--weld-->
                        <!-- SL4J API -->
                        <jarModule>
                            <groupId>org.slf4j</groupId>
                            <artifactId>slf4j-api</artifactId>
                            <bundleDir>lib</bundleDir>
                        </jarModule>

                        <!-- SLF4J JDK14 Binding  -->
                        <jarModule>
                            <groupId>org.slf4j</groupId>
                            <artifactId>slf4j-jdk14</artifactId>
                            <bundleDir>lib</bundleDir>
                        </jarModule>

                        <!-- Injectable Weld-Logger -->
                        <jarModule>
                            <groupId>org.jboss.weld</groupId>
                            <artifactId>weld-logger</artifactId>
                            <bundleDir>lib</bundleDir>
                        </jarModule>
                        <!--<jarModule>
                            <groupId>javax.enterprise</groupId>
                            <artifactId>cdi-api</artifactId>
                            <bundleDir>lib</bundleDir>
                        </jarModule>-->

                    </modules>
                </configuration>
            </plugin>

        </plugins>

    </build>

</project>

Test case 1 ( Problem ):
deploying project with beans.xml give exception :

[#|2010-07-04T19:36:50.003+0300|WARNING|oracle-glassfish3.0.1|javax.enterprise.system.container.ejb.com.sun.ejb.containers|_ThreadID=33;_ThreadName=Thread-1;|A
system exception occurred during an
invocation on EJB TestEjb method
public void TestEjb.print1Partner()
javax.ejb.EJBException:
javax.ejb.EJBException:
javax.ejb.CreateException: Could not
create stateless EJB at
com.sun.ejb.containers.StatelessSessionContainer._getContext(StatelessSessionContainer.java:448)
at
com.sun.ejb.containers.BaseContainer.getContext(BaseContainer.java:2467)
at
com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:1860)
at
com.sun.ejb.containers.BaseContainer.callEJBTimeout(BaseContainer.java:3962)
at
com.sun.ejb.containers.EJBTimerService.deliverTimeout(EJBTimerService.java:1667)
at
com.sun.ejb.containers.EJBTimerService.access$100(EJBTimerService.java:98)
at
com.sun.ejb.containers.EJBTimerService$TaskExpiredWork.run(EJBTimerService.java:2485)
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at
java.util.concurrent.FutureTask.run(FutureTask.java:138)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at
java.lang.Thread.run(Thread.java:619)
Caused by: javax.ejb.EJBException:
javax.ejb.CreateException: Could not
create stateless EJB at
com.sun.ejb.containers.StatelessSessionContainer$SessionContextFactory.create(StatelessSessionContainer.java:720)
at
com.sun.ejb.containers.util.pool.NonBlockingPool.getObject(NonBlockingPool.java:200)
at
com.sun.ejb.containers.StatelessSessionContainer._getContext(StatelessSessionContainer.java:443)
… 12 more Caused by:
javax.ejb.CreateException: Could not
create stateless EJB at
com.sun.ejb.containers.StatelessSessionContainer.createStatelessEJB(StatelessSessionContainer.java:528)
at
com.sun.ejb.containers.StatelessSessionContainer.access$000(StatelessSessionContainer.java:90)
at
com.sun.ejb.containers.StatelessSessionContainer$SessionContextFactory.create(StatelessSessionContainer.java:718)
… 14 more Caused by:
java.lang.NullPointerException at
java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:768)
at
org.jboss.weld.manager.BeanManagerImpl.getBean(BeanManagerImpl.java:1171)
at
org.jboss.weld.manager.BeanManagerImpl.getBean(BeanManagerImpl.java:132)
at
org.glassfish.weld.services.JCDIServiceImpl._createJCDIInjectionContext(JCDIServiceImpl.java:145)
at
org.glassfish.weld.services.JCDIServiceImpl.createJCDIInjectionContext(JCDIServiceImpl.java:122)
at
com.sun.ejb.containers.BaseContainer.createEjbInstanceAndContext(BaseContainer.java:1616)
at
com.sun.ejb.containers.StatelessSessionContainer.createStatelessEJB(StatelessSessionContainer.java:469)
… 16 more |#]
[#|2010-07-04T19:36:50.004+0300|INFO|oracle-glassfish3.0.1|javax.enterprise.system.container.ejb.com.sun.ejb.containers|_ThreadID=33;_ThreadName=Thread-1;|EJB5119:Expunging
timer
[’13@@1278255602087@@server@@oasys’
‘TimedObject = TestEjb’ ‘Application =
testo’ ‘BEING_DELIVERED’ ‘PERIODIC’
‘Container ID = 83771744647118848’
‘Sun Jul 04 19:36:45 EEST 2010’ ‘0’
‘*/15 # * # * # * # * # * # * # null #
null # null # true # print1Partner #
0’ ] after [2] failed deliveries|#]

[#|2010-07-04T19:37:00.000+0300|INFO|oracle-glassfish3.0.1|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=33;_ThreadName=Thread-1;|This
is test|#]

expecting results:

Yrjaaaa

This is test

results :

Exception

This is test


case 2:
remove beans.xml

expecting results :

Yrjaaaa

This is test

results

Yrjaaaa

This is test

Goal: I want to use ejb weld(CDI) in web project inside ear archive that include some other war & ejb projects, but i don`t wond to separate my web project (war + ejb )

tools & environment : maven & ejb 3.1 & weld & glassfish 3.0.1

Q1: is this could be some kind of specific glassfish bug ?
Q2: what could be a cause of problem?
Q3: is there is some design for such case ?

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T23:41:49+00:00Added an answer on May 15, 2026 at 11:41 pm

    looks like we cant use Injection of weld logger in ejb in a case of glassfish ejb container because of it is ejb container managed bean and it dont see producer

    Current design is to separate ejb and war module – at list it forks for me.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 507k
  • Answers 507k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer There's two general ways to approach this: brute force and… May 16, 2026 at 4:11 pm
  • Editorial Team
    Editorial Team added an answer You can use the ASTACKINFO() function to create an array… May 16, 2026 at 4:11 pm
  • Editorial Team
    Editorial Team added an answer There's a Behavior for that. Personally I find the TranslateBehavior… May 16, 2026 at 4:11 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have a scenario where-in I need to create an uber jar of a
I have a maven POM file for a web service. For one of the
When I create entities in a class library, I tend to add a Tag
Imagine following scenario: We have a lot of parallel development going on in several
I am looking to create n-grams from text column in PostgreSQL. I currently split(on
Ok - I'm pulling my hair out over what I thought was a simple
I have the following scenario. I have a search page which is split into
I would like to create a listbox, with a details pop-up/tooltip kind of window.
I have a scenario where I'm working with large integers (e.g. 160 bit), and
Consider the following scenario: You have an account model You have an external service

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.