Weblogic 10.3 with axis - weblogic-10.x

I am migrating from weblogic 8.1 to 10.3 with JRockit1.6. When accesing the webservice using jaxrpc.Call.Invoke() method, it throws NullPointerException.
I had a workaround fix of using the Xerces.jar to be preloaded in the weblogic prior weblogic.jar.
But i dont want to use the xerces.jar as this is going to be a additional jar. Please let me know if you guys had come across these kind of situations to overcome this.
Caused by: java.lang.NullPointerException
at java.io.FilterInputStream.available(FilterInputStream.java:142)
at java.io.BufferedInputStream.read(BufferedInputStream.java:325)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager$RewindableInputStream.read(XMLEntityManager.java:2939)
at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(UTF8Reader.java:292)
at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(XMLEntityScanner.java:1742)
at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.skipSpaces(XMLEntityScanner.java:1492)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:872)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:647)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:508)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:109)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:523)
at weblogic.xml.jaxp.WebLogicXMLReader.parse(WebLogicXMLReader.java:134)
at weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:172)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:396)
at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:796)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:33)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:85)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
Thanks,
Steve

Why don't you want to use the xerces.jar? Axis requires it.
Weblogic 8 had different sets of jars included (that caused conflict) but obviously allowed your app to work.

Related

Azure web app (Linux) started throwing font error for apache poi xlsx export

I have Java application which uses apache poi to generate xlsx export.
The app is deployed on Azure app service as web app on Linux setup and it was working fine since many months (No Font config was ever installed on Azure web service). but suddenly it started throwing error on worksheet creation method saying Font not found.
below is the stack trace
Caused by: java.lang.InternalError: java.lang.reflect.InvocationTargetException
2022-03-04T11:49:12.048900166Z at java.desktop/sun.font.FontManagerFactory$1.run(FontManagerFactory.java:86)
2022-03-04T11:49:12.048903666Z at java.base/java.security.AccessController.doPrivileged(Native Method)
2022-03-04T11:49:12.048907266Z at java.desktop/sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74)
2022-03-04T11:49:12.048910866Z at java.desktop/java.awt.Font.getFont2D(Font.java:497)
2022-03-04T11:49:12.048914366Z at java.desktop/java.awt.Font.canDisplayUpTo(Font.java:2250)
2022-03-04T11:49:12.048917866Z at java.desktop/java.awt.font.TextLayout.singleFont(TextLayout.java:469)
2022-03-04T11:49:12.048924066Z at java.desktop/java.awt.font.TextLayout.<init>(TextLayout.java:530)
2022-03-04T11:49:12.048927967Z at org.apache.poi.ss.util.SheetUtil.getDefaultCharWidth(SheetUtil.java:273)
2022-03-04T11:49:12.048931467Z at org.apache.poi.xssf.streaming.AutoSizeColumnTracker.<init>(AutoSizeColumnTracker.java:117)
2022-03-04T11:49:12.048935167Z at org.apache.poi.xssf.streaming.SXSSFSheet.<init>(SXSSFSheet.java:82)
2022-03-04T11:49:12.048938867Z at org.apache.poi.xssf.streaming.SXSSFWorkbook.createAndRegisterSXSSFSheet(SXSSFWorkbook.java:674)
2022-03-04T11:49:12.048942367Z at org.apache.poi.xssf.streaming.SXSSFWorkbook.createSheet(SXSSFWorkbook.java:695)
2022-03-04T11:49:12.048946167Z at org.xxx.xxx.utils.EXCELReportExporter.writeHeaderLine(EXCELBenchReportExporter.java:28)
and deep down in stacktrace
2022-03-04T11:49:12.049101970Z Caused by: java.lang.reflect.InvocationTargetException: null
2022-03-04T11:49:12.049105470Z at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
2022-03-04T11:49:12.049109070Z at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
2022-03-04T11:49:12.049112670Z at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
2022-03-04T11:49:12.049116270Z at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
2022-03-04T11:49:12.049119870Z at java.desktop/sun.font.FontManagerFactory$1.run(FontManagerFactory.java:84)
2022-03-04T11:49:12.049123370Z ... 156 common frames omitted
2022-03-04T11:49:12.049126870Z Caused by: java.lang.NullPointerException: null
2022-03-04T11:49:12.049130370Z at java.desktop/sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1262)
2022-03-04T11:49:12.049133970Z at java.desktop/sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:225)
2022-03-04T11:49:12.049137571Z at java.desktop/sun.awt.FontConfiguration.init(FontConfiguration.java:107)
2022-03-04T11:49:12.049141071Z at java.desktop/sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:719)
2022-03-04T11:49:12.049144671Z at java.desktop/sun.font.SunFontManager$2.run(SunFontManager.java:379)
2022-03-04T11:49:12.049148171Z at java.base/java.security.AccessController.doPrivileged(Native Method)
2022-03-04T11:49:12.049151671Z at java.desktop/sun.font.SunFontManager.<init>(SunFontManager.java:324)
2022-03-04T11:49:12.049155371Z at java.desktop/sun.awt.FcFontManager.<init>(FcFontManager.java:35)
2022-03-04T11:49:12.049158971Z at java.desktop/sun.awt.X11FontManager.<init>(X11FontManager.java:56)
2022-03-04T11:49:12.049162671Z ... 161 common frames omitted
Apparently there is no change in the application and environment is made.
Same app is tested on Windows & Linux with JDK 8 and 11 and it is still working fine locally.
Any help is much appreciated.
Apologies you're experiencing this issue.
Kindly check if Java version on Web App is set to auto-update.
This may cause the Java minor version to change to the most recent one and may throw exceptions on some API calls.
As outlined in this doc- It is recommend to use a fixed version for production environments and not auto-update.
To update the Java version, please try these steps:
1.Navigate to your WebApp on Azure Portal
2.Select the Configuration tab under Settings blade, and then General Settings.
3.If you have "Java SE (Embedded Web Server) (auto-update)” selected under “Java web server” option, then change the Java minor version to 11.0.11. Now, check to see if it helps.
I am having the same issue: Apache POI FontConfiguration NPE on Azure. The only workaround I found for the moment, is to set the minor java version to "11.0.11". I created a GitHub ticket also: https://github.com/Azure/azure-cli/issues/21540. The problem I have is that I didn't find a solution to force the minor version using an "az webapp create" command.
If you are using Apache Tomcat 8.5 have a look to the automatic update in the configuration tab on Azure Portal.
In the newest version (> 8.5.66) the Docker image of the service contains also an update of Java (not the version but the "provider" - they switched to OpenJDK) and there are no fonts installed causing the problem.
I fix it rollbacking to the 8.5.66 version
I am currently having the same issue. A temporary fix I did is to remove all the styling and formatting. I think this is an issue on the azure app service container itself. I've raised this question to the Azure community and will update here once I get an answer.
Another workaround would be to deploy the app in a custom container.
For Apache Tomcat 9 works if you choose tomcat version 9.0.46

Connecting to Db2 on z/OS via JDBC using IBM JDK vs OpenJDK

I am able to connect to Db2 on z/OS with the IBM universal JDBC driver file db2jcc4.jar using IBM JDK 1.8 that is bundled with WebSphere 9. Every thing works fine and I can browse the catalog and execute queries. I used Squirrel SQL version 4.0.0.
But when I switch my JDK to the Open JDK 8 or 12 while keeping everything else the same, I get the following error. What should be done to fix this error? What is the difference between IBM JDK and Open JDK, which causes the DB2 connection to work with one JDK and fail with the other?
Here is one of matching articles of your case:
JDBC application may receive error "Security mechanism not supported"
https://www.ibm.com/support/pages/jdbc-application-may-receive-error-security-mechanism-not-supported
Resolving The Problem
Set the following property :
securityMechanism = ENCRYPTED_USER_PASSWORD_AND_DATA_SECURITY (13)
Alternatively you can set property retryWithAlternativeSecurityMechanism to YES(1).
Hope this helps.
According to IBM's documentation for their IBM Data Server Driver for JDBC and SQLJ, error code -4214 is an "Authorization failed" error -- and you know that much. But you can get more specific information about the problem if you call SQLException.getMessage. I think you may have done that already, but it's not entirely clear.
My semi-educated guess is that you haven't yet followed the configuration steps in IBM's driver documentation in the section "Configuring the Java Runtime Environment to Use SSL":
https://www.ibm.com/support/knowledgecenter/SSEPGG_11.5.0/com.ibm.db2.luw.apdv.java.doc/src/tpc/imjcc_t0054066.html
You'll have to apply some common sense knowledge to those instructions to adapt them for the OpenJDK, and this might not be an IBM supported combination depending on what/how you do it. If you can somehow use the IBMJSSE2 Provider, that'd be nice.
I think Mao and Mustaccio probably have the right ideas, and probably you're just missing the server certificate in your truststore. The instructions linked above walk you through how to configure that.

Getting IllegalStateException when starting the grpc server

I am using grpc for my API development.
I was able to create and access API's so far.
All of a sudden I am seeing this exception stack trace continuously some 5 seconds after the "INFO: Server started. Listening on port 42420" message is displayed.
I have deployed this project and bringing the server up on a GCE instance. Please let me know the reason and solution for this issue if anyone have faced it before.
Stack trace:
May 11, 2016 7:14:20 AM io.grpc.internal.AbstractServerStream deframeFailed
WARNING: Exception processing message
java.lang.IllegalStateException: MessageDeframer is already closed
at com.google.common.base.Preconditions.checkState(Preconditions.java:173)
at io.grpc.internal.MessageDeframer.checkNotClosed(MessageDeframer.java:222)
at io.grpc.internal.MessageDeframer.deframe(MessageDeframer.java:168)
at io.grpc.internal.AbstractStream.deframe(AbstractStream.java:283)
at io.grpc.internal.AbstractServerStream.inboundDataReceived(AbstractServerStream.java:199)
at io.grpc.netty.NettyServerStream.inboundDataReceived(NettyServerStream.java:77)
at io.grpc.netty.NettyServerHandler.onDataRead(NettyServerHandler.java:234)
at io.grpc.netty.NettyServerHandler.access$300(NettyServerHandler.java:95)
at io.grpc.netty.NettyServerHandler$FrameListener.onDataRead(NettyServerHandler.java:443)
at io.netty.handler.codec.http2.DefaultHttp2ConnectionDecoder$FrameReadListener.onDataRead(DefaultHttp2ConnectionDecoder.java:236)
at io.netty.handler.codec.http2.Http2InboundFrameLogger$1.onDataRead(Http2InboundFrameLogger.java:46)
at io.netty.handler.codec.http2.DefaultHttp2FrameReader.readDataFrame(DefaultHttp2FrameReader.java:409)
at io.netty.handler.codec.http2.DefaultHttp2FrameReader.processPayloadState(DefaultHttp2FrameReader.java:240)
at io.netty.handler.codec.http2.DefaultHttp2FrameReader.readFrame(DefaultHttp2FrameReader.java:147)
at io.netty.handler.codec.http2.Http2InboundFrameLogger.readFrame(Http2InboundFrameLogger.java:39)
at io.netty.handler.codec.http2.DefaultHttp2ConnectionDecoder.decodeFrame(DefaultHttp2ConnectionDecoder.java:102)
at io.netty.handler.codec.http2.Http2ConnectionHandler$FrameDecoder.decode(Http2ConnectionHandler.java:515)
at io.netty.handler.codec.http2.Http2ConnectionHandler.decode(Http2ConnectionHandler.java:575)
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:360)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:244)
at io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java:83)
at io.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java:163)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:155)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:950)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:125)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:510)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:467)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:381)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:353)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:742)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
I was having the similar issue because in my service implementation I had something like below,
#Override
public void myMethod(
//super.myMethod(myRequest, responseObserver);// removing this line resolved my issue.
...
responseObserver.onNext(response); // I had exception here because of the super.myMethod call.
...
}
I thought it was good to call the base implementation and then do my implementation. But seems like that was not a good idea.
I hope this saves someone's time.
The error seems like this issue. The user from the issue was experiencing the exception due to a service clients were accessing but was unimplemented, but there are other possible triggers. The fix is almost committed and it should be fixed in the next release.

How to connect to oracle from a java servlet?

I have a problem connecting to oracle from within a java servlet running in Jetty (as part of Eclipse). The identical code runs fine from a standalone java app.
My entire development environment is on a single mac. I am using Eclipse and have included the ojdbc6.jar in the main 'Referenced Libraries' and have also dragged and dropped this file in the war/web-inf/lib folder.
As soon as the line
OracleConnectionPoolDataSource ocpds = new
OracleConnectionPoolDataSource();
is called (within the servlet) I get the exception:
java.security.AccessControlException: access denied
(javax.management.MBeanServerPermission createMBeanServer)
Am I missing some security policy or so? If so, exactly what do I do need to do to rectify this? And where does this BeanServer come in?
Thanks in advance.
Every web container has its own way of defining data sources, and making them available through JNDI. You should do that instead.
The native oracle connection pool seems to be creating an MBeanServer, and this is not probably not allowed by the security manager used by Jetty. See http://wiki.eclipse.org/Jetty/Feature/Secure_Mode and http://wiki.eclipse.org/Jetty/Tutorial/Jetty-Policy.
Worked it out - not entirely clear why but created a new GWT app in Eclipse but this time NOT included the Google App Engine (which is ticked by default). This seems to add some restrictions to the code when it is running in Jetty....
I now have copied the sample code over and all is working well!

Netbeans trys to connect to deleted jdbc

Here is how setup looks like:
ApplicationServer - GlassFish
Database Server - Oracle 10g2
Persistance Library - EclipseLink
Faces Framework - IceFaces
My Problem is that everytime I change the database connection the application/eclipselink stops working, failing to find the Persistance Unit.
After loosing a whole day trying to figure it out. I decided to delete all the information about connections and persistance units and use only one new created.
Building the project was not a problem, but running it I get an error, pointing that the there is a validationexception and a persistance unit with a given name was not found. That name is deleted and is't descriped in the persistance.xml nor in the sun-resources.xml. There is no such entry in the Services in Netbeans.
Have you seen such an error, and how can I make sure, that netbeans doesn't store information on places I can't reach from the IDE? How is it so that my application is looking for something that isn't listed anywhere...
Okay next time I have to think more, instead of asking the question here. So my problem was the cache directory of Netbeans 6.9.1.
Deleted the cache directory and everything started working again.
I hope that this problem is fixed in the next releases. it can be real pain in ... :)

Resources