[JBoss Seam] - Re: Web Beans Sneak Peek
by gavin.king@jboss.com
anonymous wrote : My argument against the @Named annotation wasn't about the number of extra key strokes (as you pointed out, there is only one!) I was merely saying that to me, if you say that a component has a name, it would make more sense that it has a "name" attribute, not a separate annotation. Are you saying that because many annotations have to share common attributes that those common attributes should be turned into individual annotations just so you don't have to repeat them on each one? Take the @Stateless and @Stateful annotation. Are you saying that the EJB 3 spec is wrong in having duplicated the set of attributes they have in them?
Yes, I think that was a mistake. If I'm writing code that needs to discover the name of an EJB, it would be *much* better if there was just one annotation to look for. If annotation inheritance was supported, it would not be a problem, we could have @Stateless and @Stateful both extend @EJBComponent, and it might be OK.
It's even worse in Web Beans, where component types can be defined by the user.
When people see annotations, they start to forget all their OO modeling knowledge, for some reason. Try to think in terms of modeling and typesafety.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4102065#4102065
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4102065
18 years, 5 months
[JBoss Seam] - Re: Custom Converter
by terryb
No luck for me yet, its still going to seam debug page. please see my code below...
| @Name("onlineConverters")
| @Scope(ScopeType.APPLICATION)
| public class Converters {
|
| private Converter memberSource;
|
| @Create
| public void init() {
| this.memberSource = new MemberSource();
| }
|
| public Converter getMemberSource() {
| return this.memberSource;
| }
|
| @Intercept(InterceptionType.NEVER)
| public class MemberSource implements Converter {
|
|
| ...
| if (conversionFailed) {
| FacesMessage facesMsg = new FacesMessage("Conversion error.", String.format("Invalid member status %s.", ((String) value)));
| facesMsg.setSeverity(FacesMessage.SEVERITY_ERROR);
| FacesMessages.instance().add(facesMsg);
|
| throw new ConverterException(facesMsg);
| }
| ...
| }
| ...
| }
|
|
| Seam Debug Page
| - Exception
| Exception during request processing: javax.servlet.ServletException: Conversion error.
| javax.faces.webapp.FacesServlet.service(FacesServlet.java:249)
| org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
| ...
| ...
| 13:36:39,887 ERROR [DebugPageHandler] redirecting to debug page
| javax.faces.convert.ConverterException: Conversion error.
| at au.edu.tisc.session.Converters$MemberSource.getAsString(Converters.java:61)
| at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getFormattedValue(HtmlBasicRenderer.java:469)
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4102063#4102063
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4102063
18 years, 5 months
[EJB 3.0] - constraint violation issue.
by DoubleDenim
I've been trying to solve this issue for a day now. And i think it pretty much comes down to a lack of understanding of the life cycle.
I've got a session bean that calls a method on my persistence manager, passing it a persistence object called "session".
this method goes through my session persistence object and deletes attached elements of it, however it throws a constraint violation when i try to remove the SessionRate(s), saying there is a FK constraint on session.sessionRate, even though i have removed this relationship by setting session.sessionRate to null on my first line. So even though I have removed the value that is causing the constraint violation in the first line, i still get code that is run after this causing a constraint violation, therefore nothing gets changed and the whole lot gets rolled back. I am wondering if it is because it is all being done in the same batch/transaction?? see below.
em.createQuery("update Session s SET s.sessionRate = :sessionRate WHERE s = :session").setParameter("sessionRate",null).setParameter("session",session).executeUpdate();
| for(SessionPartner sessionPartner:session.getSessionPartners())
| {
| for(SessionDepartureLocation sessionDepartureLocation:sessionPartner.getSessionDepartureLocations())
| {
| for(SessionArrivalLocation sessionArrivalLocation:sessionDepartureLocation.getSessionArrivalLocations())
| {
|
| em.createQuery("delete SessionRate sr where sr.sessionArrivalLocation = :sessionArrivalLocation").setParameter("sessionArrivalLocation",sessionArrivalLocation).executeUpdate();
| }
| em.createQuery("delete SessionArrivalLocation sal where sal.sessionDepartureLocation = :sessionDepartureLocation").setParameter("sessionDepartureLocation",sessionDepartureLocation).executeUpdate();
| }
|
| em.createQuery("delete SessionDepartureLocation sdl where sdl.sessionPartner = :sessionPartner").setParameter("sessionPartner",sessionPartner).executeUpdate();
| }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4102058#4102058
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4102058
18 years, 5 months
[JBossWS] - Problem deploying WebServices
by thenewmexican
JBoss Appserver version: 4.0.5
When testing the the deployment of a test echo WS. I get the following on the client side:
Cannot unmarshall SOAPMessage
javax.xml.soap.SOAPException: Failed to create SOAPFactory: org.jboss.axis.soap.SOAPFactoryImpl
at javax.xml.soap.SOAPFactory.newInstance(SOAPFactory.java:48)
at org.jboss.ws.core.soap.SOAPFactoryImpl.createElement(SOAPFactoryImpl.java:113)
at org.jboss.ws.core.soap.EnvelopeBuilderDOM.build(EnvelopeBuilderDOM.java:87)
at org.jboss.ws.core.soap.EnvelopeBuilderDOM.build(EnvelopeBuilderDOM.java:76)
at org.jboss.ws.core.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:253)
at org.jboss.ws.core.soap.SOAPMessageUnMarshaller.read(SOAPMessageUnMarshaller.java:75)
at org.jboss.remoting.transport.http.HTTPClientInvoker.readResponse(HTTPClientInvoker.java:463)
at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java:299)
at org.jboss.remoting.transport.http.HTTPClientInvoker.transport(HTTPClientInvoker.java:133)
at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:122)
at org.jboss.remoting.Client.invoke(Client.java:1544)
at org.jboss.remoting.Client.invoke(Client.java:530)
at org.jboss.ws.core.soap.SOAPConnectionImpl.callInternal(SOAPConnectionImpl.java:192)
at org.jboss.ws.core.soap.SOAPConnectionImpl.call(SOAPConnectionImpl.java:109)
at org.jboss.ws.core.CommonClient.invoke(CommonClient.java:309)
at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:185)
at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:163)
at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:149)
at $Proxy8.echo(Unknown Source)
at com.htg.tests.WebServicesTest.testEcho(WebServicesTest.java:42)
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 junit.framework.TestCase.runTest(TestCase.java:164)
at junit.framework.TestCase.runBare(TestCase.java:130)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:120)
at junit.framework.TestSuite.runTest(TestSuite.java:230)
at junit.framework.TestSuite.run(TestSuite.java:225)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: java.lang.ClassNotFoundException: org.jboss.axis.soap.SOAPFactoryImpl
I didn't realize that the org.jboss.axis.soap classes were still being used.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4102056#4102056
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4102056
18 years, 5 months