Simple Validation API Issue Java Swing - validation

I am using Netbeans 6.8 , JDK 1.6 and downloaded Simple Validation API. When I try the code, it gives me errors referencing "org/openide" classes.
Could this be a compatibility issue? How can I resolve this?
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/openide/util/Lookup
at org.netbeans.validation.api.ui.swing.SwingComponentDecorationFactory.getDefault(SwingComponentDecorationFactory.java:154)
at org.netbeans.validation.api.ui.swing.SwingValidationGroup.<init>(SwingValidationGroup.java:82)
at org.netbeans.validation.api.ui.swing.SwingValidationGroup.create(SwingValidationGroup.java:87)

Related

WebSphere Liberty and Eclipselink SDO

I am porting an old IBM Process Server application to IBM WebSphere Liberty. It contains a lot of code based on Service Data Objects (SDO). I have some good working code, running as standalone Java, using JDK8. I am using eclipselink 2.7.7, specifically 2 jar files;
eclipselink.jar
commonj.sdo_2.1.1v20111051852.jar
I have built this code into a Servlet to handle SOAP requests, and packaged it, along with other code, into an EAR file, which I deployed under IBM WebSphere Liberty 20. It doesn't work. There seems to be a clash with the Liberty version of EclipseLink.
If I deploy the code as a WAR file, and add a classloader of "PARENT_LAST", the code works fine.
However, if I try to deploy the code in an EAR file, and set a classloader of "PARENT_LAST" for the ear file, I get this error;
[ERROR ] CWWKZ0106E: Could not start web application S21.
[ERROR ] CWWKZ0002E: An exception occurred while starting the application S21. The exception message was: com.ibm.ws.container.service.state.StateChangeException: java.lang.LinkageError: loader constraint violation in interface itable initialization: when resolving method "org.eclipse.persistence.jpa.PersistenceProvider.getProviderUtil()Ljavax/persistence/spi/ProviderUtil;" the class loader (instance of com/ibm/ws/classloading/internal/ParentLastClassLoader) of the current class, org/eclipse/persistence/jpa/PersistenceProvider, and the class loader (instance of org/eclipse/osgi/internal/loader/EquinoxClassLoader) for interface javax/persistence/spi/PersistenceProvider have different Class objects for the type javax/persistence/spi/ProviderUtil used in the signature
Does anyone know whether I can replace the IBM Liberty implementation of EclipseLink with my version 2.7.7 version?
My application also uses JPA, which is working fine under Liberty, so I don't want to break that.
Any help / guidance appreciated... it's been a very long saturday.
PS:
I tried running the java code using only the SDO library (commonj.sdo_2.1.1v20111051852.jar), and relying on the WebSphere Liberty runtime jars to provide Eclipselink functionality, and I got the following errors, which is why I then moved to adding the "matching pair" of Eclipselink / SDO jars mentioned above;
Caught Exception : org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getSystemPropertyBoolean(Ljava/lang/String;Z)Z
java.lang.NoSuchMethodError: org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getSystemPropertyBoolean(Ljava/lang/String;Z)Z
at org.eclipse.persistence.sdo.helper.SDOHelperContext.<init>(SDOHelperContext.java:93)
at org.eclipse.persistence.sdo.helper.SDOHelperContext$DefaultHelperContextResolver.getHelperContext(SDOHelperContext.java:1432)
at org.eclipse.persistence.sdo.helper.SDOHelperContext.getHelperContext(SDOHelperContext.java:492)
at org.eclipse.persistence.sdo.helper.SDOHelperContext.getHelperContext(SDOHelperContext.java:471)
at org.eclipse.persistence.sdo.helper.SDOHelperContext.getHelperContext(SDOHelperContext.java:456)
at org.eclipse.persistence.sdo.helper.delegates.SDOXMLHelperDelegator.getXMLHelperDelegate(SDOXMLHelperDelegator.java:178)
at org.eclipse.persistence.sdo.helper.delegates.SDOXMLHelperDelegator.load(SDOXMLHelperDelegator.java:78)
at com.ebs.solas2021.port.adapter.ui.SOAPRequestHandler.main(SOAPRequestHandler.java:237)
It's amazing what you find whgen you re-read the documentation in the cold light of a new day. It turns out that it's possible to install a JPA 2.2 Container on Liberty, while supplying one's own implementation of EclipseLink. Works like a charm.
Documented here: https://openliberty.io/blog/2018/06/29/full_java_ee_8_liberty_18002.html

"JTS/JTA transaction has been aborted" in websphere 7 after jdk upgrade

I just had to upgrade my IBM JDK version from the one that came with the WebSphere 7 to fix an issue with Groovy. Now however when my app starts up I get the following stack trace and the error kills my apps initialization good and proper.
2013-06-08 17:59:06,574~WebContainer : 10~ERROR~com.myapp.application.webui.spring.XmlWebApplicationContext~Failed to load context
org.springframework.beans.FatalBeanException: Failed to load context; nested exception is org.springframework.transaction.TransactionSystemException: Could not commit JDBC transaction; nested exception is com.ibm.ejs.cm.exception.TransactionAbortedException: JTS/JTA transaction has been aborted
at com.myapp.application.webui.spring.XmlWebApplicationContext.refresh(XmlWebApplicationContext.java:162)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294)
at com.myapp.application.webui.spring.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:24)
at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:1718)
at com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinish(WebApp.java:385)
at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:299)
at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:100)
at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:166)
at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:732)
at com.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:617)
at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:376)
If I switch back to old JDK I don't get this but I'm stuck with a known issue with Groovy. Also there are currently a number of other websphere environments running the same war file without issue.
The version I upgraded to is 6.0.13.2 of the IBM JDK. Running on Centos 6.4. I also tried 6.0.10.
Googling the issue just shows other people with similar problems.
Turned out the IBM WebSphere JDK installs are not compatible with Websphere(???). I found a fix in the websphere section that was a package (.pak file) of the JDK and installed that via the updater and now everything is working correctly.

java.lang.NoSuchMethodError: org/apache/http/conn/ssl/SSLSocketFactory

I have installed my application and restarted in WAS 8.5, I see below exception in SystemOut.log,where as it works fine in WAS 7.
java.lang.NoSuchMethodError: org/apache/http/conn/ssl/SSLSocketFactory.<init>(Ljava/lang/String;Ljava/security/KeyStore;Ljava/lang/String;Ljava/security/KeyStore;Ljava/security/SecureRandom;Lorg/apache/http/conn/ssl/X509HostnameVerifier;)V
Can any one help me how to resolve this issue?
I'd guess you're deploying and trying to use one version of Apache HttpClient, but that WebSphere has a different version included in its libraries. If you could use the WebSphere-included version, that would be simplest, but if you need to use the specific version, you could change the WebSphere classloader policy to PARENT_LAST.
websphere8 /WebSphere/AppServer/plugins/com.ibm.ws.prereq.jaxrs.jar has packages org.http.*
com.ibm.ws.prereq.jaxrs.jar and HttpClient.jar conflict!
Change classloaders order invalid because com.ibm.ws.prereq.jaxrs.jar has been loaded when websphere start!
you can change HttpClient packages from org.http.* to net.test.* to avoid conflict
ps:
http://www.ibm.com/developerworks/cn/websphere/library/techarticles/1108_jiangwk_classloader/1108_jiangwk_classloader.html

Build errors in JDK 1.5 but not in 1.6 for Connection interface

I have my class implementing the Connection interface, http://docs.oracle.com/javase/6/docs/api/java/sql/Connection.html
I was not getting any build errors when I was testing it in one of my local machine, which is having JDK 1.6 version. But on deploying the same to another remote machine which is having JDK 1.5 version, its throwing 16 build errors saying "Cannot find symbol..."
The errors are throwing for the methods starting from createClob as displayed in the documentation page. Actually, in 1.6 version, I didn't implement those methods and so it threw the error saying, "The methods must be implemented". And So I implemented it as follows,
public Clob createClob() {
return conn.createClob();
}
But after building the same code in 1.5, its throwing, "Cannot find symbol..." build errors.
Is it because of version problem? Is there a way to correct the errors in 1.5 version?
The createClob() method was added in Java 1.6 / JDBC 4.0. It is not available on the Connection interface in earlier versions of Java.
So you will either need to use a different class / implementation per Java version, or use a Proxy implementation instead of manually implementing each and every method.
BTW: What is it you are trying to achieve here? Unless you are implementing a JDBC driver, you usually would not need to implement Connection yourself.

SpringIDE 2.6.0 failing to initialize with error under Helios

I'm running into an issue with the Spring IDE release 2.6.0 under Eclipse 3.6 SR 1
Error occured processing XML 'Could not instantiate bean class
[org.springframework.ide.eclipse.beans.core.internal.model.BeansConfig$ToolingFriendlyBeanDefinitionDocumentReader]:
Constructor threw exception; nested exception is
org.apache.commons.logging.LogConfigurationException: User-specified log class
'org.apache.commons.logging.impl.Log4JLogger' cannot be found or is not useable.'.
See Error Log for more details
I dumped my entire eclipse environment and re-installed to see if it would fix it and it didn't. Not sure if this is a classpath problem or something specifically related to the SpringIDE configuration.
Any help would be appreciated.
you're hitting a bug in Spring IDE. See the following JIRA for more details:
https://issuetracker.springsource.com/browse/STS-1691
We are going to publish a patch for this issue soon. Check the JIRA for when it is available. Alternatively install an upcoming nightly build.
Regards, Christian

Resources