小编mal*_*una的帖子

Liquibase Hibernate插件不起作用

如此处所述(https://github.com/liquibase/liquibase-hibernate/issues/74)我遇到了使liquibase-hibernate扩展正常工作的问题.我想我已经完成了所有设置,但似乎我一直遇到奇怪的问题.我觉得我错过了一些简单的东西,但我想我已按照提供的所有说明进行操作.

我正在使用liquibase 3.3.2,Hibernate 4.3.0.Final,java 1.7.0_71和liquibase-hibernate4-3.5.jar.我的CLASSPATH环境变量是空的,但liquibase shell脚本会添加一些东西.当我使用正常的liquibase命令进行交互时,我从$ LIQUIBASE_HOME/lib /目录中删除了没有扩展名的扩展名,它可以正常工作.我用DEBUG输出重新启动命令以提供更多信息.

$ echo $CLASSPATH


$ java -version
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

$ liquibase --version
Liquibase Version: 3.3.2

$ liquibase diffChangeLog
//The below is the stuff liquibase is adding to my classpath
.:/c/repos/ServeDirtyLibsInJava/liquibaseLib/liquibase.jar:/c/repos/ServeDirtyLibsInJava/liquibaseLib/lib/liquibase-hibernate4-3.5.jar:/c/repos/ServeDirtyLibsInJava/liquibaseLib/lib/snakeyaml-1.13.jar
WARNING 1/19/15 12:42 AM: liquibase: Can not use class liquibase.ext.hibernate.database.HibernateEjb3Database as a Liquibase service because org.hibernate.dialect.Dialect is not in the classpath
WARNING 1/19/15 12:42 AM: …
Run Code Online (Sandbox Code Playgroud)

java hibernate liquibase liquibase-hibernate

6
推荐指数
2
解决办法
6201
查看次数

try/finally没有catch return语句?

为什么以下代码的结果是3,为什么最终得到终止并退出方法,即使编译器检查首先尝试以及为什么try中的返回不会终止方法?

public int returnVal(){ 
    try{
        return 2;
    }
    finally{
        return 3;
    }
}
Run Code Online (Sandbox Code Playgroud)

java return exception try-catch

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

Liquibase + Hibernate ORM 5.0

我即将迁移到 Hibernate ORM 5.0,我也想在我的项目中使用 Liquibase。

Liquibase Hibernate的扩展提到liquibase-hibernate4对Hibernate 4.3+支持。

有没有人使用 Liquibase 和 Hibernate ORM 5.0?

我想确保新的 Hibernate 版本在 Liquibase 中没有问题。

hibernate liquibase hibernate-5.x liquibase-hibernate

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

身份验证提供程序:WL 12.1.3.0.0中未指定XXXX的SecurityProvider服务类名称

我刚刚为WebLogic Server版本12.1.3.0.0创建了一个身份验证提供程序,(身份验证提供程序通过在许多可配置的JAAS LoginModule之上构建身份验证序列来遵守标准JAAS框架.)但是当我启动Wl I时有这个错误:

这里的步骤:

1)设置ENV

%WL_HOME%/server/bin/setWLSEnv.cmd
Run Code Online (Sandbox Code Playgroud)

2)生成MBean和stubs:

java -cp %WL_HOME%/server/lib/* -verbose -DcreateStubs="true" \
weblogic.management.commo.WebLogicMBeanMaker -MDF WSAuthentication.xml \
-files C:\Development\Workspaces\Eclipse\WLAuthenticationProvider\src
Run Code Online (Sandbox Code Playgroud)

3)使用生成的存根和MBI文件打包认证提供程序和登录模块.

java -DMJF=C:\Development\Workspaces\Eclipse\WLAuthenticationProvider\jar\WSAuthentication.jar \
-Dfiles=C:\Development\Workspaces\Eclipse\WLAuthenticationProvider\src weblogic.management.commo.WebLogicMBeanMaker
Run Code Online (Sandbox Code Playgroud)

4)在startWebLogic.cmd中添加-DUseSunHttpHandler = true

weblogic.security.service.SecurityServiceRuntimeException: [Security:090877]Service Common JAASAuthenticationService unavailable, see exception text: com.bea.common.engine.ServiceInitializationException: com.bea.common.engine.SecurityServiceRuntimeException: [Security:097533]SecurityProvider service class name for MyAuthentication is not specified.
        at weblogic.security.service.PrincipalAuthenticator.initialize(PrincipalAuthenticator.java:155)
        at weblogic.security.service.PrincipalAuthenticator.<init>(PrincipalAuthenticator.java:315)
        at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.doATN(CommonSecurityServiceManagerDelegateImpl.java:731)
        at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.postInitializeRealm(CommonSecurityServiceManagerDelegateImpl.java:515)
        at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.postLoadRealm(CommonSecurityServiceManagerDelegateImpl.java:861)
        at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.postInitializeRealms(CommonSecurityServiceManagerDelegateImpl.java:927)
        at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.postInitialize(CommonSecurityServiceManagerDelegateImpl.java:1109)
        at weblogic.security.service.SecurityServiceManager.postInitialize(SecurityServiceManager.java:943)
        at weblogic.security.SecurityService.start(SecurityService.java:159)
        at weblogic.server.AbstractServerService.postConstruct(AbstractServerService.java:78)
        at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.glassfish.hk2.utilities.reflection.ReflectionHelper.invoke(ReflectionHelper.java:1017)
        at org.jvnet.hk2.internal.ClazzCreator.postConstructMe(ClazzCreator.java:388)
        at …
Run Code Online (Sandbox Code Playgroud)

java security authentication weblogic12c

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

如何在使用Robolectric时加载.so?

W/Environment:EXTERNAL_STORAGE undefined; 回到默认状态

java.lang.UnsatisfiedLinkError: com.autonavi.amap.mapcore.MapCore.nativeNewInstance(Ljava/lang/String;)J
    at com.autonavi.amap.mapcore.MapCore.nativeNewInstance(Native Method)
    at com.autonavi.amap.mapcore.MapCore.<init>(MapCore.java:62)
    at com.amap.api.mapcore.AMapDelegateImpGLSurfaceView.<init>(AMapDelegateImpGLSurfaceView.java:356)
    at com.amap.api.mapcore.AMapDelegateImpGLSurfaceView.<init>(AMapDelegateImpGLSurfaceView.java:318)
    at com.amap.api.mapcore.ak.a(MapFragmentDelegateImp.java:123)
    at com.amap.api.maps.MapView.onCreate(MapView.java:131)
    at com.e.activity.DriverReleaseActivity.initData(DriverReleaseActivity.java:179)
    at com.e.base.BaseActivity.onCreate(BaseActivity.java:29)
    at android.app.Activity.performCreate(Activity.java:5933)
    at org.robolectric.util.ReflectionHelpers.callInstanceMethod(ReflectionHelpers.java:195)
    at org.robolectric.util.ActivityController$1.run(ActivityController.java:122)
    at org.robolectric.shadows.ShadowLooper.runPaused(ShadowLooper.java:304)
    at org.robolectric.shadows.CoreShadowsAdapter$2.runPaused(CoreShadowsAdapter.java:45)
    at org.robolectric.util.ActivityController.create(ActivityController.java:118)
    at org.robolectric.util.ActivityController.create(ActivityController.java:129)
    at com.enjoytech.ecar.carpooling.activity.DriverReleaseAcitivityTest.init(DriverReleaseAcitivityTest.java:87)
    at com.enjoytech.ecar.carpooling.activity.DriverReleaseAcitivityTest.test(DriverReleaseAcitivityTest.java:79)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
    at org.robolectric.RobolectricTestRunner$2.evaluate(RobolectricTestRunner.java:251)
    at org.robolectric.RobolectricTestRunner.runChild(RobolectricTestRunner.java:188)
    at org.robolectric.RobolectricTestRunner.runChild(RobolectricTestRunner.java:54)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.robolectric.RobolectricTestRunner$1.evaluate(RobolectricTestRunner.java:152)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
Run Code Online (Sandbox Code Playgroud)

进程以退出代码-1结束

它无法加载.so文件.

我用的时候

try {      
    System.loadLibrary("libamapv304"); …
Run Code Online (Sandbox Code Playgroud)

junit android robolectric

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

如何在Java中读取DICOM文件的内容?

DICOM文件包含一系列CAT扫描图像.Java中是否有DICOM库的实现可以读取文件并提取存储在其中的图像?我想将这些图像存储到BufferedImage数据类型中.

java dicom dcm4che

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

无法通过 Spring Hibernate 获得 Liquibase 工作

到目前为止,我已经将 liquibase 与 spring 和标准变更日志文件一起使用。现在我想将其集成到休眠中,因此当我对实体进行任何更改时,它应该更改表并更新更改日志表。

我读了很多例子和教程,但无法让它发挥作用。

我使用数据源,entityManagerFactory(denepds-on="liquibase") 都工作正常。但是当我添加 liquibase bean 时,它不会从实体更改数据库。并且抛出“没有名称的表”异常。

如何使用 liquibase-hibernate4 和 spring 配置 Liquibase?

我的液体基豆:

<bean id="liquibase" class="liquibase.integration.spring.SpringLiquibase">
      <property name="dataSource" ref="myJdbcDataSource" />
      <property name="beanName" value="entityManagerFactory" />
      <property name="changeLog" value="classpath:databaseChangeLog.sql" />
</bean>
Run Code Online (Sandbox Code Playgroud)

我刚刚从https://github.com/liquibase/liquibase-hibernate/wikihttp://www.liquibase.org/documentation/spring.html添加了 beanName prop 作为entityManagerFactory 。并做了我从这篇文章中可以理解的事情。

在这篇文章中,它提到我们应该使用三种变体之一

hibernate:spring:com/example/spring.xml?bean=sessionFactory
hibernate:spring:com.example?dialect=org.hibernate.dialect.MySQL5Dialect
hibernate:spring:com.example.employee,com.example.auction?dialect=org.hibernate.dialect.MySQL5Dialect
Run Code Online (Sandbox Code Playgroud)

但我不知道当我们使用 spring 时如何将它与 liquibase bean 一起使用

java spring hibernate liquibase liquibase-hibernate

2
推荐指数
1
解决办法
2986
查看次数