Unable to Create map entries in Hazelcast - java

I am using Hazelcast v2.5 and Maven plugin in Eclipse . I tried running an example program in Eclipse which creates 3 map entries in the ABCD namespace . When I run my code in Eclipse it shows this WARNING message
Feb 07, 2013 12:08:23 PM com.hazelcast.impl.ConcurrentMapManager
WARNING: [192.168.1.36]:5702 [dev] Caller -> RedoLog{name=c:ABCD, redoType=REDO_TARGET_UNKNOWN, operation=CONCURRENT_MAP_MERGE, target=null / connected=false, redoCount=53, migrating=null
partition=Partition [227]{
}
}
This keeps on Iterating till the redo threshold exceeds.
Feb 07, 2013 12:08:42 PM com.hazelcast.impl.LifecycleServiceImpl
WARNING: [192.168.1.36]:5702 [dev] [CONCURRENT_MAP_MERGE] Redo threshold[90] exceeded! Last redo cause: REDO_TARGET_UNKNOWN, Name: c:ABCD
com.hazelcast.core.OperationTimeoutException: [CONCURRENT_MAP_MERGE] Redo threshold[90] exceeded! Last redo cause: REDO_TARGET_UNKNOWN, Name: c:ABCD
at com.hazelcast.impl.BaseManager$ResponseQueueCall.getRedoAwareResult(BaseManager.java:640)
at com.hazelcast.impl.BaseManager$ResponseQueueCall.getResult(BaseManager.java:627)
at com.hazelcast.impl.BaseManager$RequestBasedCall.getResultAsBoolean(BaseManager.java:437)
at com.hazelcast.impl.BaseManager$ResponseQueueCall.getResultAsBoolean(BaseManager.java:544)
at com.hazelcast.impl.ConcurrentMapManager$MPut.mergeOne(ConcurrentMapManager.java:1758)
at com.hazelcast.impl.ConcurrentMapManager$MPut.merge(ConcurrentMapManager.java:1747)
at com.hazelcast.impl.LifecycleServiceImpl$1.run(LifecycleServiceImpl.java:143)
at com.hazelcast.impl.executor.ParallelExecutorService$ParallelExecutorImpl$ExecutionSegment.run(ParallelExecutorService.java:212)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
at com.hazelcast.impl.ExecutorThreadFactory$1.run(ExecutorThreadFactory.java:38)
Why does this occur ?
Please Help.!

You can do the following just to get started with a barebones Java class (I suggest you go through a more detailed tutorial as it might be more useful - I have not gone over accessing Hazelcast service):
Specify the map in the hazelcast.xml file as follows:
<map name="testMap">
<backup-count>1</backup-count>
<eviction-policy>NONE</eviction-policy>
<max-size policy="cluster_wide_map_size">0</max-size>
<eviction-percentage>25</eviction-percentage>
<merge-policy>hz.ADD_NEW_ENTRY</merge-policy>
<map-store enabled="true">
<class-name>models.test.StoreLoadTestMap</class-name>
<write-delay-seconds>5</write-delay-seconds>
</map-store>
<entry-listeners>
<entry-listener include value="true"local="false">models.test.ListenerTestMap</entry-listener>
</entry-listeners>
</map>
Once done, you can simply call the following from your Java app:
IMap<String, testObject> testMap = Hazelcast.getMap("testMap");
Now, you should be able to put/get values to and from the map as needed. You can use tcp or multicasting for replication based on your use case (use tcp if possible) and retrieve info from the second map for confirmation of data replication. Please also understand how data gets replicated across maps.
Hope it helps

Related

FusionAuth incomplete reindex with AWS Elasticsearch

I am migrating from a self-hosted Elasticsearch FusionAuth search to an AWS Elasticsearch Service solution.
I have a new FusionAuth app EC2 instance reading from the in-use database that is configured to use the new Elasticsearch service.
On triggering a reindex from the new app instance I see that only around 60k or 62.5k documents are being written to the new index when I am expecting roughly 6mil.
I see no errors from AWS's Elasticsearch Service and in the app's logs I can see: (endpoint intentionally omitted)
Feb 13, 2020 10:18:46.116 AM INFO io.fusionauth.api.service.search.ElasticSearchClientProvider - Connecting to FusionAuth Search Engine at [https://vpc-<<omitted>>.eu-west-1.es.amazonaws.com]
13-Feb-2020 11:19:55.176 INFO [http-nio-9011-exec-3] org.apache.coyote.http11.Http11Processor.service Error parsing HTTP request header
Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level.
java.lang.IllegalArgumentException: Invalid character found in method name. HTTP method names must be tokens
at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:430)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:684)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:808)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
"/usr/local/fusionauth/logs/fusionauth-app.log" [readonly] 43708L, 4308629C 42183,1 96%
at io.fusionauth.api.service.search.client.domain.documents.IndexUser.<init>(IndexUser.java:79)
at io.fusionauth.api.service.search.ElasticsearchSearchEngine.lambda$index$1(ElasticsearchSearchEngine.java:140)
at java.util.ArrayList.forEach(ArrayList.java:1257)
at io.fusionauth.api.service.search.ElasticsearchSearchEngine.index(ElasticsearchSearchEngine.java:140)
at io.fusionauth.api.service.user.ReindexRunner$ReindexWorker.run(ReindexRunner.java:101)
at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-14" java.lang.NullPointerException
at io.fusionauth.api.service.search.client.domain.documents.IndexUser.<init>(IndexUser.java:79)
at io.fusionauth.api.service.search.ElasticsearchSearchEngine.lambda$index$1(ElasticsearchSearchEngine.java:140)
at java.util.ArrayList.forEach(ArrayList.java:1257)
at io.fusionauth.api.service.search.ElasticsearchSearchEngine.index(ElasticsearchSearchEngine.java:140)
at io.fusionauth.api.service.user.ReindexRunner$ReindexWorker.run(ReindexRunner.java:101)
at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-13" java.lang.NullPointerException
Exception in thread "Thread-11" java.lang.NullPointerException
Exception in thread "Thread-12" java.lang.NullPointerException
Feb 18, 2020 10:23:29.064 AM INFO io.fusionauth.api.service.user.ReindexRunner - Reindex completed in [86797] ms or [86] seconds.
Although there are some exceptions there is also an "Reindex completed" INFO log at the end.
Not knowing the ins-and-outs of Elasticsearch I'm also not sure where to start in investigating a NullPointerException.
It looks like the re-index operation is taking an exception which is likely the cause of the truncated index.
Exception in thread "Thread-14" java.lang.NullPointerException
at io.fusionauth.api.service.search.client.domain.documents.IndexUser.<init>(IndexUser.java:79)
This code makes an assumption that you have a username or email address. This should be enforced by the FusionAuth APIs. But in this case, for this exception to occur the email and username are both NULL.
How did you get users into the db, using the Import API, User API, or something else?
In theory you should find at least one user with a NULL value for the email and username.
This query - or similar - should find the offending user, then we need to identify how this user was added to FusionAuth.
SELECT email, username from identities WHERE email IS NULL OR username IS NULL

Weblogic Server Cluster Setup 11g - Setting up a Server Instance and Cluster

I'm looking to set up a Clustered Server up on Web Logic. I walk though the following steps and yet when I restart my server then start the cluster I get an exception. The exception is listed below.
Here are the steps I go through on the Console in Web Logic
Create Cluster
In the console page mydomain.com/7002/console on the left side
I click on
Environment
to expand the tree and then click on
Clusters
It changes screens on the right. I fill out the data for the
CLUSTER NAME
and I left the messaging mode to Uni-Cast
The multicast address and port are already filled out but are greyed out.
I then click OK.
After this I configure the server. On the side on the console page I click on Servers
Server Config
I fill out the Server Name: MyServer
I punch in the Server Listen Address
Port is defaulted to 7001 which is available
I then fill out the question
Should this server belong to a cluster
I answer
Yes, Make this a server a member of an existing cluster and I select the cluster I just created.
I then click Finish
After I accept the changes and reboot the server, when I start up the instance of the server I get the below exception in the error logs. Any help would be greatly appreciated.
####<Sep 20, 2016 1:57:25 PM CDT> <Debug> <ServerLifeCycle> <DIFDX> <WLS_RUN_MANAGER> <main> <<WLS Kernel>> <> <> <1474397845602> <BEA-000000> <calling halt on weblogic.nodemanager.NMService#3c3d22af>
####<Sep 20, 2016 1:57:25 PM CDT> <Debug> <DiagnosticContext> <> <> <weblogic.timers.TimerThread> <> <> <> <1474397845604> <BEA-000000> <Invoked DCM.initialValue() for thread id=15, name=weblogic.timers.TimerThread
java.lang.Exception
at weblogic.diagnostics.context.DiagnosticContextManager$1.initialValue(DiagnosticContextManager.java:267)
at weblogic.kernel.ResettableThreadLocal.initialValue(ResettableThreadLocal.java:117)
at weblogic.kernel.ResettableThreadLocal$ThreadStorage.get(ResettableThreadLocal.java:204)
at weblogic.kernel.ResettableThreadLocal.get(ResettableThreadLocal.java:74)
at weblogic.diagnostics.context.DiagnosticContextManager$WLSDiagnosticContextFactoryImpl.findOrCreateDiagnosticContext(DiagnosticContextManager.java:365)
at weblogic.diagnostics.context.DiagnosticContextFactory.findOrCreateDiagnosticContext(DiagnosticContextFactory.java:111)
at weblogic.diagnostics.context.DiagnosticContextFactory.findOrCreateDiagnosticContext(DiagnosticContextFactory.java:94)
at weblogic.diagnostics.context.DiagnosticContextHelper.getContextId(DiagnosticContextHelper.java:32)
at weblogic.logging.LogEntryInitializer.getCurrentDiagnosticContextId(LogEntryInitializer.java:117)
at weblogic.logging.LogEntryInitializer.initializeLogEntry(LogEntryInitializer.java:67)
at weblogic.logging.WLLogRecord.<init>(WLLogRecord.java:43)
at weblogic.logging.WLLogRecord.<init>(WLLogRecord.java:54)
at weblogic.logging.WLLogger.normalizeLogRecord(WLLogger.java:64)
at weblogic.logging.WLLogger.log(WLLogger.java:35)
at weblogic.diagnostics.debug.DebugLogger.log(DebugLogger.java:231)
at weblogic.diagnostics.debug.DebugLogger.debug(DebugLogger.java:204)
at weblogic.work.SelfTuningDebugLogger.debug(SelfTuningDebugLogger.java:18)
at weblogic.work.ServerWorkManagerImpl$1.log(ServerWorkManagerImpl.java:44)
at weblogic.work.SelfTuningWorkManagerImpl.debug(SelfTuningWorkManagerImpl.java:597)
at weblogic.work.RequestManager.log(RequestManager.java:1204)
at weblogic.work.RequestManager.addToCalendarQueue(RequestManager.java:315)
at weblogic.work.RequestManager.addToPriorityQueue(RequestManager.java:301)
at weblogic.work.RequestManager.executeIt(RequestManager.java:248)
at weblogic.work.SelfTuningWorkManagerImpl.scheduleInternal(SelfTuningWorkManagerImpl.java:164)
at weblogic.work.SelfTuningWorkManagerImpl.schedule(SelfTuningWorkManagerImpl.java:144)
at weblogic.timers.internal.TimerManagerFactoryImpl$WorkManagerExecutor.execute(TimerManagerFactoryImpl.java:132)
at weblogic.timers.internal.TimerManagerImpl.waitForStop(TimerManagerImpl.java:241)
at weblogic.timers.internal.TimerManagerImpl.stop(TimerManagerImpl.java:98)
at weblogic.timers.internal.TimerThread$Thread.run(TimerThread.java:250)
Solution: It ended up being a timeout issue. The server was taking such a long time to come up that the instance was assuming no response back and thus assuming it couldn't get though. Once I increased the timeout to be longer, it finally came through and worked.

Kinesis worker error: Caught exception when initializing LeaseCoordinator

I am trying to execute the sample producer and consumer code on the Kinesis Streams website: http://docs.aws.amazon.com/streams/latest/dev/learning-kinesis-module-one-download.html
I've downloaded the source, and I am using Eclipse to run it. I've included the necessary jar files, so I would think that everything would be setup to run.
When I run the processor code that consumes the records from Kinesis, however, I get this error:
Aug 02, 2016 8:35:14 PM com.amazonaws.services.kinesis.clientlibrary.lib.worker.Worker initialize SEVERE: Caught exception when initializing LeaseCoordinator
Does anyone think they could tell me what is causing this error?
EDIT: Here is the full stack trace from the error on Eclipse:
Aug 02, 2016 9:02:27 PM com.amazonaws.services.kinesis.clientlibrary.lib.worker.Worker initialize
SEVERE: Caught exception when initializing LeaseCoordinator
com.amazonaws.services.kinesis.leases.exceptions.DependencyException: com.amazonaws.services.dynamodbv2.model.AmazonDynamoDBException: User: arn:aws:sts::500238854089:assumed-role/NORD-NONPROD-a0121-Team/AEXM is not authorized to perform: dynamodb:CreateTable on resource: arn:aws:dynamodb:us-west-2:500238854089:table/amazon-kinesis-learning (Service: AmazonDynamoDBv2; Status Code: 400; Error Code: AccessDeniedException; Request ID: BGME094FRUAEK2KFCPQIAM5U8VVV4KQNSO5AEMVJF66Q9ASUAAJG)
at com.amazonaws.services.kinesis.leases.impl.LeaseManager.createLeaseTableIfNotExists(LeaseManager.java:124)
at com.amazonaws.services.kinesis.clientlibrary.lib.worker.KinesisClientLibLeaseCoordinator.initialize(KinesisClientLibLeaseCoordinator.java:172)
at com.amazonaws.services.kinesis.clientlibrary.lib.worker.Worker.initialize(Worker.java:380)
at com.amazonaws.services.kinesis.clientlibrary.lib.worker.Worker.run(Worker.java:324)
at com.amazonaws.services.kinesis.samples.stocktrades.processor.StockTradesProcessor.main(StockTradesProcessor.java:96)
Caused by: com.amazonaws.services.dynamodbv2.model.AmazonDynamoDBException: User: arn:aws:sts::500238854089:assumed-role/NORD-NONPROD-a0121-Team/AEXM is not authorized to perform: dynamodb:CreateTable on resource: arn:aws:dynamodb:us-west-2:500238854089:table/amazon-kinesis-learning (Service: AmazonDynamoDBv2; Status Code: 400; Error Code: AccessDeniedException; Request ID: BGME094FRUAEK2KFCPQIAM5U8VVV4KQNSO5AEMVJF66Q9ASUAAJG)
at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:1401)
at com.amazonaws.http.AmazonHttpClient.executeOneRequest(AmazonHttpClient.java:945)
at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:723)
at com.amazonaws.http.AmazonHttpClient.doExecute(AmazonHttpClient.java:475)
at com.amazonaws.http.AmazonHttpClient.executeWithTimer(AmazonHttpClient.java:437)
at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:386)
at com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient.doInvoke(AmazonDynamoDBClient.java:2074)
at com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient.invoke(AmazonDynamoDBClient.java:2044)
at com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient.createTable(AmazonDynamoDBClient.java:899)
at com.amazonaws.services.kinesis.leases.impl.LeaseManager.createLeaseTableIfNotExists(LeaseManager.java:117)
... 4 more
Your stack trace is telling you exactly what the problem is:
User: arn:aws:sts::500238854089:assumed-role/NORD-NONPROD-a0121-Team/AEXM is not authorized to perform: dynamodb:CreateTable on resource: arn:aws:dynamodb:us-west-2:500238854089:table/amazon-kinesis-learning
Make sure you've provided credentials to the DynamoDBClient that has CreateTable permissions - LeaseCoordinator attempts to create the leasing table in Dynamo.
It is actually possible to configure logging for Scala Kinesis Enrich by running the jar file like this:
java -jar -Dorg.slf4j.simpleLogger.defaultLogLevel=debug snowplow-kinesis-enrich-0.5.0 --config enrich.conf --resolver resolver.json
This should print all debug messages from the Kinesis Client Library. (Watch out because the output will become very verbose.) Could you try rerunning with this change to logging? Hopefully that will provide more clues about what's going wrong.

How to correct the exception database.ocf' is locked by another process in orientdb?

I'm getting the exception when I try to connect to the orient db using Java. Below is the exception I'm getting.
Jun 07, 2016 12:43:40 PM com.orientechnologies.common.log.OLogManager log
INFO: OrientDB auto-config DISKCACHE=891MB (heap=891MB direct=891MB os=4,006MB), assuming maximum direct memory size equals to maximum JVM heap size
Jun 07, 2016 12:43:40 PM com.orientechnologies.common.log.OLogManager log
WARNING: MaxDirectMemorySize JVM option is not set or has invalid value, that may cause out of memory errors. Please set the -XX:MaxDirectMemorySize=4006m option when you start the JVM.
Jun 07, 2016 12:43:40 PM com.orientechnologies.common.log.OLogManager log
WARNING: MaxDirectMemorySize JVM option is not set or has invalid value, that may cause out of memory errors. Please set the -XX:MaxDirectMemorySize=4006m option when you start the JVM.
Exception in thread "main" com.orientechnologies.orient.core.exception.OFileLockedByAnotherProcessException: File 'F:\Program Files\orientdb-community-2.2.0\databases\mydbo\database.ocf' is locked by another process, maybe the database is in use by another process. Use the remote mode with a OrientDB server to allow multiple access to the same database at com.orientechnologies.orient.core.storage.fs.OFileClassic.lock(OFileClassic.java:756)
at com.orientechnologies.orient.core.storage.fs.OFileClassic.openChannel(OFileClassic.java:813)
at com.orientechnologies.orient.core.storage.fs.OFileClassic.open(OFileClassic.java:603)
at com.orientechnologies.orient.core.storage.impl.local.OSingleFileSegment.open(OSingleFileSegment.java:51)
at com.orientechnologies.orient.core.storage.impl.local.OStorageConfigurationSegment.load(OStorageConfigurationSegment.java:80)
at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.open(OAbstractPaginatedStorage.java:186)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.open(ODatabaseDocumentTx.java:231)
at orient.insert.Insert.main(Insert.java:12)
this is the code that i tried.
ODatabaseDocumentTx db = new ODatabaseDocumentTx("plocal:F:/Program Files/orientdb-community-2.2.0/databases/mydbo").open("admin", "admin");
ODocument doc = new ODocument("Person");
doc.field( "name", "Luke" );
doc.field( "surname", "Skywalker" );
doc.field( "city", new ODocument("City").field("name","Rome").field("country", "Italy") );
doc.save();
db.close();
I can't figure out the error I'm having.
You have a server running and you try to open the database from another process in plocal.
Could you please verify that you have no active OrientDB instances while accessing it in plocal (console or external processes) and that you open one plocal connection at a time?

Error generating web services through the Apache CXF framework

I am trying to generate web services in Eclipse by using the Apache CXF framework.
First I am creating the Java class corresponding to the desired web service and then I generate two dynamic web projects, one for the web service (wsdl file) and another one for the clients. The web web services work well after I create them but after some time (one-three days) I get the error displayed in the image at the server startup.
INFO: Starting service Catalina
Dec 7, 2011 9:27:55 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.4
Dec 7, 2011 9:27:55 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(C:\Documents and Settings\user\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\Prosys_Doctorat_Servicii_FAS_servicii\WEB-INF\lib\geronimo-servlet_3.0_spec-1.0.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Dec 7, 2011 9:27:59 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1672)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1517)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:415)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:397)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4287)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4816)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1028)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:773)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1028)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:278)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:429)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:662)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
at org.apache.catalina.startup.Catalina.start(Catalina.java:592)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:290)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:418)
Dec 7, 2011 9:27:59 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Skipped installing application listeners due to previous error(s)
Dec 7, 2011 9:27:59 PM org.apache.catalina.core.StandardContext startInternal
Then when I try to call a web service from the project I get the following error:
Exception in thread "main" javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:149)
at org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:90)
at javax.xml.ws.Service.<init>(Unknown Source)
at read_variable_value.ReadVariableNodeService1Service.<init>(ReadVariableNodeService1Service.java:50)
at FAS.Model2_FAS.asociere_valori(Model2_FAS.java:206)
at FAS.Model2_FAS.main(Model2_FAS.java:2596)
Caused by: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:93)
at org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:203)
at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:147)
... 5 more
Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: Problem parsing 'http://localhost:8081/Prosys_Doctorat_Servicii_FAS_servicii/services/ReadVariableNodeService1Port?wsdl'.: java.io.FileNotFoundException: http://localhost:8081/Prosys_Doctorat_Servicii_FAS_servicii/services/ReadVariableNodeService1Port?wsdl
at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:239)
at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:186)
at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:91)
... 7 more
Caused by: java.io.FileNotFoundException: http://localhost:8081/Prosys_Doctorat_Servicii_FAS_servicii/services/ReadVariableNodeService1Port?wsdl
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
... 13 more
What can cause this error which only appears after the web services are used repeatedly?
http://i.stack.imgur.com/4mTNZ.jpg
http://i.stack.imgur.com/rYkQb.jpg
Hi, the client is automatically generated in the following way:
private static final QName SERVICE_NAME = new QName("http://read_variable/", "ReadVariableNodeServiceService");
URL wsdlURL = ReadVariableNodeServiceService.WSDL_LOCATION;
ReadVariableNodeServiceService ss = new ReadVariableNodeServiceService(wsdlURL, SERVICE_NAME);
SEIReadValue port = ss.getReadVariableNodeServicePort();
{
System.out.println("Invoking getValue...");
java.lang.String _getValue_arg0 = "Alina";
java.lang.String _getValue_arg1 = "WorkspaceS1";
try {
double _getValue__return = port.getValue(_getValue_arg0, _getValue_arg1);
System.out.println("getValue.result=" + _getValue__return);
................
Last week I have found an interesting documentation which recommends the following way to call a web service:
ClassPathXmlApplicationContext context=new ClassPathXmlApplicationContext(new String[]{"read_variable/client3_beans.xml"});
SEIReadValue port = (SEIReadValue) context.getBean("readvariableClient");
{
System.out.println("Invoking getValue...");
java.lang.String _getValue_arg0 = "Alina";
java.lang.String _getValue_arg1 = "WorkspaceS1";
try {
double _getValue__return = port.getValue(_getValue_arg0, _getValue_arg1);
System.out.println("getValue.result=" + _getValue__return);
.........
What do you think? May this be the reason for my error?
I am very happy that I have almost found out the cause of my error. But I am a beginner in web services and I haven't understood your message entirely.
I want to specify that I have a set of basic/simple web services, and then based on these web services I have created a complex web service where I obtain the context
of each simple web service in order to obtain its functionality, and as you said (as I understood) this is not the right approach.
ClassPathXmlApplicationContext context=new ClassPathXmlApplicationContext(new String[]{"write_a_matrix/client2_beans.xml"});
SEIWriteMatrix port = (SEIWriteMatrix) context.getBean("write_a_matrix_Client");
...........................................................
ClassPathXmlApplicationContext context_WV=new ClassPathXmlApplicationContext(new String[]{"write_value/client1_beans.xml"});
SEIWriteValue port_WV = (SEIWriteValue) context_WV.getBean("write_a_value_Client");
...........................................................
I have created a client_beans xml file for each web service client. Is it ok? Can you provide me an example of how to call a web service and the way to hold just one App context?
I will provide you my email address < berlindutza#yahoo.com > in case you want to communicate much easier because I have seen that we are limited to a certain number of characters (for the add comment section).
Thank you a lot!
Guessing here: You are probably recreating the CXF client for every request, instead of creating it once, keeping it as a singleton and using this one instance for every subsequent request.
Ideally you should be able to generate the client using the webservice interface. If you have explicitly specified a wsdl, cxf will generate a proxy based on the WSDL, which is what seems to be happening for you. Once in a while the service which serves out the wsdl fails and you get this error.
If you are using Spring, you can do something along these lines:
<bean id="clientFactory" class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean">
<property name="serviceClass" value="...wsInterface" />
<property name="address" value="serviceURL" />
</bean>
<bean id="client" class="...wsInterface" factory-bean="clientFactory" factory-method="create" />

Categories