Announcement Announcement Module
Collapse
No announcement yet.
trouble whit @Service annotation Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • trouble whit @Service annotation

    I'm not an expert in spring.
    I try to see how work @service annotation, because it's an interesting option, to expose services to flex.
    I see that, when deploy an class, as .class file, everything work as is expected. But when deploy same class as jar, service it's not exposed.
    Can someone to confirm that problem?
    Or need some extra configuration?

  • #2
    The annotation that actually exposes a remote object is: @RemotingDestination. Are you using that along with @Service?

    Can you provide some excerpts from your code/configuration?

    Comment


    • #3
      I try'it to follow test drive posted by Cristophe Coenraets. In this example it'se used both annotation, @Service and @RemotingDestination.
      My class look like this:
      Code:
      @Service("myService")
      @RemotingDestination(channels = { "my-amf" })
      public class MyTestService {
      
      	@RemotingInclude
      	public String testMethod() {
      		return "Hello World!";
      	}
      }
      Everything work fine, when class it's deployed as class file, but service it's not found when i deploy as jar.
      Thanks for reply!

      Comment


      • #4
        Are you saying it works in WEB-INF/classes but not when deployed as a jar in WEB-INF/lib?

        Comment


        • #5
          Yes, that i want to say.

          Comment


          • #6
            Did you rebuild the WAR?

            By the way, you can also run the testdrive sample from the SpringBlazeDS distribution within Eclipse/WTP as described here:
            http://static.springframework.org/sp...html/ch06.html

            Comment


            • #7
              I don't have an war file. BlazeDS it's deployed as directory structure, and jar file it's put in his lib directory.

              Comment


              • #8
                You are using the downloaded sample zip from this blog, correct?:
                http://coenraets.org/blog/2009/05/ne...on-test-drive/

                Comment


                • #9
                  Yes, but post from Coenraets, give me idea.
                  I work on my own test-drive application, because i try to use hibernate. Coenraets , in his test-drive, use JDBC template.
                  Anyway, thanks to your help from another post, application work, i can invoke service exposed by @Service, but only when deploy class as class file. That is strange.

                  Comment


                  • #10
                    Okay. That is strange. You are putting the JAR in webapps/ROOT/WEB-INF/lib? Did you restart?

                    Comment


                    • #11
                      Of course.
                      I work to an project using LCDS with java + Hibernate. All classes in my project are deployed as jar file without any problem.
                      But in this case, i don't know why not work. i try'it with an simple class, an classic "HelloWorld" example, to test how work. And i have this problem.
                      On flex side, i have only an minimalistic structure. I intercept result, using breakpoint in result handler of my remoteObject.
                      If u can make an simple test to try, will be better.
                      Or, i can give u my files. BlazeDS deployment, with flex source, and java class.

                      Comment


                      • #12
                        Additionally to last post, error that i get in flex say:
                        Code:
                        [RPC Fault faultString="No destination with id 'myTestService' is registered with any service." faultCode="Server.Processing" faultDetail="null"]
                        	at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()[C:\autobuild\3.3.0\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:240]
                        	at mx.rpc::Responder/fault()[C:\autobuild\3.3.0\frameworks\projects\rpc\src\mx\rpc\Responder.as:53]
                        	at mx.rpc::AsyncRequest/fault()[C:\autobuild\3.3.0\frameworks\projects\rpc\src\mx\rpc\AsyncRequest.as:103]
                        	at NetConnectionMessageResponder/statusHandler()[C:\autobuild\3.3.0\frameworks\projects\rpc\src\mx\messaging\channels\NetConnectionChannel.as:569]
                        	at mx.messaging::MessageResponder/status()[C:\autobuild\3.3.0\frameworks\projects\rpc\src\mx\messaging\MessageResponder.as:222]
                        Where 'myTestService', it's service name give in @Service annotation for my class, that i try to invoke.
                        Same java class, same config files, same flex project work without any problem, when class it's deployed as class file.

                        Comment


                        • #13
                          I got solutions. Seem that it's about how eclipse export jar file.
                          To resolve this, need to check "Add directory entries" option when make export in Eclipse.
                          Tested and worked!
                          Thanks for all responses and time!

                          Comment

                          Working...
                          X