问题标签 [classmate]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
java - 为什么 Hibernate 4.2 使用 jandex 和 classmate 如果它的 Maven POM 将它们定义为测试范围?
我正在使用 Hibernate 开发一个简单的示例,在任何容器之外使用它。我正在使用 Maven,因此配置了 JBoss 存储库(请参阅https://community.jboss.org/wiki/MavenGettingStarted-Users)并将以下依赖项添加到我的项目的 POM 中:
然后我继续配置 Hibernate 以使用这样的 H2 数据库(文件 hibernate.cfg.xml):
最后,我为一个简单的联系人类创建了一个 POJO,如下所示:
最后,我创建了一个获取会话工厂、会话并最终持久化实体的类。代码如下:
当我运行此代码时,这就是我得到的:
调查org.hibernate/hibernate-core
我添加到项目中的依赖项的 POM,我可以看到它依赖于org.jboss/jandex 1.0.3.Final
. 满足这种依赖性,我现在得到了一个NoClassDefFoundError: com/fasterxml/classmate/TypeResolver
. 回到 Hibernate 的 POM,它依赖于com.fasterxml/classmate 0.5.4
. 在我的项目中也满足了这种依赖关系,我终于能够在没有任何NoClassDefFoundError
s 的情况下执行代码。
在 Hibernate 的 POM 中,jandex 和 classmate 都被定义为test
依赖项,这就是为什么 Maven 的传递依赖解析功能不会将它们自动添加到我的项目中的原因。但是,为什么在我运行简单代码时需要它们?我究竟做错了什么?
在此先感谢您的任何指点。- 维托
java - hibernate 4.3.5 with classmate on glassfish 4 typeresolver error
I recently updated an app i'm working on from glassfish 3.1.2 to glassfish 4.0, and in the process updated my hibernate to 4.3.5.
after getting everything together, when i try to actually deploy my app and hit the front page, on the first database requests, i get errors like this:
I looked this error up on google and am unable to find anyone with a similar problem, and i'm wondering if i am doing something wrong with my annotations? I am using entity manager, and persistence methods to annotate Entity beans as my method of db access, and it was working fine before the upgrade. Unfortunatey, the documentation for fasterxml.classmate seems to have moved or disappeared, and i don't know if there is something i'm supposed to be doing to enable it to work properly. Alternately, there may be something i need to change in the way things are set up that i'm unaware of....
Any help appreciated....has anyone seen something like this before?
java - 用java同学解析泛型类型
在尝试使用 TypeTools Resolving generic type information with TypeTools 失败后,我尝试改用https://github.com/cowtowncoder/java-classmate。
有人可以帮我修复此代码吗?
我收到此错误:
java.util.LinkedHashMap 不能在 shouldMapToFoo(LoginInputMapTest.java:83) 处转换为 LoginInputMapTest$Foo java.lang.ClassCastException
使用这个最小的测试用例:
grails - 正确的 Grails 插件
我是 Grails 的新手,所以我为新手问题道歉。
我正在尝试将应用程序从 1.3.7 移动到 2.4.3,然后我点击了这个插件 - classmate-1.1.0。我已将 BuildConfig.grrovy 文件中的条目设置为:
运行时'com.fasterxml:classmate:1.1.0'
但是,虽然我可以在以下位置找到 .jar 文件:
http://mvnrepository.com/artifact/com.fasterxml/classmate/1.1.0
,我似乎找不到 .zip 文件。这让我感到惊讶,因为我原以为“运行时”只需要 jar(而不是“编译”)
有人可以告诉我从哪里获得正确的 zip 文件,或者向我解释为什么框架想要拥有 .zip 文件。
谢谢,
斯坦