Configuring Oracle Express 11g on a development machine

If you install Oracle Express 11g on laptop running Windows that is normally part of a domain and then try and run that machine elsewhere connected to a different network than normal, you may need to tweak the hostname value in your tns confiig files.

For example, my work laptop has a domain name set which is specific to my work network. When running from home and connected to the internet I’m not part of this domain, and this seems to mess with your tns config.

Browse to this location (or similar):

C:oraclexeapporacleproduct11.2.0servernetworkADMIN

Edit each of the .ora files in this location and replace your fully qualified hostname  and domain name for the HOST property to be just 127.0.0.1. I’m not sure if this means your listener is no longer listening for connections outside of your machine, but if this is a development machine this doesn’t matter.

Stop and restart your database (XE is the default for Oracle Express), and you should be good to go.

tnsping XE should now respond with OK.

 

Configuring mysqld to listen for remote connections

I’m not sure if I originally configured this or if this is the default. My my.cnf file had this line in it which configures mysql to only listening for incoming connections from localhost and ignores all remote connections:

bind-address            = 127.0.0.1

Changing this to be the real ip of the server will allow it to listen for remote connections.

Maven and JAXB

Add this dependency to your pom.xml:

<dependency>
    <groupId>com.sun.xml.bind</groupId>
    <artifactId>jaxb-impl</artifactId>
    <version>2.2.5-b10</version>
</dependency>

If you have your jaxb.index file in your src/main/java source tree (probably should be in src/main/resources instead, unless you’d rather see it alongside your source), then you’ll also need a file pattern include in your build section:

<resources>
<!-- include jaxb index files -->
    <resource>
        <directory>src/main/java</directory>
        <includes>
            <include>**/*.index</include>
        </includes>
    </resource>
</resources>

Maven: Changing the Java target version

Maven defaults to Java 1.5 by default. You can change this via settings on the maven compiler plugin:

<build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.3.2</version>
        <configuration>
          <source>1.6</source>
          <target>1.6</target>
        </configuration>
      </plugin>
    </plugins>
  </build>

Alternatively, you can specify the source and target Java verison using these properties:

    <properties>
        <maven.compiler.source>1.7</maven.compiler.source>
        <maven.compiler.target>1.7</maven.compiler.target>
    </properties>