[JBossWS] - java.lang.IllegalStateException: Cannot obtain endpoint meta
by r12345_2003
Hi All,
I am very new to JBoss web services and am trying to create a sample web service application using JBoss WS. Here is what i have done so far:
1) Created a POJO for the web service. Its source code is as follows:
package test.webservices;
|
| import javax.jws.WebMethod;
| import javax.jws.WebParam;
| import javax.jws.WebService;
| import javax.jws.soap.SOAPBinding;
|
|
| @WebService(name = "CalculatorService")
| public class CalculatorService
| {
| @WebMethod
| public Integer add(@WebParam(name = "arg1")Integer arg1,@WebParam(name = "arg2") Integer arg2){
| return arg1+arg2;
| }
| }
|
2) Created entry in web.xml. My web.xml looks like the following:
| <?xml version="1.0" encoding="UTF-8"?>
| <web-app version="2.4"
| 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/web-app_2_4.xsd">
|
| <servlet>
| <servlet-name>CalculatorService</servlet-name>
| <servlet-class>test.webservices.CalculatorService</servlet-class>
| </servlet>
|
| <servlet-mapping>
| <servlet-name>CalculatorService</servlet-name>
| <url-pattern>/CalculatorService</url-pattern>
| </servlet-mapping>
|
| </web-app>
|
3) Deployed the project as a war file. However when i start the server, i see the following exception trace:
java.lang.IllegalStateException: Cannot obtain endpoint meta data
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleWSDLRequest(RequestHandlerImpl.java:520)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doGet(RequestHandlerImpl.java:144)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:126)
| at org.jboss.wsf.stack.jbws.EndpointServlet.service(EndpointServlet.java:84)
| 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:179)
| 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:595)
|
When i open the link http://localhost:8080/jbossws/services, I can see an end point name and end point address. However when i click on the WSDL link, i do not see the WSDL.
Can someone help me in figuring out what might be the issue?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4139353#4139353
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4139353
18 years
[JBoss AOP] - Re: Problem with annotation in test case AnnotatedSecureRunA
by kabir.khan@jboss.com
OK, let's start with an annotation 101 :-) Annotations are only supported from JDK 5 onwards, and the typical use is
Define annotation (this will implement the Annotation interface):
| @interface SomeAnnotation{}
|
Use annotation
| @SomeAnnotation
| class SomeClass{}
|
In AOP we provided an annotation compiler, so that you could use "annotations" in jdk 1.4. The difference is that the annotations are simple java interfaces and thus don't implement the (non-existing on jdk 1.4) Annotation interface.
| interface SomeAnnotation{}
|
Then you use that annotation as part of the javadoc
| /**
| * @@SomeAnnotation
| */
| class SomeClass{}
|
We then run the annotated classes through the annotation compiler, and the annotations are put in class attributes just the same as real annotations. What is happening here:
| When I run the doclet against the AS 4.2.2 testsuite as is, using JDK 5, I get the exception:
| [javadoc] /home/nrla/jboss-4.2.2.GA-src/testsuite/src/main/org/jboss/test/aop/bean/AnnotatedSecureRunAsPOJO.java:52: incompatible types
| [javadoc] found : org.jboss.aspects.security.Unchecked
| [javadoc] required: java.lang.annotation.Annotation
| [javadoc] @Unchecked
|
Is that when reading the annotation it tries to resolve "Unchecked", but finds the plain interface rather than the real annotation.
The problems you are seeing stem from that in AS 4.0.x we ran the testsuite both on jdk 1.4 and jdk 5. The annotations exist both in
testsuite/src/main (plain interfaces)
testsuite/src/jdk15 (real annotations)
and it would use different versions of these depending on the JDK version used to do the test.
Since AS 4.2.x is a JDK5 thing only, we no longer need the split. I suggested to Shelly to merge these. In more detail, what is required is something like what you suggested:
* moving the src/jdk15 stuff into src/main so that you have the real annotations in the main classpath
* Using source=1.5 when running javac
See the AS trunk testsuite for more details on how to set this up.
I see that the aspects/ project in AS 4.2.2 still uses the split between jdk 1.5 and jdk 1.4 in its aspects/ project. Again see AS trunk for guidance.
I don't think you can actually make any of the changes I suggested since 4.2.2 has been released.
The main problem is that your stuff uses the jdk 1.4 version of the aspects library, probably from this definition in tools/etc/buildmagic/modules.ent:
| <property name="jboss.aspects.root" value="${project.root}/aspects/output"/>
| <property name="jboss.aspects.lib" value="${jboss.aspects.root}/lib"/>
| <path id="jboss.aspects.classpath">
| <pathelement path="${jboss.aspects.lib}/jboss-aspect-library.jar"/>
| </path>
|
You need to use the JDK 5 version, which is what the testsuite build.xml does when compiling the JDK 5 version of the testsuite
| <target name="compile-annotated-classes-50" if="HAVE_JDK_1.5">
| <mkdir dir="${build.classes}"/>
|
| <!-- Make sure that jdk 50 aspect library comes first, since that contains the
| JDK 5 version of the annotation types
| -->
| <path id="annotations.classpath">
| <pathelement path="${jboss.aop.lib}/jboss-aop-jdk50.jar"/>
| <pathelement path="${jboss.aspects.lib}/jboss-aspect-library-jdk50.jar"/>
| <path refid="tests.compile.classpath"/>
| </path>
| <javac destdir="${build.classes}" optimize="${javac.optimize}" source="1.5" target="1.5" debug="${javac.debug}" depend="${javac.depend}" verbose="${javac.verbose}"
| deprecation="${javac.deprecation}" includeAntRuntime="${javac.include.ant.runtime}" includeJavaRuntime="${javac.include.java.runtime}"
| failonerror="${javac.fail.onerror}">
| <src path="${source.java.5}"/>
| <classpath refid="annotations.classpath"/>
| </javac>
| </target>
|
|
If you do something similar, you should be fine
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4139352#4139352
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4139352
18 years
[Persistence, JBoss/CMP, Hibernate, Database] - Deleting one side of a ManyToMany
by apinto
Hi there!
I have a ManyToMany relation between ClassA and ClassB, defined in the following way:
ClassABean.java:
| @ManyToMany
| @JoinTable(name="a_b",
| joinColumns=@JoinColumn(name="aid", referencedColumnName="id"),
| inverseJoinColumns=@JoinColumn(name="bid", referencedColumnName="id"))
| public Set<ClassBBean> getMyBs()
|
ClassBBean.java:
| @ManyToMany(mappedBy="myBs")
| public Set<ClassABean> getMyAs()
|
The problem is that when I try to delete a ClassB entity, it fails with the violation if an integrity constraint (child record found). If I put a CascadeType.ALL in the ClassB definition, it deletes the corresponding ClassA entity, even if it has other associations... What I want is to just delete de ClassB entity!
Can anyone help me? What am I missing? Thanks a lot in advance,
AP
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4139346#4139346
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4139346
18 years