小编Jac*_*mok的帖子

java.lang.NoClassDefFoundError:javax/el/ELManager

我正在使用Spring Tool Suite在Spring上开发一个webapp.如果我使用IDE在所提供的Pivotal tc服务器上构建和部署应用程序,它就可以正常工作.但是,如果我执行手动"mvn clean package"构建并尝试将其部署到独立的Tomcat服务器(使用最新的Tomcat 7),则会引发以下异常:

2017-08-23 15:24:13 WARN  AnnotationConfigWebApplicationContext:551 - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerAdapter' defined in org.springframework.web.servlet.config.annotation.DelegatingWebMvcConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter]: Factory method 'requestMappingHandlerAdapter' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mvcValidator' defined in org.springframework.web.servlet.config.annotation.DelegatingWebMvcConfiguration: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: javax/el/ELManager
2017-08-23 15:24:13 ERROR DispatcherServlet:502 - Context initialization …
Run Code Online (Sandbox Code Playgroud)

java tomcat noclassdeffounderror maven

21
推荐指数
4
解决办法
3万
查看次数

对于具有虚函数的类,gdb打印非字符串值的静态const数组的无效地址

编辑:请向下滚动至问题末尾的“编辑”部分,以获取更多最新信息。我不会编辑本文的其余部分以保留评论的历史记录。

我在头文件中定义了一个类,如下所示:

class TestClass
{
public:
  TestClass() { }
  ~TestClass() { }
  void Test();
private:
  static const char * const carr[];
  static const int iarr[];
};
Run Code Online (Sandbox Code Playgroud)

TestClass::Test()函数只是确保两个数组都被使用,所以它们没有被优化-将它们打印到日志中。为了清楚起见,我不会在这里发布它。数组在.cpp文件中初始化。

大写情况很好,当创建此类的实例时,地址如下所示:

t   TestClass * 0x20000268  
    carr    const char * const[]    0x8002490 <TestClass::carr> 
    iarr    const int []    0x800249c <TestClass::iarr>
Run Code Online (Sandbox Code Playgroud)

开头的内存地址0x20...属于RAM区域,而0x80...属于ROM / Flash。如预期的那样,两个阵列都放置在ROM中。

但是,如果我将virtual限定符添加到类中的任何函数,例如其析构函数,如下所示:

class TestClass
{
public:
  TestClass() { }
  virtual ~TestClass() { }
  void Test();
private:
  static const char * const carr[];
  static const …
Run Code Online (Sandbox Code Playgroud)

c++ gdb

15
推荐指数
1
解决办法
267
查看次数

使用 JPA 的 Criteria API 按日期间隔分组

我正在尝试使用 JPA 的 Criteria API 按日期间隔对实体进行分组。我使用这种查询实体的方式,因为这是服务 API 请求的服务的一部分,这些请求可能会要求任何实体的任何字段,包括排序、过滤、分组和聚合。除了按日期字段分组外,一切正常。我的底层 DBMS i PostgreSQL。

举一个最小的例子,这是我的实体类:

@Entity
@Table(name = "receipts")
public class DbReceipt {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    private Date sellDate;
    // Many other fields
}
Run Code Online (Sandbox Code Playgroud)

这个例子讨论了对我的“月”间隔进行分组(因此按年+月分组),但最后我正在寻找一种可以让我按任何间隔分组的解决方案,例如“年”、“日”或“分钟” ”。

我想要实现的是以下查询,但使用 Criteria API:

SELECT TO_CHAR(sell_date, 'YYYY-MM') AS alias1 FROM receipts GROUP BY alias1;

我这样做的尝试是这样的:

@Service
public class ReceiptServiceImpl extends ReceiptService {
    @Autowired
    private EntityManager em;

    @Override
    public void test() {
        CriteriaBuilder cb = em.getCriteriaBuilder();
        CriteriaQuery<Object[]> query = cb.createQuery(Object[].class);
        Root<?> root = query.from(DbReceipt.class);
        Expression<?> …
Run Code Online (Sandbox Code Playgroud)

postgresql hibernate jpa criteria-api spring-boot

5
推荐指数
1
解决办法
987
查看次数

OpenSSL“perl 配置 mingw”退出并出现错误“perl 实现不会生成类似 Unix 的路径”

我正在尝试在 Windows 上使用 MinGW 从源代码(从今天开始使用 git master)编译 OpenSSL。运行perl Configure mingw no-asm返回错误:

    这个 perl 实现不会产生类似 Unix 的路径(带有正斜杠
    目录分隔符)。请使用与您匹配的实现
    建设平台。

    此 Perl 版本:5.24.1 for MSWin32-x86-multi-thread-64int

这很有趣,因为这意味着它会检查我是否使用 Unix 而不是 Windows。相比之下,跑步perl Configure VC-WIN32 no-asm效果很好。

在这种情况下,它是否应该检查 Unix?或者也许我遗漏了一些东西,例如指定我所在平台的方法?

openssl mingw

3
推荐指数
1
解决办法
5411
查看次数