[jboss-user] [Security] - Re: java.lang.SecurityException: Denied: caller with subject

sangeetha.gold do-not-reply at jboss.com
Wed Nov 11 06:38:54 EST 2009


Wolfgang,

Thanks a lot. I have re-solved the issue.... As suggested by you, I have created the beans using EJB 2.1 its working now and also ejb-jar.xml file also incorrect. 

To resolve the above issue the ejb-jar.xml file should be as follows:
<?xml version="1.0" encoding="UTF-8"?>

<ejb-jar id="ejb-jar_1" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd" version="2.1">

   <![CDATA[DSBean generated by eclipse wtp xdoclet extension.]]>
   <display-name>DSBean</display-name>

   <enterprise-beans>

      <!-- Session Beans -->
      
         <![CDATA[An EJB named WlConnectors]]>
         <display-name>WlConnectors</display-name>

         <ejb-name>WlConnectors</ejb-name>

         com.test.jboss.WlConnectorsHome
         com.test.jboss.WlConnectors
         <local-home>com.test.jboss.WlConnectorsLocalHome</local-home>
         com.test.jboss.WlConnectorsLocal
         <ejb-class>com.test.jboss.WlConnectorsSession</ejb-class>
         <session-type>Stateless</session-type>
         <transaction-type>Container</transaction-type>

      

      
         <![CDATA[An EJB named MethodConnectors]]>
         <display-name>MethodConnectors</display-name>

         <ejb-name>MethodConnectors</ejb-name>

         com.test.jboss.MethodConnectorsHome
         com.test.jboss.MethodConnectors
         <local-home>com.test.jboss.MethodConnectorsLocalHome</local-home>
         com.test.jboss.MethodConnectorsLocal
         <ejb-class>com.test.jboss.MethodConnectorsSession</ejb-class>
         <session-type>Stateless</session-type>
         <transaction-type>Container</transaction-type>

      

      
         <![CDATA[An EJB named DSConnectors]]>
         <display-name>DSConnectors</display-name>

         <ejb-name>DSConnectors</ejb-name>

         com.test.jboss.DSConnectorsHome
         com.test.jboss.DSConnectors
         <local-home>com.test.jboss.DSConnectorsLocalHome</local-home>
         com.test.jboss.DSConnectorsLocal
         <ejb-class>com.test.jboss.DSConnectorsSession</ejb-class>
         <session-type>Stateless</session-type>
         <transaction-type>Container</transaction-type>

      

     <!--
       To add session beans that you have deployment descriptor info for, add
       a file to your XDoclet merge directory called session-beans.xml that contains
       the  markup for those beans.
     -->

      <!-- Entity Beans -->
     <!--
       To add entity beans that you have deployment descriptor info for, add
       a file to your XDoclet merge directory called entity-beans.xml that contains
       the  markup for those beans.
     -->

      <!-- Message Driven Beans -->
     <!--
       To add message driven beans that you have deployment descriptor info for, add
       a file to your XDoclet merge directory called message-driven-beans.xml that contains
       the <message-driven></message-driven> markup for those beans.
     -->

   </enterprise-beans>

   <!-- Relationships -->

   <!-- Assembly Descriptor -->
     <!--
       To specify your own assembly descriptor info here, add a file to your
       XDoclet merge directory called assembly-descriptor.xml that contains
       the <assembly-descriptor></assembly-descriptor> markup.
     -->

   <assembly-descriptor id="AssemblyDescriptor_1">
     <!--
       To specify additional security-role elements, add a file in the merge
       directory called ejb-security-roles.xml that contains them.
     -->

   <!-- method permissions -->
     <!--
       To specify additional method-permission elements, add a file in the merge
       directory called ejb-method-permissions.ent that contains them.
     -->

   <!-- transactions -->
     <!--
       To specify additional container-transaction elements, add a file in the merge
       directory called ejb-container-transactions.ent that contains them.
     -->

   <!-- finder transactions -->

   <!-- message destinations -->
     <!--
       To specify additional message-destination elements, add a file in the merge
       directory called ejb-message-destinations.ent that contains them.
     -->

   <!-- exclude list -->
     <!--
       To specify an exclude-list element, add a file in the merge directory
       called ejb-exclude-list.xml that contains it.
     -->
     <security-role>
     	<role-name>DSBeanRole</role-name>
	</security-role>
	<security-role>
     	<role-name>ProtectedMethodGroup</role-name>
	</security-role>
		<method-permission>
			<role-name>DSBeanRole</role-name>
			
				<ejb-name>DSConnectors</ejb-name>
				<method-name>*</method-name>
			
		</method-permission>
		<method-permission>
			<role-name>ProtectedMethodGroup</role-name>
			
				<ejb-name>MethodConnectors</ejb-name>
				<method-name>getUserId</method-name>
			
		</method-permission>
		<method-permission>
			
			
				<ejb-name>MethodConnectors</ejb-name>
				<method-name>create</method-name>
			
		</method-permission>
		<method-permission>
			
			
				<ejb-name>WlConnectors</ejb-name>
				<method-name>*</method-name>
			
		</method-permission>
		<container-transaction>
			
				<ejb-name>MethodConnectors</ejb-name>
				<method-name>*</method-name>
			
			<trans-attribute>Required</trans-attribute>
		</container-transaction>
   </assembly-descriptor>

</ejb-jar>

Thanks & Regards,
Sangeetha



View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4265006#4265006

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4265006



More information about the jboss-user mailing list