emacarron / old-google-code-issues

Automatically exported from code.google.com/p/mybatis
0 stars 0 forks source link

MyBatisModule uses internal guice dependencies #574

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What version of the MyBatis are you using?
3.3-SNAPSHOT

Please describe the problem.  Unit tests are best!
The MyBatisModule uses static imports against internal guice dependencies.

e.g.
import static com.google.inject.internal.util.$Preconditions.checkArgument;
import static com.google.inject.internal.util.$Preconditions.checkState;

What is the expected output? What do you see instead?
It is expected that the guice team will use public guice apis so other versions 
of guice can be used with MyBatis-Guice.

Can you provide stack trace, logs, error messages that are displayed?
java.lang.NoClassDefFoundError: com/google/inject/internal/util/$Preconditions
       at org.mybatis.guice.MyBatisModule.internalConfigure(MyBatisModule.java:84)
       at org.mybatis.guice.AbstractMyBatisModule.configure(AbstractMyBatisModule.java:59)
       at com.google.inject.AbstractModule.configure(AbstractModule.java:62)
       at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:230)
       at com.google.inject.PrivateModule.install(PrivateModule.java:183)

Please provide any additional information below.

Original issue reported on code.google.com by garyash...@gmail.com on 2 Apr 2012 at 10:05

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
This functionality does not work in OSGi. Private guice package is not 
available in the component mybats-guice.
I propose a solution of the functional transfer of the private class in the 
current project mybatis-guice. Changes can be found in a file diff 
mybatis-guice-osgi.diff

I also had to be temporarily removed from project class
src/main/java/org/mybatis/guice/datasource/bonecp/BoneCPProvider.java
I have not been able to establish osgi component bonecp. Apache Karaf write 
error installing this component.

The components have been deployed with file features.xml

<?xml version="1.0" encoding="UTF-8"?>
<features name="myproject">
  <repository>mvn:org.apache.karaf.assemblies.features/enterprise/2.2.7/xml/features</repository>
  <repository>mvn:org.apache.karaf.assemblies.features/standard/2.2.7/xml/features</repository>
  <repository>mvn:org.jclouds.karaf/jclouds-karaf/1.3.1/xml/features</repository>

  <feature name="comita-mybatis" version="1.1.0-SNAPSHOT" resolver="(obr)">
    <feature version="3.0">guice</feature>
    <bundle>mvn:com.google.inject.extensions/guice-multibindings/3.0</bundle>
    <bundle>mvn:org.mybatis/mybatis/3.1.0</bundle>
    <bundle>mvn:org.mybatis/mybatis-guice/3.3.1-SNAPSHOT</bundle>
    <!-- <bundle>wrap:mvn:com.jolbox:bonecp/0.7.1.RELEASE</bundle> -->
  </feature>
...
</features>

Original comment by alexey.l...@gmail.com on 3 Jul 2012 at 7:22

Attachments: