Using Eclipse milo to create a client for OPC UA but getting error while using the ReadExample - opc-ua

I have built all the jars of the eclipse milo project independently.
sdk-client-0.2.2-SNAPSHOT.jar
sdk-core-0.2.2-SNAPSHOT.jar
stack-client-0.2.2-SNAPSHOT.jar
stack-core-0.2.2-SNAPSHOT.jar
bsd-parser-core-0.2.2-SNAPSHOT.jar
there are no errors in the project. but while running the ReadExample im getting the following error
[main] ERROR com.lnt.ClientExampleRunner - Error getting client: Could not
initialize class org.eclipse.milo.opcua.stack.core.Stack
in the
stack-core-0.2.2-SNAPSHOT.jar
i see that Stack class exists.
even if i comment out the
Stack.releaseSharedResources();
by which it is using the Stack class unable to eliminate this error and connect to OPC UA server.
when the projects of these jar are added in maven dependency it is working fine.
Since i dont need server part of the eclipse milo project trying to thin down the project. Request Help!

Related

Eclipse RCP + Jetty 9.4.8 + Websocket

I'm writing an Eclipse RCP application. I use the embedded Jetty server to handle Rest Services. It works fine.
Now I want to add a WebSocket Connection. I didn't find any Jetty Websocket bundle in the Eclipse repository. So I've created my own plugin with the differents Jetty WebSocket jars.
I've created a WebSocketServlet and a wetsocket client to test it.
When I try to initiate de Websocket, I get the following error :
java.lang.IllegalStateException: Unable to find required ServletContext attribute: org.eclipse.jetty.util.DecoratedObjectFactory
at org.eclipse.jetty.websocket.server.WebSocketServerFactory.doStart(WebSocketServerFactory.java:311)
Does someone have a solution ?
Thanks.
Cedric.
Don't mix versions of Jetty jars, make sure you are using the same version for all Jetty jars.
Bundles for Jetty can be found at the listed location.
https://download.eclipse.org/jetty/updates/jetty-bundles-9.x/
Thank you for your answers.
The Jetty version bundled with my Eclipse version is the 9.4.8. I known, I have to migrate to a newer version but I didn't do it yet (and I get some troubles with Java 9+ and the Jersey layer embedded in eclipse (the rsconnector).
The ServletContextLauncher present into the Jetty eclipse bundle set up correctly the DecoratedObjectFactory but It doesn't seem to be used to initialise the websocket server layer.
I've already did some tests a few years ago with an oldest Jetty release (also bundled in an eclipse plugin) and I was able to open a websocket without error. But, not with the 9.4.8 one...

How to solve SplitsrcTargetPreparation exception in Oracle weblogic server?

I am trying to run a simple Restful web service example on oracle weblogic server . but i am getting this issue while run the project on server. Publishing to Oracle Weblogic server at localhost has encountered a problem.Runtime exception occurred in publish task 'SplitsrcTargetPreparation'.
Have a look on screen sort.What i have to do ?
None of the other answers solved my problem, but I finally found a solution. I'm not claiming that this is the best or only way of resolving this issue, but it worked for me. Hope it helps others.
Open the Properties of your WebLogic server instance in Eclipse. Select Publishing. Set the publishing mode to "Publish as an exploded archive". You will no longer get a split source error.
Check the following.
Maven version – If you have imported as a maven project then make
sure that maven version is compatible to the java version you are
using.
Makes sure that you are using the java from the Middleware
which is comes bundled with weblogic.
New domain – Corrupt domain
may also cause this. Create a new domain

Jersey Rest service: 'Resource /Servers is not open'

I am new to Java EE and am trying to learn the same using tutorials and examples online.
I am trying to follow http://www.vogella.com/articles/REST/article.html#first and create a RESTful service using Jersey.
Since this is my first RESTful service, I have basically copy-pasted whatever code is present till http://www.vogella.com/articles/REST/article.html#first_run.
However, when I try to run the service, I am getting an error:
Could not load the Tomcat server configuration at /Servers/Tomcat v7.0 Server at localhost-config. The Servers project is closed.
When I tried looking into the server configuration, I see that the configuration path is showing an error for the value: /Servers/Tomcat v7.0 Server at localhost-config.
When I try to change any (server) configuration and save it, I get the message: "Error while saving. Resource '/Servers' is not open."
Five differences between my project and what is described in the page:
I am using JDK 1.7, while the page mentions JDK1.6.
I am using Apache Tomcat Server 7.0, while the page mentions Tomcat version 6.0.
The Dynamic web module version is set to 3.0 in my project, while it is 2.5 in the page.
I have a couple of practise spring apps configured on my tomcat server. I am not sure how to remove them. :(
I have updated my web.xml to use web-app_3_1.xsd in the place of web-app_2_5.xsd.
I am not able to understand why this is happening.
If this does not seem to be solvable, I would be thankful, if you can point me to any resource that explains creating a RESTFul service using Jersey using Java EE7, Apache Tomcat 7 and, preferably, Eclipse.
The solution turned out to be simple. When I looked at the Project Explorer, I saw that there was a project called "Servers". Once I "opened" this project, the problem got resolved.
Seems like marking all projects and selecting "Close Project" has a side effect in Java EE Perspective. :)

Error generating (Java )Webservice client in Eclipse from .Net Web Service WSDL error

When trying to generate web service client in Eclipse using Wizard/Web services/web service client from an existing .Net Web services' WSDL, I encountered the following error:
"Wizard WSDL validation is disabled.", the wizard could not continue back to the main page since:
No server can be found and WebServiceProject does not exist. Choose an existing project or use the preferences to configure a server runtime.
What could I do so solve this issue? Thanks.
Does the Profile validation and conformance section on This Eclipse Page help?

Error 'Failed while installing Axis2 Web Services Core 1.1' , while setting Axis2 Web Services Facet

I am trying to implement web services using axis2, in Eclipse. (I had downloaded axis2-1.5 runtime and created environment variable for it.) I had created a dynamic web project and set the axis2 runtime successfully in Axis2 preferences.
After creating the project, I tried setting the project facet, but end up getting the following error: Failed while installing Axis2 Web Services Core 1.1
Stack shows only:NullPointerException(which is not helping me much in understanding the problem). Wat could be the problem? Without this, it's difficult to test web services using axis2.
(P.S: While creating the dynamic project, I didnt get any option to set the project facet, thus, I had to try setting the project facet, after creating the project. I was following the tutorial given at --> Web Services using axis2 tutorial)
Thanks
I tried to set up using Eclipse 3.6 and the error dint show up.