[JBoss Seam] - When uploading a file via ice:inputFile, a component is nul
by Newlukai
Hi,
I don't know, if it's a Seam issue or an ICEfaces issue. So I'll ask both of you ;). Before I forget it: I'm using Seam 1.2.1.GA, ICEfaces 1.6 on a JBoss AS 4.0.5.GA.
I've a page where an ice:inputFile is in an ice:popupPanel.
<ice:panelPopup draggable="true"
| rendered="#{testactionDeveloper.showUpDownloadDialog}"
| visible="#{testactionDeveloper.showUpDownloadDialog}">
| <f:facet name="header">
| ... omitted ...
| </f:facet>
|
| <f:facet name="body">
| <ice:panelGrid columns="1" cellpadding="0" cellspacing="0" border="0">
| <h:dataTable value="#{testactionDeveloper.attachedFiles}"
| var="attachedFile"
| rendered="#{!empty testactionDeveloper.attachedFiles}">
| ... omitted ...
| </h:dataTable>
| <ice:inputFile actionListener="#{testactionDeveloper.upload}" style="margin-top: 30px;" id="upload" />
| </ice:panelGrid>
| </f:facet>
| </ice:panelPopup>
The "testactionDeveloper" is a Seam component which is defined as follows:
@Stateful
| @Scope(ScopeType.SESSION)
| @LoggedIn
| @Name("testactionDeveloper")
| public class TestactionDeveloperAction extends TestactionHandling implements TestactionDeveloper, Serializable {
| @In(required=false)
| private Release selectedRelease;
|
| @In(required=false)
| private Priorityclass selectedPriority;
|
| @In(required=false)
| private Severityclass selectedSeverity;
|
| @In(required=false)
| private User selectedUser;
|
| ... omitted, you'll see why ;) ...
| }
As you can see TestactionDeveloperAction subclasses TestactionHandling:
public class TestactionHandling {
| @PersistenceContext(unitName = "aresDatabase")
| protected transient EntityManager em;
|
| @In
| protected transient FacesContext facesContext;
|
| @In
| protected transient UpDownload upDownload;
|
| @In @Valid
| protected User user;
|
| public String upload(ActionEvent event) {
| InputFile uploadedFile = (InputFile) event.getSource();
| boolean success = false;
| if(uploadedFile.getStatus() == InputFile.SAVED) {
| if(testaction == null) {
| testaction = testactions.get(testactionIndex);
| }
| UpDownloadFileinfo fileInfo = new UpDownloadFileinfo();
| fileInfo.setName(uploadedFile.getFileInfo().getFileName());
| fileInfo.setFile(uploadedFile.getFile());
| fileInfo.setContentType(uploadedFile.getFileInfo().getContentType());
| fileInfo.setTestactionID(testaction.getID());
| success = upDownload.upload(fileInfo);
| }
| if( !success ) {
| return "failed";
| }
| return "uploaded";
| }
|
| public List<UpDownloadFileinfo> getAttachedFiles() {
| return upDownload.getAttachedFiles(testaction.getID());
| }
|
| ... omitted ...
| }
Here you can see that upload() and getAttachedFiles() delegate to another Seam component. This component ("upDownload") is configured via components.xml and looks like this:
@Scope(ScopeType.SESSION)
| @Stateful
| @LoggedIn
| public class UpDownloadDatabase implements UpDownload, Serializable {
| @PersistenceContext(unitName = "aresDatabase")
| private transient EntityManager em;
|
| @In
| private transient FacesContext facesContext;
|
| private boolean showUpDownloadDialog;
|
| public boolean upload(UpDownloadFileinfo fileInfo) {
| com.idsscheer.ares.entities.File dbFile = new com.idsscheer.ares.entities.File();
| dbFile.setName(fileInfo.getName().replaceAll(" ", "_"));
| dbFile.setTActID(fileInfo.getTestactionID());
| dbFile.setContenttype(fileInfo.getContentType());
|
|
| ... get the data ...
|
| dbFile.setData(dataFromFile.toByteArray());
|
| em.persist(dbFile);
| em.flush();
| return true;
| }
|
| public List<UpDownloadFileinfo> getAttachedFiles(long testactionID) {
| List<File> files = EMHelper.execQuery(em, "from File where TACT_ID=" + testactionID + " order by NAME ASC");
| List<UpDownloadFileinfo> result = new ArrayList<UpDownloadFileinfo>(files.size());
|
| for(File file : files) {
| UpDownloadFileinfo fileInfo = new UpDownloadFileinfo();
| fileInfo.setContentType(file.getContenttype());
| fileInfo.setName(file.getName());
| fileInfo.setTestactionID(file.getTActID());
| result.add(fileInfo);
| }
|
| return result;
| }
| }
This additional "upDownload" component is necessary since it should be possible to switch between saving files in a db or on a filesystem. So I just use the interface UpDownload in the clients and set the implementation in components.xml.
But my problem is now that as soon as I click on "Upload" the attribute "user" in TestactionDeveloperAction (TestactionHandling) is null. Therefore a RequiredException is thrown. But this attribute shouldn't be null, it isn't involved in the upload process. I don't know, what's wrong.
Perhaps you can read sth out of the stack trace:
15:51:33,015 WARN [UploadServlet] File upload failed
| javax.faces.el.EvaluationException: /showTestactionForDeveloper.xhtml @247,114 actionListener="#{testactionDeveloper.upload}": javax.ejb.EJBException: org.jboss.seam.RequiredException: In attribute requires non-null value: testactionDeveloper.user
| at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:73)
| at com.icesoft.faces.component.inputfile.InputFile.notifyDone(InputFile.java:254)
| at com.icesoft.faces.component.inputfile.InputFile.upload(InputFile.java:206)
| at com.icesoft.faces.webapp.http.servlet.UploadServlet.service(UploadServlet.java:66)
| at com.icesoft.faces.webapp.http.servlet.PathDispatcher$Matcher.serviceOnMatch(PathDispatcher.java:52)
| at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:29)
| at com.icesoft.faces.webapp.http.servlet.MainSessionBoundServlet.service(MainSessionBoundServlet.java:97)
| at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:35)
| at com.icesoft.faces.webapp.http.servlet.PathDispatcher$Matcher.serviceOnMatch(PathDispatcher.java:52)
| at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:29)
| at com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:85)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
| at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
| at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:359)
| at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
| at com.icesoft.faces.webapp.xmlhttp.BlockingServlet.service(BlockingServlet.java:54)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
| at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
| at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
| at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
| at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: javax.ejb.EJBException: org.jboss.seam.RequiredException: In attribute requires non-null value: testactionDeveloper.user
| at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:69)
| at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
| at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:83)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
| at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:102)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:203)
| at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:98)
| at $Proxy134.upload(Unknown Source)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:20)
| at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
| at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:72)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:57)
| at org.jboss.seam.interceptors.RemoveInterceptor.aroundInvoke(RemoveInterceptor.java:40)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
| at org.jboss.seam.interceptors.SynchronizationInterceptor.aroundInvoke(SynchronizationInterceptor.java:31)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
| at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:113)
| at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:50)
| at org.javassist.tmp.java.lang.Object_$$_javassist_36.upload(Object_$$_javassist_36.java)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at com.sun.el.parser.AstValue.invoke(AstValue.java:130)
| at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:274)
| at org.jboss.seam.ui.facelet.OptionalParameterMethodExpression.invoke(OptionalParameterMethodExpression.java:34)
| at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
| at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:69)
| ... 37 more
| Caused by: org.jboss.seam.RequiredException: In attribute requires non-null value: testactionDeveloper.user
| at org.jboss.seam.Component.getValueToInject(Component.java:1919)
| at org.jboss.seam.Component.injectAttributes(Component.java:1368)
| at org.jboss.seam.Component.inject(Component.java:1195)
| at org.jboss.seam.interceptors.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:46)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
| at org.jboss.seam.interceptors.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:27)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
| at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:103)
| at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:53)
| at sun.reflect.GeneratedMethodAccessor275.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
| at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor.invoke(ExtendedPersistenceContextPropagationInterceptor.java:57)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:46)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
| ... 77 more
Thanks in advance
Newlukai
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4071622#4071622
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4071622
18Â years, 8Â months
[Installation, Configuration & DEPLOYMENT] - Configuration Problem - Incompletely deployed packages
by hugabï¼ gmx.net
Hello,
I installed JBoss on my Windows 2003 Server machine with SP2 according to the installation Guide, but i get allway this error, if i try to start JBoss:
15:51:59, 156 ERROR [URLDeploymentscanner] Incomplete Deployment listing:
--- Packages waiting for a deployer ---
org.jboss.deployment.DeploymentInfo@1d564b40 { url=file:/D:/jboss/server/all/dep loy/adobe-ds-jboss-mysql.xml }
deployer: null
status: null
state: INIT_WAITING_DEPLOYER
watch: file:/D:/jboss/server/all/deploy/adobe-ds-jboss-mysql.xml
altDD: null
lastDeployed: 1186494719156
lastModified: 1186494719156
mbeans:
--- Incompletely deployed packages ---
org.jboss.deployment.DeploymentInfo@1d564b40 { url=file:/D:/jboss/server/all/dep loy/adobe-ds-jboss-mysql.xml }
deployer: null
status: null
state: INIT_WAITING_DEPLOYER
watch: file:/D:/jboss/server/all/deploy/adobe-ds-jboss-mysql.xml
altDD: null
lastDeployed: 1186494719156
lastModified: 1186494719156
mbeans:
therefore i cann't start JBoss
what i have done wrong??
can anyone help me to solve this problem?
Thankyou
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4071621#4071621
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4071621
18Â years, 8Â months
[JBoss Portal] - Re: Cannot retrieve user: Unable to locate current JTA trans
by kpalania
"sohil.shah(a)jboss.com" wrote : to integrate with the JAAS security realm, your best bet/cleanest solution would be to write your own Tomcat Authenticator (which is actually a form of Tomcat Valve)
|
| Authenticators are actually pretty simple in tomcat and best source of "How To" is the tomcat source code and see how the existing Authenticators like Form, basic, etc are written.
|
| You should be able to write your own looking at that.
|
|
| On the otherhand, I don't know what your authentication requirements are but most of the times LoginModules are able to create application state just fine. You have access to the HttpServletRequest, HttpServletResponse, and HttpSession inside your LoginModule, so what other objects do you need to populate/setup the proper LoginContext for your application?
|
| Thanks
Thanks Sohil. Yes, I do have access to the objects I need and this is what I do -
* I have a servlet implemented that uses the LoginContext and invokes my security realm. It passes through the various login modules and authentication succeeds. However, JBoss Portal throws an authorization exception as the principals were never set.
* If I kept everything else the same but just removed the servlet I added and used container managed authentication by using j_security_check, everything works fine and the principals are set.
* The only thing to note here (just in case) is that the JAR file that contains the login module code is added as a shared library in JBoss and is used by multiple applications but I don't suppose this is causing any issues as the other application that uses the same security realm works just fine with the same set of changes. It is only JBoss Portal that complains..
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4071619#4071619
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4071619
18Â years, 8Â months
[EJB 3.0] - NOTYETINSTALLED state
by Davide80
Hello, i've problems with an helloworld-like project.
I use netbeans 5.5 with Jboss 4_0_4 and EJB3 extentions.
When I try to deploy my ear, I receve this log from Jboss and naturally nothings work:
15:30:03,693 ERROR [URLDeploymentScanner] Incomplete Deployment listing:
--- MBeans waiting for other MBeans ---
ObjectName: persistence.units:ear=EnterpriseApplication1.ear,jar=EnterpriseApplication1-ejb.jar,unitName=EnterpriseApplication1-ejbPU
State: NOTYETINSTALLED
I Depend On:
jboss.jca:name=EnterpriseApplication1/Datasource,service=ManagedConnectionFactory
Depends On Me:
jboss.j2ee:ear=EnterpriseApplication1.ear,jar=EnterpriseApplication1-ejb.jar,name=NewSessionBean,service=EJB3
ObjectName: jboss.j2ee:ear=EnterpriseApplication1.ear,jar=EnterpriseApplication1-ejb.jar,name=NewSessionBean,service=EJB3
State: NOTYETINSTALLED
I Depend On:
persistence.units:ear=EnterpriseApplication1.ear,jar=EnterpriseApplication1-ejb.jar,unitName=EnterpriseApplication1-ejbPU
--- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
ObjectName: jboss.jca:name=EnterpriseApplication1/Datasource,service=ManagedConnectionFactory
State: NOTYETINSTALLED
Depends On Me:
persistence.units:ear=EnterpriseApplication1.ear,jar=EnterpriseApplication1-ejb.jar,unitName=EnterpriseApplication1-ejbPU
This log doesn't give any clue and i don't know what to do.
this is may source:
an Entitybean:
/*
| * NewEntityBean.java
| *
| * Created on 7 agosto 2007, 14.30
| *
| * To change this template, choose Tools | Template Manager
| * and open the template in the editor.
| */
|
| package myEJBs;
|
| import java.io.Serializable;
| import javax.persistence.Entity;
| import javax.persistence.GeneratedValue;
| import javax.persistence.GenerationType;
| import javax.persistence.Id;
|
| /**
| * Entity class NewEntityBean
| *
| * @author IG17540
| */
| @Entity
| public class NewEntityBean implements Serializable {
|
| @Id
| @GeneratedValue(strategy = GenerationType.AUTO)
| private Long id;
|
| /** Creates a new instance of NewEntityBean */
| public NewEntityBean() {
| }
|
| /**
| * Gets the id of this NewEntityBean.
| * @return the id
| */
| public Long getId() {
| return this.id;
| }
|
| /**
| * Sets the id of this NewEntityBean to the specified value.
| * @param id the new id
| */
| public void setId(Long id) {
| this.id = id;
| }
|
| /**
| * Returns a hash code value for the object. This implementation computes
| * a hash code value based on the id fields in this object.
| * @return a hash code value for this object.
| */
| @Override
| public int hashCode() {
| int hash = 0;
| hash += (this.id != null ? this.id.hashCode() : 0);
| return hash;
| }
|
| /**
| * Determines whether another object is equal to this NewEntityBean. The result is
| * <code>true</code> if and only if the argument is not null and is a NewEntityBean object that
| * has the same id field values as this object.
| * @param object the reference object with which to compare
| * @return <code>true</code> if this object is the same as the argument;
| * <code>false</code> otherwise.
| */
| @Override
| public boolean equals(Object object) {
| // TODO: Warning - this method won't work in the case the id fields are not set
| if (!(object instanceof NewEntityBean)) {
| return false;
| }
| NewEntityBean other = (NewEntityBean)object;
| if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) return false;
| return true;
| }
|
| /**
| * Returns a string representation of the object. This implementation constructs
| * that representation based on the id fields.
| * @return a string representation of the object.
| */
| @Override
| public String toString() {
| return "myEJBs.NewEntityBean[id=" + id + "]";
| }
|
| }
|
| a stateless session bean:
| /*
| * NewSessionBean.java
| *
| * Created on 7 agosto 2007, 14.31
| *
| * To change this template, choose Tools | Template Manager
| * and open the template in the editor.
| */
|
| package myEJBs;
|
| import javax.ejb.Stateless;
| import javax.persistence.EntityManager;
| import javax.persistence.PersistenceContext;
|
| /**
| *
| * @author IG17540
| */
| @Stateless
| public class NewSessionBean implements NewSessionRemote, NewSessionLocal {
|
| @PersistenceContext
| private EntityManager em;
|
| /** Creates a new instance of NewSessionBean */
| public NewSessionBean() {
| }
|
| public Integer calcola(Integer a) {
| //TODO implement calcola
| return null;
| }
|
| public void persist() {
| NewEntityBean eb = new NewEntityBean();
| em.persist(eb);
| }
|
| }
|
|
|
| a jsp page:
| <%
| InitialContext ctx = new InitialContext();
| NewSessionLocal eb = (NewSessionLocal) ctx.lookup("EnterpriseApplication1/NewSessionBean/local");
| out.write(eb.calcola(new Integer(4)).toString());
|
|
| eb.persist();
| %>
|
the persistence.xml:
<?xml version="1.0"...
| <persistence version............
| <jta-data-source>EnterpriseApplication1/Datasource</jta-data-source>
| <exclude-unlisted-classes>false</exclude-unlisted-classes>
| <properties>
| <property name="hibernate.hbm2ddl.auto" value="update"/>
| </properties>
| </persistence-unit>
| </persistence>
jboss-ds.xml:
<?xml version="1.0" encoding="UTF-8"?>
| <datasources>
| <local-tx-datasource>
| <jndi-name>Datasource</jndi-name>
| <connection-url>jdbc:odbc:CRTSIG4</connection-url>
| <driver-class>sun.jdbc.odbc.JdbcOdbcDriver</driver-class>
| <user-name>pwrline</user-name>
| <password>pwrline</password>
| <min-pool-size>5</min-pool-size>
| <max-pool-size>20</max-pool-size>
| <idle-timeout-minutes>5</idle-timeout-minutes>
| </local-tx-datasource>
| </datasources>
I tried changing the JNDI name format, the data source driver, the version of jboss, the OS (both linux and windows) and this seems the best version(!), however nothings works...
Help me, please.. :-(
David
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4071614#4071614
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4071614
18Â years, 8Â months
[EJB 3.0] - Microconatiner and @Depends, @Service annotations ...
by jc7442
I implement a service :
@Service(objectName = "babar:service=auditLock")
| @Management(BabarAuditManagerBean.class)
| public class AuditLock implements BabarAuditManagerBean {
| ...
This service is used in a session bean injecting by the annotation depends:
@Depends("babar:service=auditLock")
| BabarAuditManagerBean babarManager;
It works fine in JBoss 4.2.0.
I perform some unit tests in microcontainer. Consequently in microcontaienr I explicitely deploy my service as a class. When conatiner try to inject the service I have the following exception:
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
| at java.util.ArrayList.RangeCheck(ArrayList.java:546)
| at java.util.ArrayList.get(ArrayList.java:321)
| at org.jboss.injection.DependsFieldInjector.inject(DependsFieldInjector.java:64)
| at org.jboss.injection.DependsFieldInjector.inject(DependsFieldInjector.java:50)
| at org.jboss.ejb3.AbstractPool.create(AbstractPool.java:101)
| at org.jboss.ejb3.ThreadlocalPool.get(ThreadlocalPool.java:61)
| at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:54)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
| at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:105)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:214)
| at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:184)
| at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:81)
@depends, @Service annotations, are they supposed to work with JBoss microcontainer ?
Is there something special to do for the deployment ?
Helps and sample are welcome
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4071612#4071612
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4071612
18Â years, 8Â months