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 9133169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:26:27+00:00 2026-06-17T08:26:27+00:00

I need to write a stateless session bean which I want to deploy to

  • 0

I need to write a stateless session bean which I want to deploy to WLS 10.3.3. The session bean should be able to send a text message to a known JMS queue which is created through the WLS console. Therefore i wrote the following code:

package com.mycompany.ejb;

import javax.annotation.Resource;
import javax.ejb.*;
import javax.jms.*;

@Stateless
@TransactionManagement(TransactionManagementType.CONTAINER)
public class MyEjb{

    @Resource(name = "jmsConnectionFactory")
    private ConnectionFactory jmsConnectionFactory;
    @Resource(name = "queue1")
    private Destination queue1;

    public MyEjb(){}

    public void sendMsgToQueue(String payload, ConnectionFactory connFactory, Destination destination) throws Exception{
        if(payload == null)
            throw new IllegalArgumentException("Message payload is null");
        if(connFactory == null)
            throw new IllegalArgumentException("Connection factory is null");
        if(destination == null)
           throw new IllegalArgumentException("Message destination is null");

        Connection connection = connFactory.createConnection();
        Session session = connection.createSession(true, Session.SESSION_TRANSACTED);
        MessageProducer messageProducer = session.createProducer(destination);
        TextMessage textMessage = session.createTextMessage();
        textMessage.setText(payload);
        messageProducer.send(textMessage);
    }

}

What I need to do now is to provide a valid weblogic-ejb-jar.xml with a resource-ref to jndi-name mapping. Could someone please provide an example for weblogic-ejb-jar.xml with the following mapping:

  • jmsConnectionFactory should be bound to a connection factory with jndi-name com.mycompany.jmsXAConnFactory
  • queue1 should be bound to a queue with jndi-name com.mycompany.jmsQueue1
  • 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-06-17T08:26:28+00:00Added an answer on June 17, 2026 at 8:26 am

    weblogic-ejb-jar.xml that worked for me:

    <?xml version='1.0' encoding='UTF-8'?>
    <weblogic-ejb-jar xmlns="http://xmlns.oracle.com/weblogic/weblogic-ejb-jar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                      xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-ejb-jar http://xmlns.oracle.com/weblogic/weblogic-ejb-jar/1.0/weblogic-ejb-jar.xsd ">
        <weblogic-enterprise-bean>
            <ejb-name>MyEjb</ejb-name>
            <stateless-session-descriptor></stateless-session-descriptor>
            <resource-description>
                <res-ref-name>jmsConnectionFactory</res-ref-name>
                <jndi-name>com.mycompany.jmsXAConnFactory</jndi-name>
            </resource-description>
            <resource-env-description>
                <resource-env-ref-name>queue1</resource-env-ref-name>
                <jndi-name>com.mycompany.jmsQueue1</jndi-name>
            </resource-env-description>
        </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to write a session bean that somewhere in the code checks if
I need to read and write xml files to disk from a stateless session
I need to write a script in Matlab, which will read some data from
I need to write to a text file using JavaScript. I have a machine
I need write a console application like as hiren boot screen: alt text http://xahoithongtin.com.vn/Images/diembao/2006_10/Hiren2.jpg
As we write Range(A4) as Cell(1,4).How should I need write Range(A2:AB256) into Cell format?
I need to write a extended version of the StringUtils.commaDelimitedListToStringArray function which gets an
Need to write a SQL query to search special character in a column. Text
I know that stateless bean doesn't maintain conversational state but what I need is
I need write an update statement that used multiple tables to determine which rows

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.