We have application running on weblogic 11g using java 6. Now we want to use use weblogic 12c with java 7 but we have some problem. We are using JAXB to un/marshal soap request. Now when we deploy our application to wls12 we have problem with nillable atribut in element. When I send xml with:
<data:MyElement state="ok" xsi:nil="true"/>
element in my app isnt nill:
element.isNil() return false
JUnit with this test still works so I supposed that there is no problem with java7. This problem occurs just on wls12. How should I fix this problem or at least how should I debug it
thx for help
Difference Between WebLogic 11 & 12
Starting in WebLogic 12.1.1 EclipseLink MOXy is the default JAXB (JSR-222) provider.
http://blog.bdoughan.com/2011/12/eclipselink-moxy-is-jaxb-provider-in.html
What is Causing the Failure
You are hitting the following MOXy bug.
http://bugs.eclipse.org/404926
What You Can Do:
If you are an Oracle Support customer then you can contact them to get an official fix.
You can revert to using the JAXB RI at the server or application level using the offical instructions that can be found here: http://docs.oracle.com/cd/E24329_01/web.1211/e24964/data_types.htm#CIHBHDGI
To future generation which will have this problem too:
When I turn on tracing messages, this problem occurs again.
org.springframework.ws.server.MessageTracing=TRACE
By debugging I saw that wls 12 use oracle.j2ee.ws.saaj.soap.soap11.Message11and wls 10 use weblogic.xml.saaj.SOAPMessageImpl
All I need to do is to add this class to messageFactory:
<bean id="messageFactory" class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory">
<property name="messageFactory">
<bean class="weblogic.xml.saaj.MessageFactoryImpl" />
</property>
</bean>
Related
Environment
Websphere 8.5.5.11
JDK 1.8
DWR
SpringMVC
Oracle DBMS
We recently upgraded our project, and make updates from
spring.jar,
spring-web.jar,
spring-webmvc.jar
dwr.jar
upgraded to
spring version 5.1.7
dwr version 3.0.2
We started facing multiple issues
1. DWR servlet didn't get initialized properly; and complains about Duplicate name found while loading the context, and another problem
our web.xml trying to inialize both servlets i.e. DispacterServlet and DwrSpringServlet
2. After removing spring, spring-web and spring-webmvc and upgrading to latest versions;
web project during compilation and loading complains about missing classes;
spcially one of the .forName methods called during DWR inialization i.e.
java.lang.NoSuchMethodError: org.springframework.util.ClassUtils.forName(Ljava.......
3. engine.js not found where it supposed to be i.e. this error being thrown
'You must include DWR engine before including this file'.
You can find the answers to above in answers section.
Environment
Websphere 8.5.5.11
JDK 1.8
DWR
SpringMVC
Oracle DBMS
You need to strictly follow these http://www.butterdev.com/category/dwr/ examples to configure DWR and Spring (either MVC or non MVC) in web.xml and spring-servlet.xml
and you must load/configure one servlet only.
Duplicate name not found problem was happening due to spring-servlet.xml getting loaded twice;
this post https://www.conqtech.com/blog/?p=85 help to resolve the problem.
You have to include all the jars below.
spring-beans-5.1.7.RELEASE.jar
spring-context-5.1.7.RELEASE.jar
spring-context-support-5.1.7.RELEASE.jar
spring-core-5.1.7.RELEASE.jar
spring-dao-2.0.8.jar
spring-expression-5.1.7.RELEASE.jar
spring-jdbc-5.1.7.RELEASE.jar
spring-tx-5.1.7.RELEASE.jar
spring-web-5.1.7.RELEASE.jar
spring-webmvc-5.1.7.RELEASE.jar
dwr-3.0.2.jar
spring-aop-5.1.7.RELEASE.jar
They (DWR) team; made a change so that engine.js file should be declared/imported before your remoting referenced .js files in your jsp/html pages.
This post help to resolve the problem;
https://readthefuckingmanual.net/error/4678/Error-You-must-include-DWR-engine-before-including-this-file.
In addition to all the coding tips above; you must have to define SimpleUrlHandlerMapping as below even you have one already defined.
<bean
class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property value="true" name="alwaysUseFullPath"></property>
<property name="mappings">
<props>
<prop key="/dwr/**/*">dwrController</prop>
<prop key="/interface/**">dwrController</prop>
</props>
</property>
</bean>
And we followed below examples to fix the above problems;
http://www.butterdev.com/category/dwr/
We did faced some other compilation issues; but they are common to understand and resolve.
Happy coding!
late response but resolved similar problem, may help others. The short answer is that Spring 5 and DWR 3.0.1 are not compatible. DWR 3.0.1 is using old class from Sprig 3 which is causing problem, you can switch to DWR 3.0.2 and try with it.
Using Spring within Websphere, when using the javax.transaction.Transactional. Running the code locally or within Tomcat works as intended but while running within Websphere, it appears that the javax.transaction.Transactional annotation is not resulting in a Transaction that includes the JPA-EntityManager. Replacing the javax.transaction.Transactional annotation with the Spring version of Transactional solves this issue.
We would like to know what is required to fix this issue. I found this Stackoverflow-issue: spring-jta-transaction-with-jpa-and-jndi-datasource-for-websphere which links to the Article: 0609_alcott-pdf.pdf
The advise given is to configure Spring to use the WebSphereUowTransactionManager as transaction manager.
The stackoverflow answer is from 2012. But since we are running a farely old WebSphere 7 version, it might sill be relevant to us.
Does anyone experienced the similar or a related problem?
Update
The following dependencies are used:
spring-core: 4.3.9
hibernate.core: 4.2.15.Final
spring-boot starter: 1.5.4.RELEASE
I keep getting
The server cannot create an EntityManagerFactory factory for the default persistent unit from the org.hibernate.ejb.HibernatePersistence provider
when I try to run the web application(.war) on the WebSphere 7 + Oracle .This worked well so far under the tomcat + MySql.
my persistance.xml's config
<persistence-unit name="default">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<non-jta-data-source>src/test</non-jta-data-source>
<properties>
<property name="hibernate.dialect" value="org.hibernate.Oracle10gDialect"/>
<property name="hibernate.hbm2ddl.auto" value="validate"/>
<property name="hibernate.connection.release_mode" value="after_transaction"/>
</persistence-unit>
There were several solutions for this, after googling. But there was no luck even after trying them for about 2 days.
To fix this issue do we need to install any fix-pack in WebSphere?
Please find the stack-trace files in below link.
https://www.ibm.com/developerworks/community/forums/html/topic?id=e54136aa-fbe0-4576-a41c-4b438475f0a5
In WebSphere v7 to use container managed JPA you need to install feature pack for JPA and it will only support JPA 2.0.
Based on your logs it looks like you are using Hibernate 4.3 which is JPA 2.1.
You cant use that with classic WebSphere Application Server, see Deploying application using Hibernate JPA 2.1 to IBM WebSphere for more details.
So you either would need to downgrade to Hibernate 4.2, use application managed Entity manager, or migrate to WebSphere Liberty Profile server 8.5.5.6 or later which fully supports JPA 2.1.
If your application works on Tomcat, I'd suggest trying WebSphere Liberty, which is also lightweight, developer friendly server, available to download for free - https://developer.ibm.com/wasdev/
Setting up an HTTP proxy for Java JVM 6.x isn't working for me; I'm hoping someone can spot what I'm missing.
I have a Java application deployed on JBOSS 5.1.2 that makes several calls to external web services. I'd like to be able to intercept these calls using a proxy: Fiddler version 4.4.8.0.
After doing an SO search I added the following flags to my JBOSS VM parameters at startup:
-DproxySet=true -Dhttp.proxyHost=localhost -Dhttp.proxyPort=8888 -Dhttps.proxyHost=localhost -Dhttps.proxyPort=8888
I'm running JBOSS in IntelliJ 14.
I can see traffic from the browser to the application if I start JBOSS, Fiddler, and open the UI in Chrome. I do not see any calls from JBOSS to external services being intercepted. I thought I would see all the calls from JBOSS to external services in addition to those from the browser to JBOSS.
Update:
I tried adding these to properties-service.xml per this SO answer - no joy.
I'm running Spring 3, using Apache HttpClient as my web service client. I'm going to look into configuring proxy just for it.
Thanks to bmargulies and anyone else who looked at this. I have a solution that I hope will help someone else.
Adding -Dhttp.proxyHost parameters to my JVM startup options did nothing.
Adding those same parameters to JBOSS 5.1.2 configuration in my deployment properties-services.xml did nothing.
I believe that using Spring 3.x is a factor in explaining this behavior. I had to tell the Spring web service clients to use a proxy.
I added some Spring beans to wire in a Fiddler proxy HttpClient and injected that into the web service client, replacing the non-proxied version.
It failed the first time I tried it. It took me a while to figure out that the Apache Commons HttpConfiguration class didn’t follow the Java bean standard, so Spring blew up when it tried to wire it. I had to use the Spring MethodInvokingFactoryBean to get around it.
Here's the pertinent Spring configuration XML:
<!-- New beans for Fiddler proxy -->
<bean id="fiddlerProxyHost" class="org.apache.commons.httpclient.ProxyHost">
<constructor-arg name="hostname" value="localhost"/>
<constructor-arg name="port" value="8888"/>
</bean>
<bean id="fiddlerProxyHostConfiguration" class="org.apache.commons.httpclient.HostConfiguration"/>
<bean id="fiddlerProxyHostSetter" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
<property name="targetObject" ref="fiddlerProxyHostConfiguration"/>
<property name="targetMethod" value="setProxyHost"/>
<property name="arguments" ref="fiddlerProxyHost"/>
</bean>
<bean id="fiddlerProxyClient" class="org.apache.commons.httpclient.HttpClient">
<property name="hostConfiguration" ref="fiddlerProxyHostConfiguration"/>
</bean>
Now I can see the calls from the application to the web service in Fiddler. Joy!
Those parameters, first and foremost, are read by HttpURLConnection. They are specific to HTTP, of course, and so any other means of connecting to the outside world will necessarily ignore them.
There are many good reasons for code to avoid HttpURLConnection and just open a TCP connection through a plain old socket, even if that code plans to talk HTTP. HttpURLConnection has several 'browser emulation features' that get in the way. For example, it's broken for CORS and rejects some legitimate HTTP verbs.
Code that does that and in turn happens to do HTTP might choose to respect those parameters, and it might not. For example, I'm reasonably sure that the Apache Commons HTTP library gives the caller a choice.
If you put JBoss in a debugger and break on the socket connection primitives, I think you'll find out what's happening to you pretty quick in this respect.
I have a java application that is using hibernate to do a JNDI lookup for the datasource in Websphere Application Server which then talks to a MSSQL database.
The security team has recently patched the Websphere server 8.5.5.4 to disable SSLv3.
As such I'm getting a com.ibm.websphere.ce.cm.StaleConnectionException: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encyption. Error: "SSLv3 SSLContext not available".
Before this, I could access the data without any issues.
What can I do to overcome this issue? Do I need to configure the application to use TLS?
I'm using Hibernate 4.3.7.
The hibernate config looks like this.
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">net.sourceforge.jtds.jdbc.Driver</property>
<property name="connection.datasource">jdbc/testing</property>
<property name="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</property>
<mapping resource="myApplication.hbm.xml" />
</session-factory>
</hibernate-configuration>
Any help would be greatly appreciated.
I have this issue yesterday.
I solved it by using sqljdbc4.jar instead of sqljdbc4.1 and it works fine.
Maybe you should look at the MSSQL side to check whether TLS (at least 1.0 version) is supported. If not try to enable it.
Otherwise a (not recommended from security view) fix is to enable SSLv3 temporarily by using the following JVM argument until you find a way to communicate through TLS:
-Dcom.ibm.jsse2.disableSSLv3=false
I found a solution. Try updating your sqljdbc4.jar file - it turns out mine was outdated. Alternatively, I also got it running with the solution by #trikelef that enables SSLv3 - but this opens security issues.