Repository navigation
Test native-sql-resultset-mapping fail in Weblogic 12.1.3 #342
Description
Hi, I am trying it first test with web logic 12.1.3.
Step 1: My profile was updated like this:
weblogic-remote-arquillian <properties>
<!-- Default username/password that instructions in README.md ask to use
when starting up WebLogic for the first time. Note that WebLogic does not
have any default username/password of its own. -->
<weblogicRemoteArquillian_adminUserName>weblogic</weblogicRemoteArquillian_adminUserName>
<weblogicRemoteArquillian_adminPassword>welcome1</weblogicRemoteArquillian_adminPassword>
<!-- Default host and port when running WLS locally -->
<weblogicRemoteArquillian_adminUrl>t3://localhost:7001</weblogicRemoteArquillian_adminUrl>
<!-- Default target after having installed developer zip distribution for
WebLogic -->
<weblogicRemoteArquillian_target>myserver</weblogicRemoteArquillian_target>
</properties>
<dependencies>
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-wls-remote-12.1.2</artifactId>
<version>1.0.0.Alpha3</version>
<scope>test</scope>
</dependency>
</dependencies>
Step 2: Start Weblogic
Step 3: mvn test -Pweblogic-remote-arquillian -DweblogicRemoteArquillian_wlHome=/Users/josediaz/Tools/wl12210
Error Test:
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 4.295 sec <<< FAILURE!
testJpaNativeSqlResultSetMapping(org.javaee7.jpa.nativesql.resultset.mapping.JpaNativeSqlResultSetMappingTest) Time elapsed: 0.329 sec <<< ERROR!
java.lang.NullPointerException
at org.javaee7.jpa.nativesql.resultset.mapping.JpaNativeSqlResultSetMappingTest.testJpaNativeSqlResultSetMapping(JpaNativeSqlResultSetMappingTest.java:67)
Error Weblogic:
INFO: BeanManager not found.
<Feb 26, 2016 2:21:26 PM PET> <2016-02-26 14:21:26.705--ServerSession(664831661)--Failed to find MBean Server: javax.naming.NameNotFoundException: remaining name: comp/env/jmx/runtime>
<Feb 26, 2016 2:21:26 PM PET> <2016-02-26 14:21:26.705--ServerSession(664831661)--Unable to unregister MBean [null] because the MBeanServer is null. Verify that your ServerPlatform is JMX enabled.>
<Feb 26, 2016 2:21:26 PM PET> <2016-02-26 14:21:26.706--ServerSession(664831661)--909fa198-0844-4514-b4f9-3df023d60c83file:/Users/josediaz/Tools/wls12130/user_projects/domains/mydomain/servers/myserver/tmp/_WL_user/909fa198-0844-4514-b4f9-3df023d60c83/mh2r7b/war/WEB-INF/lib/_wl_cls_gen.jar_MyPU logout successful>
Jose
Activity
arjantijms commentedon Feb 26, 2016
Not every sample runs on every server.
In general if a sample doesn't run on one server but does run on other ones, it's likely a bug in that server. This is actually the intend of these samples, to point out bugs in servers.
If you think there's something specifically faulty in the test it can be looked at of course.
joedayz commentedon Feb 26, 2016
Yes. The problem was solved adding a META-INF/beans.xml and a DefaultDataSource (I had to create one datasource with similar JNDI name) in persistence.xml.
I will continue testing in weblogic.
Jose
arjantijms commentedon Feb 26, 2016
Oh, of course. I forgot to mention that WebLogic 12.1.3 is a Java EE 6 server. The samples require Java EE 7 (WebLogic 12.2.1+). Sorry for that.
The default data source is a new feature in Java EE 7, so that's indeed not available in Java EE 6. The idea there is that there's already a basic/simple data source available without you having to configure anything.
joedayz commentedon Feb 26, 2016
In theory, weblogic 12.2.1 has a datasource by default. I downloaded the weblogic 12.2.1 yesterday , I created a new domain with basic wls template and my surprise was that it does not have datasources.
This was my first error and when added , the next error was BeanManager null. For this reason, I added beans.xml
Maybe exists some domain template that should install for have a default datasource.
radcortez commentedon Feb 27, 2016
By the spec, a Java EE 7 should provide you with a default datasource. That's why the samples don't create one and just expect it to be there.
arjantijms commentedon Feb 27, 2016
@radcortez
Indeed, there are unfortunately a few caveats along the lines of that the datasource itself has to be there (in the correct JNDI namespace or, in case of e.g. JPA, by not specifying any namespace), but the database to which that datasource is connected doesn't necessarily have to be there by default.
This is a really odd omission in the spec. I tried to address it a couple of times but no success yet.
That said, the release notes of WebLogic explicitly state support for the default datasource. See
radcortez commentedon Feb 29, 2016
@arjantijms
I was looking for the spec section about Default Datasources and found this:
My understanding of the spec is that both ways should work, by stating explicitly the JNDI name or by omitting it. This works fine with other servers.
Apparently by reading https://docs.oracle.com/middleware/1221/wls/JDBCA/default_datasource.htm#JDBCA729, seems that WebLogic only supports the Default Datasource by stating explicitly the JNDI name. I'm inclined to say that it's a bug on the WebLogic side and they should also support injection without the JNDI name.