[EJB/JBoss] - Re: Packing/Descriptors for EJB 3.0 Local access
by jaikiran
In your ejb-jar.xml:
| <session >
| <description>Sample session bean</description>
|
| <ejb-name>HelloWorld</ejb-name>
|
|
| <local-home>packageName.HelloWorldLocalHome</local-home>
| <local>packageName.HelloWorldLocal</local>
| <ejb-class>packageName.HelloWorldSessionBean</ejb-class>
| <session-type>Stateless</session-type>
| <transaction-type>Container</transaction-type>
|
|
|
| </session>
|
Add the following to the web.xml:
| <ejb-local-ref>
| <ejb-ref-name>ejb/MyLocalRefHelloWorld</ejb-ref-name>
| <ejb-ref-type>Session</ejb-ref-type>
| <local-home>packageName.HelloWorldLocalHome</local-home>
| <local>packageName.HelloWorldLocal</local>
| <ejb-link>HelloWorld</ejb-link>
| </ejb-local-ref>
The ejb-link in the web.xml should match the ejb-name in the ejb-jar.xml.
In your code, you will lookup using the ejb-ref-name specified in the web.xml, as follows:
| Context ctx = new InitialContext();
| ctx.lookup("java:comp/env/ejb/MyLocalRefHelloWorld");
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3983175#3983175
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3983175
19Â years, 6Â months
[Installation, Configuration & Deployment] - Secure Static Content
by jfrankman
I have created a context in the jbossweb-tomcat55.asr for sharing documents. However, I want to protect this context with a security constraint. To the best of my knowlege I have everything set up correctly, but a user is not prompted for a username/password and the context is still accessible by anyone.
I have tried to get this working by placing the following in the server.xml file in the jbossweb-tomcat55.sar directory please tell me what I am doing wrong. I am at the end of my rope:
<Host name="localhost"
| autoDeploy="false" deployOnStartup="false" deployXML="false" >
| <Context path="/media" appBase="" docBase="/windows/D/media" debug="99" reloadable="true">
| <security-constraint>
| <web-resource-collection>
| <web-resource-name>blah blah blah</web-resource-name>
| <url-pattern>/*</url-pattern>
| </web-resource-collection>
| <auth-constraint>
| <role-name>mediauser</role-name>
| </auth-constraint>
| </security-constraint>
| <Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
| driverName="com.mysql.jdbc.Driver"
| connectionURL="jdbc:mysql://localhost/jboss?user=jbossuser&password=password"
| userTable="users" userNameCol="user_name" userCredCol="user_pass"
| userRoleTable="user_roles" roleNameCol="role_name"/>
|
|
|
| <login-config>
| <auth-method>BASIC</auth-method>
| <realm-name>Example Realm</realm-name>
| </login-config>
|
| <security-role>
| <description>The role that is required to log in to
| the Manager Application</description>
| <role-name>mediauser</role-name>
| </security-role>
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3983172#3983172
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3983172
19Â years, 6Â months
[JBossCache] - Tip on use of JBC in non-JBoss AS MBeanServer
by bstansberryï¼ jboss.com
Tip for any users out there using JBC in a non-JBoss AS JMX environment:
Been doing some unit testing of standalone JBC (i.e. outside of JBoss AS). This testing involved registering JBC with a JMX MBeanServer that my test would create.
Found that tests would fail with javax.management.InstanceNotFoundException: jboss.system:service=ServiceController whenever I would call TreeCache.create(), start(), stop() or destroy().
Turns out that this is because TreeCache extends a JBoss AS class, ServiceMBeanSupport. The implementation of create(), start() stop() and destroy() come from the superclass. And that superclass assumes that if it's registered with an MBeanServer, it must be the JBoss AS' microkernel, so it invokes an operation on the microkernel's ServiceController. Which in my standalone setup doesn't exist, hence the failure.
Workaround for this is to not call create/start/stop/destroy. Instead call createService/startService/stopService/destroyService. That's where the real work gets done anyway.
For JBC 2.0 the legacy inheritance from ServiceMBeanSupport has been removed.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3983170#3983170
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3983170
19Â years, 6Â months
[JBoss Seam] - Still have issues with my installation
by diablo341
I installed AS 4.0.5.GA. I also installed EJB3-RC9. Is this the embedded ejb for testing? I'm confused. Doesn't the appserver have EJB3 installed? My components.xml has a property for EJB installed. I set it to false, b/c I saw that the component.properties file had an entry for embeddedEjb true. I figured I wanted to use the ejb in the appserver. Anyway, I noticed an entry in the console that the JNDI was not bound. I read that it's just an info message. I'm getting the following error:
| Caused by: org.jboss.seam.InstantiationException: Could not instantiate Seam component: login
| at org.jboss.seam.Component.newInstance(Component.java:1578)
| at org.jboss.seam.Component.getInstance(Component.java:1492)
| at org.jboss.seam.Component.getInstance(Component.java:1466)
| at org.jboss.seam.jsf.SeamVariableResolver.resolveVariable(SeamVariableResolver.java:44)
| at org.apache.myfaces.config.LastVariableResolverInChain.resolveVariable(LastVariableResolverInChain.java:42)
| at com.sun.facelets.el.LegacyELContext$LegacyELResolver.getValue(LegacyELContext.java:134)
| at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:65)
| at com.sun.el.parser.AstValue.getTarget(AstValue.java:62)
| at com.sun.el.parser.AstValue.invoke(AstValue.java:147)
| at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
| at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
| at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:69)
| at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
| ... 36 more
| Caused by: javax.naming.NameNotFoundException: LoginAction not bound
|
I went to my jmx-console and saw in the Global JNDI Namespace my app and all the EJBs listed. I also saw in jboss.j2ee that all EJBs are started. What am I missing?
John
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3983169#3983169
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3983169
19Â years, 6Â months
[JBoss Seam] - problem with deploying in JBoss
by mnrz
Hi all,
I am going to deploy my seam project in JBoss 4.0.4 GA, but during the startup there is an exception thrown. it complain of ejb-jar.xml but I never change that file and I am copied it from the example folder.
|
| 09:08:29,984 INFO [EARDeployer] Init J2EE application: file:/H:/jboss4.0.4.GA/server/default/deploy/registration.ear
| 09:08:35,250 ERROR [MainDeployer] Could not create deployment: file:/H:/jboss4.0.4.GA/server/default/tmp/deploy/tmp6030registration.ear-contents/e_registration-web.jar
| org.jboss.deployment.DeploymentException: ejb-jar.xml must either obey the right xml schema or define a valid DOCTYPE!
| at org.jboss.metadata.ApplicationMetaData.importEjbJarXml(ApplicationMetaData.java:339)
| at org.jboss.metadata.XmlFileLoader.load(XmlFileLoader.java:166)
| at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:541)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
| at java.lang.reflect.Method.invoke(Unknown Source)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
| at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
| at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
| at org.jboss.ws.server.WebServiceDeployer.create(WebServiceDeployer.java:99)
| at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.create(SubDeployerInterceptorSupport.java:180)
| at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:91)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy42.create(Unknown Source)
| at org.jboss.deployment.MainDeployer.create(MainDeployer.java:953)
| at org.jboss.deployment.MainDeployer.create(MainDeployer.java:943)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:807)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
| at sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
| at java.lang.reflect.Method.invoke(Unknown Source)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy6.deploy(Unknown Source)
| at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
| at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
| at java.lang.reflect.Method.invoke(Unknown Source)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
| at $Proxy0.start(Unknown Source)
| at org.jboss.system.ServiceController.start(ServiceController.java:417)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
| at java.lang.reflect.Method.invoke(Unknown Source)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy4.start(Unknown Source)
| at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
| at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1007)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:808)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:755)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
| at java.lang.reflect.Method.invoke(Unknown Source)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy5.deploy(Unknown Source)
| at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
| at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
| at org.jboss.Main.boot(Main.java:200)
| at org.jboss.Main$1.run(Main.java:464)
| at java.lang.Thread.run(Unknown Source)
| 09:08:35,578 ERROR [URLDeploymentScanner] Incomplete Deployment listing:
|
| --- Incompletely deployed packages ---
| org.jboss.deployment.DeploymentInfo@7b963a84 { url=file:/H:/jboss4.0.4.GA/server/default/deploy/registration.ear }
| deployer: org.jboss.deployment.EARDeployer@2f8b5a
| status: Deployment FAILED reason: ejb-jar.xml must either obey the right xml schema or define a valid DOCTYPE!
| state: FAILED
| watch: file:/H:/jboss4.0.4.GA/server/default/deploy/registration.ear
| altDD: null
| lastDeployed: 1162618715250
| lastModified: 1162618709953
| mbeans:
|
|
| 09:08:35,812 INFO [Http11BaseProtocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-8080
| 09:08:36,890 INFO [ChannelSocket] JK: ajp13 listening on /0.0.0.0:8009
| 09:08:36,921 INFO [JkMain] Jk running ID=0 time=0/156 config=null
| 09:08:36,953 INFO [Server] JBoss (MX MicroKernel) [4.0.4.GA (build: CVSTag=JBoss_4_0_4_GA date=200605151000)] Started in 1m:9s:47ms
|
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3983168#3983168
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3983168
19Â years, 6Â months