小编use*_*694的帖子

找不到依赖项:预计至少有一个bean可以作为此依赖项的autowire候选者.依赖注释:

我正在尝试使用Spring编写SOAP服务,但是我收到了依赖注入问题.我@Autowired通过服务使用这样的问题:

    public interface UserDao {
    User getUser(String username);
}
Run Code Online (Sandbox Code Playgroud)

Dao的实施如下:

  @Controller("userDao")
    public class UserDaoImpl implements UserDao {
    private static Log log = LogFactory.getLog(UserDaoImpl.class);

    @Autowired
    @Qualifier("sessionFactory")
    private LocalSessionFactoryBean sessionFactory;

    @Override
    public User getUser(String username) {
        Session session = sessionFactory.getObject().openSession();
        // Criteria query = session.createCriteria(Student.class);
        Query query = session
                .createQuery("from User where username = :username");
        query.setParameter("username", username);
        try {
            System.out.println("\n Load Student by ID query is running...");
            /*
             * query.add(Restrictions.like("id", "%" + id + "%",
             * MatchMode.ANYWHERE)); return (Student) query.list(); …
Run Code Online (Sandbox Code Playgroud)

java spring soap web-services

53
推荐指数
7
解决办法
30万
查看次数

如何按位置名称查找地址(android google map)

目前我正在开发一个Android应用程序.根据我的收集数据,我有一个位置列表(不是地址) - 只有位置名称(例如餐馆名称,度假村,海滩......),我想在Google Map API上找到每个位置的地址,如下所示图片: 在此输入图像描述

我怎么能这样做?

在这种情况下,我感谢您的帮助.谢谢.

我也在寻找一种方法,但我只找到了从特定地址获得纬度或经度的解决方案.

我实现如下代码但不能返回结果:(

    Geocoder coder = new Geocoder(this);
    List<Address> address;
    try {
    String locationName = "Nhà hàng Blanchy Street, VietNam";
    Geocoder gc = new Geocoder(this);
    List<Address> addressList = coder.getFromLocationName(locationName, 5);
    Address location = addressList.get(0);

    double latitude = location.getLatitude();
    double longitude = location.getLongitude();

        LatLng sydney = new LatLng(latitude , longitude );
        map.setMyLocationEnabled(true);
        map.moveCamera(CameraUpdateFactory.newLatLngZoom(sydney, 13));
Run Code Online (Sandbox Code Playgroud)

java android google-maps

6
推荐指数
1
解决办法
6807
查看次数

标签 统计

java ×2

android ×1

google-maps ×1

soap ×1

spring ×1

web-services ×1