Home > Back-end >  For help, dubbox, small demo for springMvc framework
For help, dubbox, small demo for springMvc framework

Time:09-16

Registry service party, browser type, the springmvc resultMapping matching url, registry of consumer, but complains

Java. Lang. An IllegalStateException: Failed to check the status of the service. Com MAO. Demo. Service. No provider available for service com. MAO. Demo. Service: 1.0.0 from the zookeeper url://192.168.25.128:2181/com. Alibaba. Dubbo. Registry. RegistryService? Anyhost=true& Application=dubboxWeb& Check=false& Dubbo=2.8.4 & amp; Generic=false& Interface=com. MAO. Demo. Service& The methods=getName& Pid=1892 & amp; Revision=1.0.0 & amp; Side=consumer& Timestamp=1594360866262 & amp; Version=1.0.0 to the consumer 192.168.74.1 use dubbo version 2.8.4
Com. Alibaba. Dubbo. Config. ReferenceConfig. CreateProxy (ReferenceConfig. Java: 420)


And oddly mistyped the url, but as long as literally write a encounter url - the pattern matching url (such as & lt; Url - pattern> . Action CodePudding user response:

Someone, anyone

CodePudding user response:

If you want to match with. The url at the end of the action, should be configured & lt; Url - pattern> *. ActionDubbo that exception has been prompt No provider available for service (No available service providers), that is to say the party service without registration, inspection service register configuration

CodePudding user response:

This is the consumer web. XML

Springmvc

Org. Springframework. Web. Servlet. DispatcherServlet

ContextConfigLocation
The classpath: for springmvc. Xml



Springmvc
*. Action

CodePudding user response:

This is the web service. The XML


ContextConfigLocation
The classpath: applicationContext *. Xml


Org. Springframework. Web. Context. ContextLoaderListener

CodePudding user response:

This is the service party applicationContext. XML

This is the consumer, the springMvc. XML





CodePudding user response:


The service side and consumer port conflicts

CodePudding user response:

Check service whether the use of dubbo service annotations

CodePudding user response:

The service side
Package com. MAO. Demo. Impl;

The import com. MAO. Demo. Service;
@ com. Alibaba. Dubbo. Config. The annotation. Service (version="1.0.0")
Public class ServiceImpl implements Service {

Public String getName () {
//TODO Auto - generated method stub
Return "itheima";
}

}
Consumer code

Package com. MAO. Demo. The controller;

The import org. Springframework. Stereotype. The Controller;
import org.springframework.web.bind.annotation.RequestMapping;
The import org. Springframework. Web. Bind. The annotation. ResponseBody;

import com.alibaba.dubbo.config.annotation.Reference;
The import com. MAO. Demo. Service;

@ Controller
@ RequestMapping ("/user ")
Public class UserController {
@ the Reference (version="1.0.0")
Private Service Service;
@ RequestMapping ("/showName ")
@ ResponseBody
Public String showName () {
String name=service. The getName ();
return name;
}
}

The project to ensure that two have the same interface

CodePudding user response:

Your consumer and service port to the agreement of not the same, try to restart again

CodePudding user response:

Changed or not, will is what effect will the environment, I use maven

CodePudding user response:

And I casually input (as long as there is. The action suffix) url, the background will explode the error

CodePudding user response:

Configuration specified registered client, need to pay attention to the zk version and the registered client version compatibility
See the official explanation:
Dubbo support zkclient and curator Zookeeper client implementation:

Note: in 2.7 x version has removed zkclient implementation, if you want to use zkclient client, need to expand the
Or:

Dubbo. Registry. Client=curator
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related