Deploy ejb in netbeans using jboss

I would like to know the steps to deploy ejb using jboss in netbeans..or please suggest a site which gives the detailed steps for deployment.
Thank you

Google

Similar Messages

  • How to Struts and Spring in NetBeans using Jboss

    Hi Every One,
    I have a some basic Knowledge in Struts Spring and Hibernate. I already worked in it with Eclipse IDE in WebSphere Server...
    But Now i want to How to Use Struts Spring and Hibernate in NetBeans using JBoss i need that Folder Structure like that Stuffs
    Can Anybody Help Me for this

    Google

  • Unable to deploy EJB 3.0 on JBoss 4.0.4GA - no home interface

    I am stuck in that my EJB3.0 project (one entity bean, one session bean and one client test bean) builds OK but somehow Eclipse Europa is unable to deploy it to JBoss (4.0.4 GA and 5 Beta) -- something to do with JNDI error as it involves javax.naming exceptions.
    My Eclipse directory structure is :-
    Titan (project name)
    |
    ejb - com.titan (package name)
    | |
    | domain -> Cabin.java (my entity bean)
    | |
    | travelagent -> TravelAgentBean.java
    | -> TravelAgentRemote.java
    |
    META_INF -> ejb-jar.xml
    -> MANIFEST.MF
    -> persistence.xml
    My ejb-jar.xml is :
    <?xml version="1.0" encoding="UTF-8"?>
    <ejb-jar id="ejb-jar_ID" version="2.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">
    <display-name>Titan</display-name>
    <enterprise-beans>
    <!-- Session Beans -->
    <session >
    <display-name>TravelAgentBean</display-name>
    <ejb-name>com/titan/travelagent/ejb/TravelAgentBean</ejb-name>
    <remote>com.titan.travelagent.ejb.TravelAgentRemote</remote>
    <ejb-class>com.titan.travelagent.ejb.TravelAgentBean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    </session>
    </enterprise-beans>
    </ejb-jar>
    And my persistence.xml is :
    <?xml version="1.0" encoding="UTF-8"?>
    <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
    <persistence-unit name="Titan">
    <provider>org.hibernate.ejb.HibernatePersistence</provider>
    <class>com.titan.domain.Cabin</class>
    <properties>
    <property name="hibernate.connection.driver_class" value="oracle.jdbc.OracleDriver" />
    <property name="hibernate.connection.url"
    value="jdbc:oracle:thin:@localhost:1521:XE" />
    <property name="hibernate.connection.username" value="SYSTEM" />
    <property name="hibernate.connection.password" value="Swordfish1" />
    </properties>
    </persistence-unit>
    </persistence>
    I right-click on the Titan project name and choose Build Project. I get the following error message :-
    13:01:06,046 WARN [verifier] EJB spec violation:
    Bean : com/titan/travelagent/TravelAgentBean
    Section: 7.11.2
    Warning: A Session bean must implement, directly or indirectly, the javax.ejb.SessionBean interface.
    13:01:06,046 WARN [verifier] EJB spec violation:
    Bean : com/titan/travelagent/TravelAgentBean
    Section: 7.11.3
    Warning: A Session bean must define at least one ejbCreate method.
    13:01:06,046 WARN [verifier] EJB spec violation:
    Bean : com/titan/travelagent/TravelAgentBean
    Section: 7.11.1
    Warning: The session bean must implement either a remote home and remote, or a local home and a local interface or a service endpoint interface.
    13:01:06,062 ERROR [MainDeployer] Could not create deployment: file:/C:/jboss-4.0.4.GA/server/default/deploy/Titan.jar
    I don't understand, because as of EJB 3.0, you don't really need a home or local-home interface anymore...

    Using @SecurityDomain("exemplo1") in my EJB and NOT providing jboss.xml, it works.
    @SecurityDomain("exemplo1")
    @RolesAllowed("yyy")
    @Stateless(name="UserManagement")
    public class UserManagementBean implements UserManagement {
      public void add(User user) {
    }Damn! This is some serious shit... I don�t want to configure this in every single EJB.
    EJB 3.0 is nice, but some small trivial details like this and others, that was forgotten by Sun, piss me off!

  • [UNSOLVED] deploy ejb-jsf application to jboss

    I have developed a very simple web application with jdev 10.1.3.1 j2ee edition (no adf). The application uses ejb 3.0 and jsf technology.
    The application follows the pattern of the ‘Java EE tutorial’ at this url:
    http://www.oracle.com/technology/obe/JavaEE_tutorial_10131/index.htm ,
    but it is much simpler and I don’t use security mechanisms.
    For instance I use a session façade.
    The application has two projects: Model and ViewController. To deploy the application I created an ejb jar deployment profile for the model project and a war deployment profile for the ViewController. Then I created a new ‘Deployment’ project with an ear deployment profile to assemble the ejb jar and war deployment profiles. In this way I was able to deploy to standalone oc4j.
    Now I want to deploy to jboss 4.0.4 GA, I mapped the jboss connection within jdev and selected ‘deploy to jboss’. The ear is transferred to the correct folder, but the application folder is not generated and the jboss log shows at least one error. As you can see below, it seems it expects the local-home tag for the session façade, but I deleted it as suggested in the tutorial.
    I really need help on this topic, thank you.
    Mauro
    2006-12-01 16:20:51,250 WARN [org.jboss.util.NestedThrowable] Duplicate throwable nesting of same base type: class org.jboss.deployment.DeploymentException is assignable from: class org.jboss.deployment.DeploymentException
    2006-12-01 16:20:51,250 DEBUG [org.jboss.web.tomcat.tc5.Tomcat5] Problem in init
    org.jboss.deployment.DeploymentException: Failed to parse WEB-INF/web.xml; - nested throwable: (org.jboss.deployment.DeploymentException: expected one local-home tag)
         at org.jboss.web.AbstractWebContainer.parseMetaData(AbstractWebContainer.java:749)
         at org.jboss.web.AbstractWebContainer.init(AbstractWebContainer.java:356)
    Message was edited by:
    mauro avon

    <?xml version = '1.0' encoding = 'windows-1252'?>
    <web-app 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/web-app_2_4.xsd" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee">
    <description>Empty web.xml file for Web Application</description>
    <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    <session-config>
    <session-timeout>35</session-timeout>
    </session-config>
    <mime-mapping>
    <extension>html</extension>
    <mime-type>text/html</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>txt</extension>
    <mime-type>text/plain</mime-type>
    </mime-mapping>
    <jsp-config/>
    <ejb-local-ref>
    <ejb-ref-name>ejb/ProvaScrFacade</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <local>provascr.business.ProvaScrFacadeLocal</local>
    <ejb-link>ProvaScrFacade</ejb-link>
    </ejb-local-ref>
    </web-app>

  • Failure When Deploying EJB Project That Uses Library Onto Glassfish

    <font size=4>Hi,
    I have a multi project application that I am developing and I am having issues testing it. I have set up a EAR, WAR, EJB, and two library JARs. The EJB contains classes that use components from the library JARs or implement abstract classes from the library JARs. I have added the library JARs to the compile-time libraries of the EJB. I then also added the library JARs to the libraries of the EAR. However when I then go to deploy the EAR onto the Glassfish server I get this error, displayed in the Glassfish log:</font><br>
    <font size=2><font color="red">WARNING: Error in annotation processing: java.lang.NoClassDefFoundError: com/foo/sdk/core/AbstractClass</font><br>
    <font color="red">WARNING: Error in annotation processing: java.lang.NoClassDefFoundError: com/foo/sdk/core/AbstractClass</font><br>
    <font color="red">WARNING: Error in annotation processing: java.lang.NoClassDefFoundError: com/foo/sdk/core/AbstractClass</font><br>
    <font color="red">WARNING: Error in annotation processing: java.lang.NoClassDefFoundError: com/foo/sdk/core/AbstractClas</font><br>
    <font color="red">SEVERE: Class [ com/foo/sdk/core/InterfaceClass ] not found. Error while loading [ class com.foo2.BeanFooClass ]</font><br>
    <font color="red">SEVERE: Exception while deploying the app [FooEAR]</font><br>
    <font color="red">SEVERE: Invalid ejb jar [BeanFoo.jar]: it contains zero ejb. </font><br>
    Note:
    1. A valid ejb jar requires at least one session, entity (1.x/2.x style), or message-driven bean.
    2. EJB3+ entity beans (@Entity) are POJOs and please package them as library jar.
    3. If the jar file contains valid EJBs which are annotated with EJB component level annotations (@Stateless, @Stateful, @MessageDriven, @Singleton), please check server.log to see whether the annotations were processed properly.
    java.lang.IllegalArgumentException: Invalid ejb jar [BeanFoo.jar]: it contains zero ejb.
    Note:
    1. A valid ejb jar requires at least one session, entity (1.x/2.x style), or message-driven bean.
    2. EJB3+ entity beans (@Entity) are POJOs and please package them as library jar.
    3. If the jar file contains valid EJBs which are annotated with EJB component level annotations (@Stateless, @Stateful, @MessageDriven, @Singleton), please check server.log to see whether the annotations were processed properly.
         at com.sun.enterprise.deployment.util.EjbBundleValidator.accept(EjbBundleValidator.java:76)
         at com.sun.enterprise.deployment.util.ApplicationValidator.accept(ApplicationValidator.java:128)
         at com.sun.enterprise.deployment.EjbBundleDescriptor.visit(EjbBundleDescriptor.java:730)
         at com.sun.enterprise.deployment.Application.visit(Application.java:1768)
         at com.sun.enterprise.deployment.archivist.ApplicationArchivist.validate(ApplicationArchivist.java:799)
         at com.sun.enterprise.deployment.archivist.ApplicationArchivist.openWith(ApplicationArchivist.java:277)
         at com.sun.enterprise.deployment.archivist.ApplicationFactory.openWith(ApplicationFactory.java:240)
         at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:170)
         at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:93)
         at com.sun.enterprise.v3.server.ApplicationLifecycle.loadDeployer(ApplicationLifecycle.java:826)
         at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:768)
         at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:368)
         at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
         at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:370)
         at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:355)
         at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:370)
         at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1067)
         at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:96)
         at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1247)
         at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)
         at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:465)
         at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:222)
         at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:168)
         at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
         at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:234)
         at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:822)
         at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719)
         at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1013)
         at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
         at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
         at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
         at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
         at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
         at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
         at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
         at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
         at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
         at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
         at java.lang.Thread.run(Thread.java:679)
    <font color="red">SEVERE: Exception while deploying the app [FooEAR] : Invalid ejb jar [FooBean.jar]: it contains zero ejb. </font><br>
    Note:
    1. A valid ejb jar requires at least one session, entity (1.x/2.x style), or message-driven bean.
    2. EJB3+ entity beans (@Entity) are POJOs and please package them as library jar.
    3. If the jar file contains valid EJBs which are annotated with EJB component level annotations (@Stateless, @Stateful, @MessageDriven, @Singleton), please check server.log to see whether the annotations were processed properly.</font><br>
    <font size=4>I am using these technologies:
    NetBeans IDE 7.0 for Java EE
    Glassfish 3.1
    I did read that putting the libraries in this directory: <glassfish_home>/domains/domain1/lib may resolve the problem, however there must be a better way.
    Any help would be greatly appreciated!</font>
    Edited by: 866180 on Jun 15, 2011 2:32 PM

    First of all, use a normal font when posting a question. This is just terrible to read.
    You have multiple failures here. Did you actually read and try to understand the error?
    java.lang.NoClassDefFoundError: com/foo/sdk/core/AbstractClassJava is not going to lie, this class is not on the classpath of the application. Either the jar is missing, the class is missing from the jar or you put the jar in the wrong place. Open up the ear using your favorite zip tool and check out its structure. What is the path to the jar inside it?
    Also, open up the META-INF/manifest.mf file inside the EJB jar. Is there a class-path line in there? There shouldn't be!
    A valid ejb jar requires at least one session, entity (1.x/2.x style), or message-driven bean. Apparently your EJB jar contains not a single EJB or MDB class. Did you forget some annotations perhaps?
    Seems to me that your application compiles, but other than that it is very much broken.

  • Why i canot deploy cd.jar when using JBoss on linux

    Hi,friends
    I have successfully deploy the interest.jar on my linux box.But when deploying cd.jar it tells me that "Could not deploy file:/usr/local/JBoss-2.4.3_Tomcat-3.2.3/jboss/tmp/deploy/Default/cd.jar,
    Cause:org.jboss.ejb.DeploymentException: Bean com.web_tomorrow.cd.CDBean not found within this application."
    The source directory is described as below:
    src
    |_com
    | |_web_tomorrow
    | |_cd
    | | (CD.class,CDBean.class,CDHome.class,
    | | CDCollection.class,
    | | CDCollectionBean.class,
    | | CDCollectionHome.class,
    | | CDExistsException.class)
    | |_jspcd
    | |_utils()
    |_MATA-INF
    | (ejb-jar.xml,jboss.xml)
    |_WEB_INF
    On src directory
    #jar -cvf cd.jar com/web_tomorrow/cd/*.class \
    com/web_tomorrow/utils/*.class META-INF/
    When i cp the cd.jar to deploy directory jboss automatically begin deploying the cd.jar and echo the above message and stop deploying.
    Here is my configuration file:
    [ejb-jar.xml]
    <?xml version="1.0" encoding="Cp1252"?>
    <ejb-jar>
    <display-name>MusicCDs</display-name>
    <enterprise-beans>
    <entity>
    <description>Models a music CD</description>
    <ejb-name>CDBean</ejb-name>
    <home>com.web_tomorrow.cd.CDHome</home>
    <remote>com.web_tomorrow.cd.CD</remote>
    <ejb-class>com.web_tomorrow.cd.CDBean</ejb-class>
    <persistence-type>Container</persistence-type>
    <prim-key-class>java.lang.String</prim-key-class>
    <reentrant>False</reentrant>
    <cmp-field><field-name>id</field-name></cmp-field>
    <cmp-field><field-name>title</field-name></cmp-field>
    <cmp-field><field-name>artist</field-name></cmp-field>
    <cmp-field><field-name>type</field-name></cmp-field>
    <cmp-field><field-name>notes</field-name></cmp-field>
    <primkey-field>id</primkey-field>
    </entity>
    <session>
    <description>Models a music CD collection</description>
    <ejb-name>CDCollectionBean</ejb-name>
    <home>com.web_tomorrow.cd.CDCollectionHome</home>
    <remote>com.web_tomorrow.cd.CDCollection</remote>
    <ejb-class>com.web_tomorrow.cd.CDCollectionBean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Bean</transaction-type>
    <ejb-ref>
    <ejb-ref-name>ejb/CD</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <home>com.web_tomorrow.cd.CDHome</home>
    <remote>com.web_tomorrow.cd.CD</remote>
    <ejb-link>com.web_tomorrow.cd.CDBean</ejb-link>
    </ejb-ref>
    </session>
    </enterprise-beans>
    <assembly-descriptor>
    <container-transaction>
    <method>
    <ejb-name>CDBean</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
    </ejb-jar>
    [jboss.xml]
    <?xml version="1.0" encoding="Cp1252"?>
    <jboss>
    <secure>false</secure>
    <container-configurations />
    <resource-managers />
    <enterprise-beans>
    <session>
    <ejb-name>CDCollectionBean</ejb-name>
    <jndi-name>cd/CDCollection</jndi-name>
    <configuration-name></configuration-name>
    </session>
    <entity>
    <ejb-name>CDBean</ejb-name>
    <jndi-name>cd/CD</jndi-name>
    <configuration-name></configuration-name>
    </entity>
    </enterprise-beans>
    </jboss>
    I am frustrated now! Any help is greatly appreciated!
    Best Regards!

    $(jboss_home)/log/server.log told me that i should have a look at Container.java first.So i openned it and found the following code snippet:
    Logger.debug("Binding an EJBReference "+ref.getName());
    if (ref.getLink() != null) {
    // Internal link
    Logger.debug("Binding "+ref.getName()+" to internal JNDI source: "+ref.getLink());
    Container refContainer = getApplication().getContainer(ref.getLink());
    if (refContainer == null)
    throw new DeploymentException ("Bean "+ref.getLink()+" not found within this application.");
    OK,the DeploymentException is thrown because the refContainer is null.
    Have a look at getContainer method below:
    public Container getContainer(String name)
    return (Container)containers.get(name);
    where,
    containers is a HashMap which holds the mapping between ejbName and container.So the reason is the jboss cannot find corresponding container from the given parameter - name.Its value is ref.getLink()'s return value,com.web_tomorrow.cd.CDBean.
    open the ejb-jar.xml,i found link is defined as below:
    <ejb-ref>
    <ejb-ref-name>ejb/CD</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <home>com.web_tomorrow.cd.CDHome</home>
    <remote>com.web_tomorrow.cd.CD</remote>
    <ejb-link>com.web_tomorrow.cd.CDBean</ejb-link> <- wrong
    </ejb-ref>
    After i changed it to <ejb-link>CDBean</ejb-link> the jboss can deploy cd.jar normally.
    The problem itself isnot complicate but it demonstrated that the open source is good for you to fix the bug up!
    BTW,in order to making it easy to fix the bug, the jboss binay version is built with debug infomation.So you can rebuid it without any debug infomation.
    <target name="compile" depends="prepare">
    <mkdir dir="${build.classes.dir}"/>
    <javac srcdir="${src.dir}"
    destdir="${build.classes.dir}"
    debug="on" <- change it to "off"
    deprecation="off"
    optimize="on"
    includes="org/**"
    excludes="**/activation/**, **/*BeanInfo.java"
    >
    <classpath refid="classpath"/>
    </javac>
    </target>
    Thanks for all your help!

  • Deploy ejb with NetBeans 4.1

    has anyone used NB4.1?? I've deployed some Session Beans but I cant access them from a servlet, using java:comp/env/ejb/MySessionBean returns null.. do I have to do some extra config in Sun AppServer so JNDI works?? thanks..

    that was it.. I supposed the IDE had done that, but well.. anyway

  • Deploying EJBs with same name in different application jars on JBOSS

    Hi,
    We are attempting to deploy entity beans with the same name in 2 different EJB application jars on jboss 3.2.5. One bean is an extension of the other, so some of the DB columns they refer to are the same (they access different DB tables in different tablespaces). However, the field names corresponding to these DB columns in the beans themselves are different (i.e. DB column serviceid is associated with the field serviceid in one bean and service_id in the other).
    We have altered jboss.xml for one of the EJB applications so that the jndi-name used to access that application's bean is different to the jndi-name used to access the entity bean in the other EJB jar.
    However, when we attempt to deploy both jar files on the same jboss server, one of the applications deploys successfully and when we deploy the other, we get EJB spec violation errors, such as the following:
    14:18:34,631 WARN [verifier] EJB spec violation:
    Bean : CommunityAddress
    Section: 10.6.2
    Warning: The entity bean class must define a get accessor for each CMP field.
    Info : Field: service_id
    I'm presuming that this is because the bean which references the serviceid DB column with a field called serviceid is being mixed up with the other bean, which has a service_id field.
    Can anyone tell me if there is anything else that is required to get entity beans/EJBs in different applications but with the same names (and some overlapping fields, etc) deployed successfully on the same jboss server apart from editing jboss.xml for one of the applications?
    Is this a jbosscmp-jdbc.xml issue?
    Any help much appreciated,
    Maurice

    Hi Srinath
    Thanks for your response. Its not cloning, its like check-in file first, then check-out the file and do some editing and then again upload the same file with different revision number using RIDC. I got the solution now.
    Regards
    Raj

  • Problems using JAAS with EJB 3.0 on JBoss 4.0.4-GA

    Hello all,
    I am trying to build a very simple JavaEE application with JAAS, but I getting mad.
    I have an EAR packed with a WAR module an EJB JAR module and a JAR with other classes. Struts is the MVC framework and EJB 3.0 is been used.
    First of all, I configured the "login-config.xml" file within /conf directory in JBoss, like this:
    <application-policy name="exemplo1">
         <authentication>
              <login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule" flag="required">
                   <module-option name="dsJndiName">java:jdbc/Infra_Seguranca</module-option>
                   <module-option name="principalsQuery">SELECT COD_USUARIO AS Password FROM USUARIO WHERE COD_USUARIO=?</module-option>
                   <module-option name="rolesQuery">SELECT NOME_ROLE AS Roles, 'Roles' AS RoleGroups FROM ROLE_USUARIO WHERE COD_USUARIO=?</module-option>
              </login-module>
         </authentication>
    </application-policy>Next I configured the "web.xml" file like this:
    <security-constraint>
         <web-resource-collection>
              <web-resource-name>Restricted</web-resource-name>
              <description>Declarative security tests</description>
              <url-pattern>*.do</url-pattern>
         </web-resource-collection>
         <auth-constraint>
              <role-name>xxx</role-name>
         </auth-constraint>
         <user-data-constraint>
              <description>no description</description>
              <transport-guarantee>NONE</transport-guarantee>
         </user-data-constraint>
    </security-constraint>
    <login-config>
         <auth-method>FORM</auth-method>
         <realm-name>exemplo1</realm-name>
         <form-login-config>
              <form-login-page>/login.jsp</form-login-page>
              <form-error-page>/loginErro.jsp</form-error-page>
         </form-login-config>
    </login-config>
    <security-role>
         <description>Role xxx</description>
         <role-name>xxx</role-name>
    </security-role>Notice that I am using the "xxx" role to protect the "*.do" URL pattern.
    The "jboss-web.xml" is like this:
    <?xml version="1.0"?>
    <jboss-web>
         <security-domain>java:/jaas/exemplo1</security-domain>
    </jboss-web>As it is, it works perfectly, which means, every time I try to access a "*.do" URL it verifies whether I am authenticated and have authroization or not. If not, the login page shows up.
    Now I wanna to be able to also protect my EJBs.
    My Stateless Session Bean is implemented as follow:
    @RolesAllowed("yyy")
    @Stateless(name="UserManagement")
    public class UserManagementBean implements UserManagement {
         public void add(User user) {
    }When I run all this, the container simply igoners the @RolesAllowed("yyy") annotation and allow the EJB execution.
    If I add the "jboss.xml" file, like this:
    <?xml version="1.0"?>
    <jboss>
         <security-domain>java:/jaas/exemplo1</security-domain>
    </jboss>I start getting this stack trace:
    ERROR [UsersRolesLoginModule] Failed to load users/passwords/role files
    java.io.IOException: No properties file: users.properties or defaults: defaultUsers.properties found
    at org.jboss.security.auth.spi.Util.loadProperties(Util.java:313)
    at org.jboss.security.auth.spi.UsersRolesLoginModule.loadUsers(UsersRolesLoginModule.java:186)
    at org.jboss.security.auth.spi.UsersRolesLoginModule.createUsers(UsersRolesLoginModule.java:200)
    at org.jboss.security.auth.spi.UsersRolesLoginModule.initialize(UsersRolesLoginModule.java:127)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    ... Am I missing something? What do I have to do to get JAAS working fine with my EJBs? Do I have to also configure and/or provide "ejb-jar.xml" ???
    Thanks
    Daniel

    Using @SecurityDomain("exemplo1") in my EJB and NOT providing jboss.xml, it works.
    @SecurityDomain("exemplo1")
    @RolesAllowed("yyy")
    @Stateless(name="UserManagement")
    public class UserManagementBean implements UserManagement {
      public void add(User user) {
    }Damn! This is some serious shit... I don�t want to configure this in every single EJB.
    EJB 3.0 is nice, but some small trivial details like this and others, that was forgotten by Sun, piss me off!

  • Error at the time of Deploying EJB  jar on JBoss

    Hi:
    I am going to create web service using EJB3.0.
    But at the time deploying file on JBOss i am getting following error:
    12:22:51,856 ERROR [AbstractKernelController] Error installing to Real: name=vfszip:/home/crayom/projects/tools/jboss-5.0.0.CR2/server/default/deploy/TempConvert.jar state=PreReal mode=Manual requiredState=Real
    org.jboss.deployers.spi.DeploymentException: Error during deploy: vfszip:/home/crayom/projects/tools/jboss-5.0.0.CR2/server/default/deploy/TempConvert.jar
         at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
         at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:175)
         at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1285)
         at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1003)
         at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:944)
         at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
         at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
         at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
         at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
         at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
         at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
         at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
         at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:627)
         at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:541)
         at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:265)
         at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:143)
         at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:409)
         at org.jboss.Main.boot(Main.java:209)
         at org.jboss.Main$1.run(Main.java:544)
         at java.lang.Thread.run(Thread.java:619)
    Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
         at java.lang.String.substring(String.java:1938)
         at org.jboss.wsf.common.JavaUtils.getPackageName(JavaUtils.java:533)
         at org.jboss.ws.metadata.wsdl.WSDLUtils.getTypeNamespace(WSDLUtils.java:700)
         at org.jboss.ws.metadata.builder.jaxws.JAXWSWebServiceMetaDataBuilder.processWebService(JAXWSWebServiceMetaDataBuilder.java:313)
         at org.jboss.ws.metadata.builder.jaxws.JAXWSWebServiceMetaDataBuilder.buildWebServiceMetaData(JAXWSWebServiceMetaDataBuilder.java:107)
         at org.jboss.ws.metadata.builder.jaxws.JAXWSServerMetaDataBuilder.setupProviderOrWebService(JAXWSServerMetaDataBuilder.java:50)
         at org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilderEJB3.buildMetaData(JAXWSMetaDataBuilderEJB3.java:76)
         at org.jboss.wsf.stack.jbws.UnifiedMetaDataDeploymentAspect.start(UnifiedMetaDataDeploymentAspect.java:70)
         at org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl.start(DeploymentAspectManagerImpl.java:144)
         at org.jboss.wsf.container.jboss50.BareWSFRuntime.start(BareWSFRuntime.java:66)
         at org.jboss.wsf.container.jboss50.deployer.AbstractDeployerHookEJB.deploy(AbstractDeployerHookEJB.java:48)
         at org.jboss.wsf.container.jboss50.deployer.AbstractWebServiceDeployer.internalDeploy(AbstractWebServiceDeployer.java:60)
         at org.jboss.wsf.container.jboss50.deployer.WebServiceDeployerEJB.internalDeploy(WebServiceDeployerEJB.java:115)
         at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
         at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:169)
         ... 18 more
    12:22:51,897 ERROR [ProfileServiceBootstrap] Failed to load profile: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
    *** CONTEXTS IN ERROR: Name -> Error
    vfszip:/home/crayom/projects/tools/jboss-5.0.0.CR2/server/default/deploy/TempConvert.jar -> java.lang.StringIndexOutOfBoundsException: String index out of range: -1So, can any body tell me the solution of this problem?
    Thank You.

    AnupDesai wrote:
    Hi:
    After adding require packages also i am getting the same error.
    Well, if it's not a version problem with either the JDK (installing java 6 on top of a java 5 distribution) or the Jars (like JAXB) , then , as pointed out, you might have written your Web service using a packageless class:
    java.lang.StringIndexOutOfBoundsException: String index out of range: -1
         at java.lang.String.substring(String.java:1938)
         at org.jboss.wsf.common.JavaUtils.getPackageName(JavaUtils.java:533)Restart a new project in your IDE with a packaged ws from the start, and see if it works.

  • Deployment of .war file using JMX in jboss 4.0.5 GA

    Hi,
    Can anyone help me out in the steps of deployment of .war file using JMX in JBOSS 4.0.5 server.I went through the documentation in jboss.org but couldn't find a suitable one though there were many.Any links/url that you know about the deployment process will also be helpful to me.
    Thanks

    You're probably using an older version of JavaMail where there was a bug in the example
    DummySSLSocketFactory. Download the latest version and the example is correct.
    Also, if you're using DummySSLSocketFactory just to control which servers you trust,
    JavaMail 1.4.3 has some properties that will make this easier for you and avoid the need
    for DummySSLSocketFactory. In particular, see the mail.imaps.ssl.trust property.

  • Procedure for hot deploying EJBs using  Jdeveloper and OC4J comtainer

    i am using JDeveloper , please any one help me out in hot deploying EJBs. what is the procedure if i want to hot deploy EJBS

    1) You have to start OC4J with higher Java heap size e.g. java -Xms100m -Xmx150m -jar oc4j.jar
    2) The RMI port by default used is 23791 and configurable by modifying config/rmi.xml.
    regards
    Debu

  • How to deploy ejb in an Enterprise Environment using the jbuilder plugin

    Hello:
    I use Oracle9iAS Plug-in Release 2 (9.0.2) for Borland JBuilder 7 to deploy my ejb. But now, i would like to deploy my ejb to oc4j in an Enterprise Environment (not as standalone).
    Does anybody know how can i do it? I noted that the plugin use admin.jar to deploy ejb, and I suppose it need to use dcmctl.
    Thank you
    Sergio

    Sergio,
    The current release of Borland JBuilder only allows you to deploy to standalone OC4J. If you want to deploy to Oracle9iAS (Enterprise OC4J), please try Oracle9i JDeveloper 9.0.3:
    http://otn.oracle.com/software/products/jdev/content.html
    JDeveloper 9.0.3 uses DCM to deploy to Oracle9iAS
    Regards,
    Chen.

  • Deploying the SQLJ files used by the Rentals EJB

    In a previous section of the documentation for acmevideo demo, we
    address the issue of deployment of the Rentals EJB. This contains
    the rentals.sqlj file.
    Due to an issue with the current versio of Oracle 8i(8.1.5), a
    workaround must be deployed to explicitly deploy the *.ser file
    used by the Rentals EJB to the Oracle 8i database. (I don't know
    or understand what the issue is - can someone explain ?)
    Anyway, I am using Oracles suggested workaround and the
    deployment fails.
    Here is the text:
    *** Invoking the Oracle JDeveloper deployment utility ***
    Scanning project files...done
    Generating classpath dependencies...done
    Generating archive entries table...done
    Writing archive...done
    *** Invoking the Oracle8i deployment utility ***
    interrupted by user
    <The dialog in JDeveloper displays>:
    Cannot load java classes into database
    Any suggestions or tips how to get this working ?
    Regards,
    Mark Battersby
    null

    Mark,
    I had the same problem. Have you increased your Java_pool and
    your shared pool? That and having the right classpath/path
    helped. Also, I think that there are some SQL prep scripts that
    need to be run.
    Todd Kromann
    mark tomlinson (guest) wrote:
    : You might try using the command line version of the deployejb
    : tool and see if you can get a more verbose error message
    : (Jdeveloper might be 'eating' the errors coming back). I have
    : seen that happen when the loadjava portion of deployment would
    : fail (i.e. not getting back an error).
    null

  • Deploy ejbs without using deployment tool in J2EE server

    Hi,
    IS there any way to deploy ejbs in J2EE without using the deployment tool? I am using the j2ee 1.2.1.
    Thanks,
    Nipa

    When I was in my companies Java Boot Camp (6 week fulltime training in Java technologies) the class was split about 75/25 with 75% of the class using a deployment tool (I think it was WebGain). The other 25% did not use a deployment tool. I was one of the 25%.
    What we did was write a Perl script that took care of all the necessary deployment steps. It has been awhile, and I no longer work for that company, but I'll try and dig up some of those scripts. (Can't promise I'll find them!)
    BTW, the 25% group deployed more EJBs with less problems than those using the deployment tool...

Maybe you are looking for

  • Is it possible to restore Windows server 2012 backup to another physical hardware or virtual machine?

    Hi I have windows server 2012 which is my domain controller. It has 2 hyper visor virtual machine that they are 2012 too. I have an additional domain controller in another location too. I want to know, how can I restore a bare metal or system state b

  • How to store binary data in Java

    I need to show news in my web aplication.So I am retrieving news from a Feed Server in which the field GEN_UNICODE_MESSAGE_1 gives the news data.News consists of both English/Arabic data.So how will I store the binary content in JAVA and how can I di

  • How to attach a smartform in BOR object

    Hi, I want to know how to attach a z smartform to BOR object? I tried to search out here but not able to have the result. Kindly provide the guidelines for it.... Regards, Rickky

  • Load_sample.sql file not visible

    Hi buddies, I just downloaded the Oracle Express Edition tutor from here: http://st-curriculum.oracle.com/tutorial/DBXETutorial/index.htm Also I have Oracle Express Edition installed. I also have Oracle Application Express but don't know how to deal

  • How do i create a collage to print as a poster

    I want to create a collage to print as a poster of an album of say 30 photos. How can i do this?