[EJB 3.0] - Unable to deploy an Entity Bean
by maha79
When i am deploying apllication in jboss-4.2.2.GA i am getting the exception.
Problem creating service jboss.j2ee:service=EJB3,module=BookEx.jar
java.lang.NoClassDefFoundError: org/hibernate/cfg/EJB3DTDEntityResolver
at org.jboss.ejb3.Ejb3Deployment.initializePersistenceUnits(Ejb3Deployment.java:535)
at org.jboss.ejb3.Ejb3Deployment.create(Ejb3Deployment.java:329)
at org.jboss.ejb3.Ejb3Module.createService(Ejb3Module.java:77)
at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:260)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:243)
at sun.reflect.GeneratedMethodAccessor3.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.create(Unknown Source)
- MBeans waiting for other MBeans ---
ObjectName: jboss.j2ee:service=EJB3,module=BookEx.jar
State: FAILED
Reason: java.lang.NoClassDefFoundError: org/hibernate/cfg/EJB3DTDEntityResolver
--- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
ObjectName: jboss.j2ee:service=EJB3,module=BookEx.jar
State: FAILED
Reason: java.lang.NoClassDefFoundError: org/hibernate/cfg/EJB3DTDEntityResolver
persistence.xml is
<persistence-unit name="BookEntity" transaction-type="JTA">
<jta-data-source>java:/EntityMySqlDS</jta-data-source>
</persistence-unit>
even i include these jars in the manifest file
1.jbossall-client.jar
2.ejb3-persistence.jar
3.jboss-ejb3x.jar
Any help ?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4230974#4230974
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4230974
17 years, 2 months
[Beginners Corner] How to make the EAR classloader override JRE library?
by William
Hi,
In my project's EAR package, I am using the latest JAXB jars by packaging them in APP-INF/lib/jaxb*.jar. The environment I am using is JBoss4 + JDK6. However, the JBOSS and JRE has old versions of JAXB.
I wish to configure the JBOSS ClassLoader to make it load my packaged JAXB jars precedence over the old versions either in JBOSS_HOME/lib/ or JAVA_HOME/jre/lib.
I set the jboss-app.xml as:
<jboss-app>
<loader-repository>
my.example:loader=my.example.impl.ear
<loader-repository-config>
java2ParentDelegation=false
</loader-repository-config>
</loader-repository>
<library-directory>
APP-INF/lib
</library-directory>
</jboss-app>
My EAR structure for "my.example.impl.ear" is:
- EAR my.example.impl.ear
- APP-INF/class
- APP-INF/lib
- META-INF
- WAR my.example.impl.war
- WEB-INF
- META-INF
However, the deployment failed when verifying JAXBContext class:
...
[Loaded com.sun.jersey.core.spi.component.ProviderFactory$SingletonComponentProvider from file:/C:/jboss-4.2.3.GA-jdk6/server/default/tmp/deploy/tmp3081340691940707694my-example-impl.ear-contents/APP-INF/lib/jersey-core-1.0.2.jar]
[Loaded com.sun.jersey.core.spi.component.ComponentDestructor from file:/C:/jboss-4.2.3.GA-jdk6/server/default/tmp/deploy/tmp3081340691940707694my-example-impl.ear-contents/APP-INF/lib/jersey-core-1.0.2.jar]
[Loaded javax.annotation.PreDestroy from C:\Java\jdk1.6.0_13\jre\lib\rt.jar]
[Loaded javax.xml.bind.JAXBContext from C:\jboss-4.2.3.GA-jdk6\lib\endorsed\jaxb-api.jar]
[Loaded com.sun.jersey.api.json.JSONConfigurated from file:/C:/jboss-4.2.3.GA-jdk6/server/default/tmp/deploy/tmp3081340691940707694my-example-impl.ear-contents/APP-INF/lib/jersey-json-1.0.2.jar]
[Loaded java.lang.Package$1 from C:\Java\jdk1.6.0_13\jre\lib\rt.jar]
[Loaded javax.xml.bind.JAXBContext from file:/C:/jboss-4.2.3.GA-jdk6/server/default/tmp/deploy/tmp3081340691940707694my-example-impl.ear-contents/APP-INF/lib/jaxb-api.jar]
[Loaded com.sun.jersey.api.json.JSONJAXBContext from file:/C:/jboss-4.2.3.GA-jdk6/server/default/tmp/deploy/tmp3081340691940707694my-example-impl.ear-contents/APP-INF/lib/jersey-json-1.0.2.jar]
[Loaded java.lang.VerifyError from C:\Java\jdk1.6.0_13\jre\lib\rt.jar]
02:24:23,953 ERROR [[/resources]] StandardWrapper.Throwable
java.lang.VerifyError: (class: my/example/impl/provider/JAXBContextResolver, method: <init> signature: ()V) Bad type in putfield/putstatic
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.privateGetPublicMethods(Unknown Source)
at java.lang.Class.getMethods(Unknown Source)
at com.sun.jersey.core.reflection.MethodList.<init>(MethodList.java:57)
at com.sun.jersey.core.spi.component.ComponentConstructor.getPostConstructMethod(ComponentConstructor.java:124)
at com.sun.jersey.core.spi.component.ComponentConstructor.<init>(ComponentConstructor.java:118)
at com.sun.jersey.core.spi.component.ProviderFactory.getInstance(ProviderFactory.java:205)
at com.sun.jersey.core.spi.component.ProviderFactory._getComponentProvider(ProviderFactory.java:133)
at com.sun.jersey.core.spi.component.ProviderFactory.getComponentProvider(ProviderFactory.java:126)
at com.sun.jersey.core.spi.component.ProviderServices.getComponent(ProviderServices.java:168)
at com.sun.jersey.core.spi.component.ProviderServices.getProviders(ProviderServices.java:95)
at com.sun.jersey.core.spi.factory.ContextResolverFactory.<init>(ContextResolverFactory.java:90)
at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:410)
at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:317)
at com.sun.jersey.spi.container.servlet.WebComponent.initiate(WebComponent.java:422)
at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:433)
at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:167)
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:197)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4071)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4375)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:790)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:770)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:553)
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.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:296)
at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.apache.catalina.core.StandardContext.init(StandardContext.java:5312)
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.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:296)
at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.web.tomcat.service.TomcatDeployer.performDeployInternal(TomcatDeployer.java:301)
at org.jboss.web.tomcat.service.TomcatDeployer.performDeploy(TomcatDeployer.java:104)
at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:375)
at org.jboss.web.WebModule.startModule(WebModule.java:83)
at org.jboss.web.WebModule.startService(WebModule.java:61)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
at sun.reflect.GeneratedMethodAccessor3.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)
Can anyone help me on this?
Thanks a lot,
William
___________________________________________________________
好玩贺卡等你发,邮箱贺卡全新上线!
http://card.mail.cn.yahoo.com/
17 years, 2 months
[JBoss jBPM] - Re: anyone working with jbpm-3.2.6.SP1?
by arpan25
hi,
i had posted my problem 2 times earlier but failed to get a response. Anyway,
I am using the jbpm-3.2.6.SP1-installer.jar to install jbpm 3.2.6.SP1.
Is it necessary to download the optional component for JBoss ?
If yes, how do I Integerate jbpm with jboss ?
After installation,I have
/home/arpan/server
/home/arpan/docs
/home/arpan/jbpm-3.2.6.SP1
I downloaded JBoss-5.0.0.GA from the optional components as well and put it in the jbpm-3.2.6.SP1 folder...So I have,
/home/arpan/jbpm-3.2.6.SP1/JBoss-5.0.0.GA
I have made all the changes as mentioned in the tutorial for changing the hibernate.cfg.xml and other files... since I am using MySql. The changes made are :
1. I copied /home/arpan/server/default/deploy/jbpm folder to /home/arpan/jbpm-3.2.6.SP1/joss-5.0.0.GA/server/default/deploy
2. changes made to home/arpan/server/default/deploy/jbpm-mysql-ds.xml and copied it to jboss/server/default/deploy folder too
3. I copied mysql connector.jar to /home/arpan/jbpm-3.2.6.SP1/ jboss-5.0.0.GA/server/default/lib folder
4. /home/arpan/jbpm-3.2.6.SP1/config/hibernate.cfg.xml modified datasource properties
5. /home/arpan/server/default/deploy/jbpm/jbpm-service.sar/hibernate.cfg.xml changed
6. added /home/arpan/jbpm-3.2.6.SP1/joss-5.0.0.GA/server/default/deploy/messaging/persistence/mysql-ds.xml
I tried to deploy my application after installation and I cannot see any process instances after deployment, maybe JBoss and JBPm are not integrated properly..or are there any changes that I have to make to any of the files...I am not sure..
Thanks,
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4230963#4230963
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4230963
17 years, 2 months
[Beginners Corner] - Re: Eclipse RAP/RCP as Java Portlet??
by PeterJ
I don't know enough about Eclipse RAP/RCP to provide a definitive answer, but as long as you can follow the portal spec for the apps you develop, it might work. Following the spec means that you have to develop portlets rather than servlets, and all communication to the server (from your AJAX or rich client code) must use the portal URLs.
One other concern I have is whether RAP or RCP client code will play nicely with the portal UI - after all with a portal no individual portlet has control over the UI because the portal enables multiple portlets to be displayed on a single web page. RAP should fit into that framework OK (see the portal forum for the various discussion of AJAX use in portlets). But I am not sure if RCP would fit since that seems geared towards a stand-alone client.
Finally, the Eclipse RAP/RCP tools are probably geared towards stand-alone use (that is, not within a portal). Thus you will probably find yourself fighting the tool (Eclipse) and the code it creates. You might be better off developing portlet code with AJAX capabilities.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4230952#4230952
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4230952
17 years, 2 months
[EJB/JBoss] - EJB3 Classloader leaks?
by kevinmudrick
I am seeing, upon undeployment of an ear the classloader for all my EJBs staying around.
To test, I am deploying, undeploying, deploying, and undeploying again. I then dump heap, and analyze it with the Eclipse Memory Analyzer plugin. Then I look for duplicate classes - and for each duplicate class (all my Stateless Session beans and their interface) I seem to have two instances of the org.jboss.mx.loading.UnifiedClassLoader3. I then follow the path to GC root (excluding soft/weak refs).
Each interface and class then has <JNI Local> java.lang.Thread JDWP Transport Listener: dt_socket
Also, if I call list() on JNDIView in the JMX Console, I see all the EJB implementations listed in Global JNDI Namespace under the [now undeployed] ear. The class for each is org.jnp.interfaces.NamingContext
Any ideas why this is so, or how I can go about eliminating it? It seems to me that I'm going to run out of permgen after lots of redeploys if the classloaders have strong refs to the ejbs and vice versa and cannot be unloaded.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4230935#4230935
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4230935
17 years, 2 months
[EJB 3.0] - Re: How to deal with huge uploaded file in JBoss
by jochen.reinhardt
Hi and thanks for your responeses,
First of all, it works ;-) Just by saving the file in the
I found several other problems in the app:
- I was using a wrong version of tomahawk
- Tomahawk seems to ignore setting for file size thresholds. This resulted in a FileUploadHtmlComponent caching 100 MB in memory. Have to submit a bug report for this...
- I had to use a hardly documented attribute in the file upload tag (found in tomahawk's source code).
I don't like the idea of splitting the files into chunks. That's just because I am a bit lazy and I want to keep things as clean and as simple as possible. And with junking I do not solve my general problem. That is using a JMS Message to process the file asynchronously. I would not want to send a message for each chunk. That would not be fast enough. And I would end up having JMS dumping the chunks to the database.
Next time I start a new application I will consider using struts. But for this project, I'm already in to deep using myFaces. And I've never heard about BlobStreams. Is that part of some JDBC spec? But it seems to make good sense - as I won't be able to hold that much data in one row of a result set.
For now, I'll keep things as they are - I like using the simple FileInputStreams, consuming only minimum memory. Buffering is done by some sick CSV-library. I thought I had to die as I took a look into the sources... but as long as it works...
Any hint about standards violation?
Accessing a file from disk in MessageListner?
Passing a FileInputStream to EJB3 stateless session bean method call?
I guess I just don't care - as long as it works.
Thanks again for your hints - I had not suspected tomahawk to be the major problem in that case. So after all, this post seems to be somewhat off-topic here...
So long,
Jochen
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4230932#4230932
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4230932
17 years, 2 months
[JCA/JBoss] - Howto use custom jdbc driver with OracleXADatasource?
by ethridgt
I have a custom jdbc driver that is generic. We wrap the oracle jdbc driver so that we can add security as the sql passes through the driver. Now we need to use a XA datasource since we have multiple datasources.
I'm trying to configure the datasource file so that it will use the oracle xa datasource and then have the oracle xa datasource use our custom jdbc driver. I've tried a lot of combinations. I tried setting the driver-class and connection-url to the values that have been working when we used a no-tx-datasource. If I remove the xa-datasource-property for URL or set it to the url that our custom jdbc driver expects, then I get an exception that looks like:
2009-05-13 17:30:11,035 WARN [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] Throwable while attempting to get a new connection: null
| org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: Invalid Oracle URL specified: OracleDataSource.makeURL)
| at org.jboss.resource.adapter.jdbc.xa.XAManagedConnectionFactory.createManagedConnection(XAManagedConnectionFactory.java:155)
| at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:619)
| at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:264)
| at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:613)
| at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:347)
| at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:330)
| at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:402)
| at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:849)
| at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:89)
| at org.apache.jsp.Test_jsp._jspService(Test_jsp.java:90)
| at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
| at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
| at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
| at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
| at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
| at java.lang.Thread.run(Thread.java:619)
| Caused by: java.sql.SQLException: Invalid Oracle URL specified: OracleDataSource.makeURL
| at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
| at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
| at oracle.jdbc.pool.OracleDataSource.makeURL(OracleDataSource.java:1353)
| at oracle.jdbc.pool.OracleDataSource.getURL(OracleDataSource.java:1064)
| at oracle.jdbc.xa.client.OracleXADataSource.getPooledConnection(OracleXADataSource.java:188)
| at oracle.jdbc.xa.client.OracleXADataSource.getXAConnection(OracleXADataSource.java:143)
| at oracle.jdbc.xa.client.OracleXADataSource.getXAConnection(OracleXADataSource.java:129)
| at oracle.jdbc.xa.client.OracleXADataSource.getXAConnection(OracleXADataSource.java:90)
| at org.jboss.resource.adapter.jdbc.xa.XAManagedConnectionFactory.createManagedConnection(XAManagedConnectionFactory.java:137)
| ... 33 more
If I set the xa-datasource-property for URL to the normal oracle jdbc thin client string, then I don't receive any errors. The problem is that it doesn't use my custom driver either.
How can I configure the datasource configuration file to be a xa-datasource, but use our custom jdbc driver? Our driver has a custom url format that it expects to see. In the acceptsURL method it will return false if it doesn't see that format.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4230929#4230929
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4230929
17 years, 2 months
[JNDI/Naming/Network] - Re: distributed application
by vphagura
Thx for your response. Yes I'm using 'reservation/FlightReservationAccessorBean/remote'. Also, I did a little test.
I made a standalone client which tries to access my EJBs, on the jboss 5.0.1, from a remote machine. I packaged the exact jars from Jboss 4.2.3 client dir and put it in the classpath of the standalone client. I get the exact error as before:
java.lang.ClassCastException: javax.naming.Reference cannot be cast to com.vsp.reservation.ejb.accessor.FlightReservationAccessorRemote
Then, I remove these jars and now package the jars from Jboss 5.0.1 client dir and put it in the classpath of the client. It works great!!
So, I think that there is some incompatibilty in terms of different versions of JBoss, as my WAR is on jboss 4.2.3 and my EAR is on jboss 5.0.1.
Can someone please let me know a way to go around this incompatibilty??
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4230921#4230921
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4230921
17 years, 2 months
[Security & JAAS/JBoss] - Exclude EJB from secuirty checks
by lales
I'm sure this has come up before but i can't seem to find any decent info on how to do it.
Basically we use FORM authentication on our web app. All app pages require the user to be authenticated (except for the login page).
However i now need to execute a method in an EJB without being authenticated (use case is for users that have forgotten their pass to be able to reset it from outside the app)
What is the best way to do this? How do i exclude a method of an EJB (or even the entire EJB if needed) from the security checks?
@PermitAll still requires an authenticated caller.
I know i need to use the "unauthenticatedIdentity" option but i'm not sure how to use this to for only one EJB (ideally for a single method) while keeping the security of the rest intact.
any help appreciated
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4230915#4230915
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4230915
17 years, 2 months
[Microcontainer] - Re: Tool for documenting MC beans
by david.lloyd@jboss.com
"jesper.pedersen" wrote : All I'm asking for here is a tool that can allow a project to document the MC beans they want to expose to other developers - or in case they don't have an up-to-date users guide to the end user.
That's the error, right there. There should be zero such beans.
There are a few types of usable APIs in an MC environment: publicly documented Java APIs and annotations (which both are documented via Javadoc), and publicly documented XML descriptors (which appear as XSD and their associated docs).
Even if a class is designed to be used by a "bean" tag on a strictly internal basis (not that I would condone even that), the Javadoc of that class is sufficient to document it. Adding another layer is purely redundant.
And by the way, TLD is a very poor example as the capabilities it provides are designed to document tags, not specific instances of tags. For example, you could have a TLD which describes, say, the "bean" tag, but what good would that do you? There are already documentation annotations on the bean-deployer XSD which do the same thing.
This whole notion is basically flawed. Any effort is much better spent creating SchemaResolverDeployers for any services that currently do not have it, rather than shoring up an already less-than-optimal situation.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4230910#4230910
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4230910
17 years, 2 months
[JBoss Cache: Core Edition] - Replication, CacheMarshaller, Region
by ekobir
Hi All
As I would like to store some custom externalizable classes in the cache, i created region on the cache. But it didnt help me not to get ClassNotFoundException.
Scenario exactly as explained in faq.
[url]
http://www.jboss.org/file-access/default/members/jbosscache/freezone/docs...
[/url]
I'm using JBoss EAP 5.0.0 (Only supported version available). It uses jbosscache 3.0,3GA. My jboss-beans.xml file under META-INF of ear file. So when class is loaded,
cache will be created on that server.
My Question is
What is the best way for handling class loader problem?
Do I need to write a Marshaller from scratch or is there any delegation available for application to provide class loader?
please find cache configuration below.
| <!-- First we create a Configuration object for the cache -->
| <bean name="ConfigurationCacheConfig"
| class="org.jboss.cache.config.Configuration">
| <!-- Externally injected services -->
| <property name="runtimeConfig">
| <bean class="org.jboss.cache.config.RuntimeConfig">
| <property name="transactionManager">
| <inject bean="jboss:service=TransactionManager"
| property="TransactionManager"/>
| </property>
| <property name="muxChannelFactory">
| <inject bean="JChannelFactory"/>
| </property>
| </bean>
| </property>
|
| <property name="multiplexerStack">udp</property>
| <property name="clusterName">
| ${jboss.partition.name:DefaultPartition}-ConfigurationCache
| </property>
| <property name="nodeLockingScheme">OPTIMISTIC</property>
| <property name="isolationLevel">NONE</property>
| <property name="cacheMode">REPL_SYNC</property>
| <property name="stateRetrievalTimeout">15000</property>
| <property name="syncReplTimeout">20000</property>
| <property name="lockAcquisitionTimeout">15000</property>
| <property name="exposeManagementStatistics">true</property>
|
| <property name="cacheLoaderConfig">
| <bean class="org.jboss.cache.config.CacheLoaderConfig">
| <!-- Do not change these TODO it was true -->
| <property name="passivation">false</property>
| <property name="shared">false</property>
|
| <property name="individualCacheLoaderConfigs">
| <list>
| <bean class="org.jboss.cache.loader.FileCacheLoaderConfig">
| <!-- Where passivated sessions are stored -->
| <property name="location">${jboss.server.data.dir}${/}session</property>
| <!-- Do not change these -->
| <property name="async">false</property>
| <property name="fetchPersistentState">true</property>
| <property name="purgeOnStartup">true</property>
| <property name="ignoreModifications">false</property>
| <property name="checkCharacterPortability">false</property>
| </bean>
| </list>
| </property>
| </bean>
| </property>
| </bean>
|
| <!-- Factory to build the Cache. -->
| <bean name="DefaultCacheFactory" class="org.jboss.cache.DefaultCacheFactory">
| <constructor factoryClass="org.jboss.cache.DefaultCacheFactory"
| factoryMethod="getInstance" />
| </bean>
| <!--The cache itself-->
| <bean name="ConfigurationCache" class="org.jboss.cache.Cache">
| <constructor factoryMethod="createCache">
| <factory bean="DefaultCacheFactory"/>
| <parameter class="org.jboss.cache.config.Configuration"><inject bean="ConfigurationCacheConfig"/></parameter>
| <parameter class="boolean">false</parameter>
| </constructor>
| </bean>
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4230898#4230898
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4230898
17 years, 2 months
[Microcontainer] - Re: Tool for documenting MC beans
by david.lloyd@jboss.com
I think this approach is incorrect. Any jboss-beans.xml files that we include should be considered part of the private implementation of that service. A -beans.xml file is a script (a program) which is tied to implementation details of the service, like class structure, not a configuration file. As such, the appropriate way to document it is with plain XML comments.
Any time we are exposing a service configuration to users as XML, we should be using a separate descriptor format which doesn't depend directly on the class structure of the service. This is the only way that we can avoid configuration incompatibility between AS releases. A separate descriptor implies a schema file, which can be annotated with documentation in a way that is supported by most XML authoring tools and IDEs.
I recognize that we do currently have a lot of services using jboss-beans.xml as configuration; I think that rather than devoting effort to a documentation system, we ought to be busy creating descriptor formats for these services instead.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4230892#4230892
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4230892
17 years, 2 months
[Microcontainer] - Tool for documenting MC beans
by jesper.pedersen
Since a lot of hooking our services together have moved to the -jboss-beans.xml we need a way of documenting those beans, so other projects can get a quicker overview of what's available.
Of course the beans should provide sane defaults for many of the properties, but there are a lot of cases where properties are used directly with a value or gets injected with another bean.
Currently in order to get an overview of what a bean actually does, what it depends on and what properties it exposes one have to look at the class definition.
So what I'm looking for is a tool that can generate documentation for classes that are meant to be exposed as MC beans.
Think a tool that can generate documentation sort of like TLD documentation for web libraries.
Another solution is of course to include all the documentation in the developer guide for each project, but lets not go down that road...
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4230890#4230890
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4230890
17 years, 2 months
[JNDI/Naming/Network] - Communication Exception in JBoss Cluster while connecting t
by NJaganMohanRao
Hi Everyone,
I am using JBoss in clustered mode !!!
My JBoss running Environment was:
1. JBoss running with options : -b myhostName -g mypartitionName -c ALL
2. JBoss is running on Windows XP
3. System is using Two LAN's(one of them is rendering Video's) where the JBoss server is running.
4. Client is also running in the same machine.
5. JBoss Version is 4.2.3GA
6. using EJB 3.0
Problem:
If I use Two LAN's(as I mentioned above) I am unable to connect, and my application is throws below Communication Exception
If I disable the video LAN and restart JBoss server, my application connects with out any Exception.
I am getting following Exception :
2009-05-13 19:29:08,912 [ERROR] com.mycomp.mgt.exception.CommunicationException: Unable to connect to the "MyService" Service; Host: MyHostName
at com.mycomp.dependency.Activator.addConnection(Activator.java:364)
at com.mycomp.dependency.connection.ConnectionResolver$Reconnector.run(ConnectionResolver.java:416)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out]
at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1465)
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1582)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:634)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
at javax.naming.InitialContext.lookup(Unknown Source)
at com.mycomp.mgt.MyService.connect(MyService.java:867)
at com.mycomp.mgt.MyService.(MyService.java:174)
at com.mycomp.dependency.MyService1.(MyService1.java:62)
at com.mycomp.dependency.Activator.addConnection(Activator.java:349)
... 4 more
Caused by: java.net.SocketTimeoutException: Receive timed out
at java.net.PlainDatagramSocketImpl.receive0(Native Method)
at java.net.PlainDatagramSocketImpl.receive(Unknown Source)
at java.net.DatagramSocket.receive(Unknown Source)
at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1435)
... 12 more
My Connction Parameters are :
Properties props = new Properties();
props.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
props.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
props.put("jnp.partitionName", "MY_PARTITION");
InitialContext ctx;
try
{
ctx = new InitialContext(props);
MyService connection = (MyService) ctx.lookup("MyServiceImpl/remote");
System.out.println("Connection : " + connection);
}
catch (NamingException anException)
{
// TODO Auto-generated catch block
anException.printStackTrace();
}
I am unable to sort it out :(
Can any body provide/suggest me the solution?
What's the problem in identifying the partition? and
How it is related to Network/Number of LAN's on a Computer?
Thanks in Advance,
Jagan.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4230876#4230876
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4230876
17 years, 2 months
[JNDI/Naming/Network] - Communication Exception in JBoss Cluster while connecting th
by NJaganMohanRao
I am using JBoss in clustered mode !!!
My JBoss running Environment was:
1. JBoss running with options : -b myhostName -g mypartitionName -c ALL
2. JBoss is running on Windows XP
3. System is using Two LAN's(one of them is rendering Video's) where the JBoss server is running.
4. Client is also running in the same machine.
Problem:
If I use Two LAN's(as I mentioned above) I am unable to connect, and my application is throws below Communication Exception
If I disable the video LAN and restart JBoss server, my application connects with out any Exception.
I am getting following Exception :
2009-05-13 19:29:08,912 [ERROR] com.mycomp.mgt.exception.CommunicationException: Unable to connect to the "MyService" Service; Host: MyHostName
at com.mycomp.dependency.Activator.addConnection(Activator.java:364)
at com.mycomp.dependency.connection.ConnectionResolver$Reconnector.run(ConnectionResolver.java:416)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out]
at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1465)
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1582)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:634)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
at javax.naming.InitialContext.lookup(Unknown Source)
at com.mycomp.mgt.MyService.connect(MyService.java:867)
at com.mycomp.mgt.MyService.(MyService.java:174)
at com.mycomp.dependency.MyService1.(MyService1.java:62)
at com.mycomp.dependency.Activator.addConnection(Activator.java:349)
... 4 more
Caused by: java.net.SocketTimeoutException: Receive timed out
at java.net.PlainDatagramSocketImpl.receive0(Native Method)
at java.net.PlainDatagramSocketImpl.receive(Unknown Source)
at java.net.DatagramSocket.receive(Unknown Source)
at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1435)
... 12 more
My Connction Parameters are :
Properties props = new Properties();
props.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
props.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
props.put("jnp.partitionName", "MY_PARTITION");
InitialContext ctx;
try
{
ctx = new InitialContext(props);
MyService connection = (MyService) ctx.lookup("MyServiceImpl/remote");
System.out.println("Connection : " + connection);
}
catch (NamingException anException)
{
// TODO Auto-generated catch block
anException.printStackTrace();
}
I am unable to sort it out :(
Can any body provide/suggest me the solution?
What's the problem in identifying the partition? and
How it is related to Network/Number of LAN's on a Computer?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4230867#4230867
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4230867
17 years, 2 months
[JBoss jBPM] - Email subject is empty always
by Sujatha
Hi All
My task nodes are sending reminders fine but even though i specify a subject in the template it is always empty. Did anybody face this problem?
Here is the code for template.. and the task node
<task-node name="line manager review">
| <task name="line manager review" blocking="true">
| <description> desc</description>
| <assignment actor-id="#{ifp_line_manager_actor}"></assignment>
| <controller class="com.myController"></controller>
| <reminder duedate="2 business minutes" repeat="yes"/>
| </task>
| <transition to="notify-review" name="approve"></transition>
| </task-node>
|
| My reminder template in jbpm.mail.templates.xml is
| <mail-template name='task-reminder'>
| <actors>#{taskInstance.actorId}</actors>
| <subject>REMINDER: #{processInstance.getId} requested by #{firstName} #{lastName} !</subject>
| <text><![CDATA[ REMINDER: task is assigned to you.
| ]]></text>
| </mail-template>
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4230866#4230866
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4230866
17 years, 2 months