Unable to connect perfecto mobile through eclipse - eclipse

I am trying to test the cloud mobles using perfectomobiles though test case in eclipse for that i added Perfecto mobile add-in to eclipse and while creating a project i given below details
Cloud : mobilecloud.perfectomobile.com, username and password
after created the project we didn't get any MobileCloud views those MobileCloud Recording and MobileCloud Dashboard tabs are empty. i didn't under stand where we need to add mobiles(i am thinking like we are unable to connect to perfectomobile.com)
Then, i tried to connect through code like below
MobileDriver driver = new MobileDriver("mobilecloud.perfectomobile.com","username","password");
try {
// write your code here
IMobileDevice device = driver.getDevice("3152168C4EAA1E2A5DE93CF7B89222720E3A62E0");
device.open();
IMobileWebDriver webDriver = device.getDOMDriver("google.com");
webDriver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
webDriver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
webDriver.findElement(By.xpath("(//input[#id=\"lst-ib\"])[1]")).sendKeys("Perfecto Mobile");
webDriver.findElement(By.xpath("(//button[#id=\"tsbb\"])[1]")).click();
}
But, I am getting exception like below
10:40:39.569 [main] ERROR c.p.selenium.util.EclipseConnector - Failed to connect to MobileCloud for Eclipse plugin on host: localhost and port: 3287. Possible reasons are: The code doesn't run in Eclipse or the user doesn't have ECLIPSE role or the MobileCloud recording view is not open. In these cases use the MobileDriver constructor that receives the host, user and password.
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method) ~[na:1.7.0_55]
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339) ~[na:1.7.0_55]
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200) ~[na:1.7.0_55]
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182) ~[na:1.7.0_55]
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[na:1.7.0_55]
at java.net.Socket.connect(Socket.java:579) ~[na:1.7.0_55]
at java.net.Socket.connect(Socket.java:528) ~[na:1.7.0_55]
at java.net.Socket.<init>(Socket.java:425) ~[na:1.7.0_55]
at java.net.Socket.<init>(Socket.java:208) ~[na:1.7.0_55]
at com.perfectomobile.selenium.util.EclipseConnector.<init>(EclipseConnector.java:34) ~[pm-selenium-3.5.0.000.jar:na]
at com.perfectomobile.selenium.MobileDriver.initWithEclipseParams(MobileDriver.java:79) [pm-selenium-3.5.0.000.jar:na]
at com.perfectomobile.selenium.MobileDriver.<init>(MobileDriver.java:64) [pm-selenium-3.5.0.000.jar:na]
at com.perfectomobile.selenium.MobileDriver.<init>(MobileDriver.java:60) [pm-selenium-3.5.0.000.jar:na]
at MobileTest.main(MobileTest.java:42) [bin/:na]
Can any one help me

I believe your Perfecto mobile account doesn't have the Eclipse Role (or license) added to it (yes, they have something like this for Eclipse). Contact support to get it added. I faced the same issue earlier.

Related

Scala play framework - convert Rest API to HTTPS using .JKS file using organizational CA

Currently I am running scala play application, now it's HTTP APIs are working fine in my Angular UI application locally. But in our organization for higher environment we need to convert it to SSL HTTPS API.
We use our own organizational root CA and I got the myCA_trust.jks certificate file with me.
I added following properties in application.conf file,
play.server.https.keyStore.path="./myCA_trust.jks"
play.server.https.keyStore.password="change_me"
And for deploying the code I am creating the dist, and using following command to deploy it on linux server
./scala-rest-api -Dplay.http.secret.key="application_secreate_key" -Dhttps.port=8094 -Dplay.server.https.keyStore.path=./myCA_trust.jks -Dplay.server.https.keyStore.password=change_me
After doing this I can hit to the HTTPS URL using server address, but getting errors in server console like,
[error] a.a.OneForOneStrategy - ./myCA_trust.jks
akka.actor.ActorInitializationException: akka://application/system/StreamSupervisor-0/flow-2-1: exception during creation
at akka.actor.ActorInitializationException$.apply(Actor.scala:202)
at akka.actor.ActorCell.create(ActorCell.scala:698)
at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:549)
at akka.actor.ActorCell.systemInvoke(ActorCell.scala:571)
at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:293)
at akka.dispatch.Mailbox.run(Mailbox.scala:228)
at akka.dispatch.Mailbox.exec(Mailbox.scala:241)
at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
Caused by: java.lang.reflect.InvocationTargetException: null
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at play.core.server.ssl.ServerSSLEngine$.createScalaSSLEngineProvider(ServerSSLEngine.scala:116)
at play.core.server.ssl.ServerSSLEngine$.createSSLEngineProvider(ServerSSLEngine.scala:39)
at play.core.server.AkkaHttpServer$$anon$4$$anon$5.sslEngineProvider$lzycompute(AkkaHttpServer.scala:527)
at play.core.server.AkkaHttpServer$$anon$4$$anon$5.sslEngineProvider(AkkaHttpServer.scala:526)
at play.core.server.AkkaHttpServer$$anon$4$$anon$5.engineCreateSSLEngine(AkkaHttpServer.scala:528)
at javax.net.ssl.SSLContext.createSSLEngine(SSLContext.java:329)
Caused by: java.nio.file.NoSuchFileException: ./myCA_trust.jks
Please help me to configure HTTPS rest API URL, do let me know if there is anything else I need to add in the code and where.
Thanks and in advance.

How to connect Mongodb Atlas to Spring

I have a web application which is using Spring Boot to handle the backend logics. I'm trying to integrate mongodb to track some information about the users of this webapp.
I created a database on mongodb Atlas and through the Mongo Shell the connection goes fine. The problem comes when I try to connect with Spring. Let me show you all the details
Inside Atlas, I added this IP Address (0.0.0.0/0 (includes your current IP address)) into Security > Network Address. In theory this should allow me to connect to the database from any IP address.
I then created a collection called "test".
If I click on my cluster and then on the connect button, it ask me with which modality I want to connect. I choose "Connect your application", and then I have to select the Driver and the Version. I choose respectively "Java" and "3.6 or later" (I'm not sure if it's the correct version, the alternatives are 3.4 or 3.3). And finally it shows me the connection string which is:
mongodb+srv://admin:<password>#umadit-obxpb.mongodb.net/test?retryWrites=true&w=majority
To connect to Atlas with Spring I'm using this dependency
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb</artifactId>
</dependency>
Inside the application.properties file I have these two lines to configure mongo.
spring.data.mongodb.host=mongodb+srv://admin:<password>#umadit-obxpb.mongodb.net/test?retryWrites=true&w=majority
spring.data.mongodb.port=27017
Instead of the password I put for obvious reasons.
The only problem is that when I start Spring Boot I continue to receive this error message:
2020-02-25 16:31:25.605 INFO 41162 --- [=majority:27017] org.mongodb.driver.cluster : Exception in monitor thread while connecting to server mongodb+srv://admin:<password>#umadit-obxpb.mongodb.net/test?retrywrites=true&w=majority:27017
com.mongodb.MongoSocketException: mongodb+srv://admin:<password>#umadit-obxpb.mongodb.net/test?retrywrites=true&w=majority: nodename nor servname provided, or not known
at com.mongodb.ServerAddress.getSocketAddress(ServerAddress.java:188) ~[mongo-java-driver-3.6.4.jar:na]
at com.mongodb.connection.SocketStreamHelper.initialize(SocketStreamHelper.java:59) ~[mongo-java-driver-3.6.4.jar:na]
at com.mongodb.connection.SocketStream.open(SocketStream.java:57) ~[mongo-java-driver-3.6.4.jar:na]
at com.mongodb.connection.InternalStreamConnection.open(InternalStreamConnection.java:126) ~[mongo-java-driver-3.6.4.jar:na]
at com.mongodb.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:114) ~[mongo-java-driver-3.6.4.jar:na]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_111]
Caused by: java.net.UnknownHostException: mongodb+srv://admin:<password>#umadit-obxpb.mongodb.net/test?retrywrites=true&w=majority: nodename nor servname provided, or not known
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) ~[na:1.8.0_111]
at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928) ~[na:1.8.0_111]
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323) ~[na:1.8.0_111]
at java.net.InetAddress.getAllByName0(InetAddress.java:1276) ~[na:1.8.0_111]
at java.net.InetAddress.getAllByName(InetAddress.java:1192) ~[na:1.8.0_111]
at java.net.InetAddress.getAllByName(InetAddress.java:1126) ~[na:1.8.0_111]
at java.net.InetAddress.getByName(InetAddress.java:1076) ~[na:1.8.0_111]
at com.mongodb.ServerAddress.getSocketAddress(ServerAddress.java:186) ~[mongo-java-driver-3.6.4.jar:na]
... 5 common frames omitted
I don't know what to do in order to make it work. Am I missing something?
SOLUTION
As #barrypicker suggested, the problem was inside the properties file. Instead of using spring.data.mongodb.host I used spring.data.mongodb.uri. Now it works perfectly.
spring.data.mongodb.uri=mongodb+srv://admin:<password>#umadit-obxpb.mongodb.net/test?retryWrites=true&w=majority
even without spring.data.mongodb.port
Well, I think your to connect to Mongo Atlas your application.properties should have spring.data.mongodb.uri instead of spring.data.mongodb.host.spring.data.mongodb.uri: mongodb://<user>:<passwd>#<host>:<port>/<dbname>
I think this may work
`
Another issue with the atlas is that your IP is not allowed, make sure you add your IP at the network access tab.
Use this dependency inside "pom.xml" file
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>
Inside the "application.properties"
use "spring.data.mongodb.uri"
spring.data.mongodb.uri = mongodb+srv://<user>:<password>#<cluster_name>.mogodb.net/<dbname>

Issue with MyEclipse Proxy Connection

I am unable to get MyEclipse to connect to the marketplace. I am aware of the proxy setup. These are the steps I followed within a proxy environment and within a direct environment.
A. Within the Company Network. (browers use automatic configuration script)
Chose Native option. Does not work.
Chose Manual option. Set the domain, username. Opened the proxy script to figure out available proxy servers. Verified independently that these proxy servers work. Does not work.
Modified the vmargs to provide the http host, user, password and port properties. Does not work.
Did steps 1-3 with restarts of Eclipse.
B. Within home environment. (Direct connection to internet)
Tried Direct Option. Does not work.
Tried Native Option. Does not work.
The error message that I constantly see (through error logs) is this.
java.lang.reflect.InvocationTargetException
at org.eclipse.epp.internal.mpc.ui.commands.MarketplaceWizardCommand$3.run(MarketplaceWizardCommand.java:203)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Caused by: org.eclipse.core.runtime.CoreException: HTTP Server Unknown HTTP Response Code (-1):http://marketplace.eclipse.org/catalogs/api/p
at org.eclipse.equinox.internal.p2.transport.ecf.RepositoryTransport.stream(RepositoryTransport.java:161)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.epp.internal.mpc.core.util.AbstractP2TransportFactory.invokeStream(AbstractP2TransportFactory.java:35)
at org.eclipse.epp.internal.mpc.core.util.TransportFactory$1.stream(TransportFactory.java:69)
at org.eclipse.epp.internal.mpc.core.service.RemoteMarketplaceService.processRequest(RemoteMarketplaceService.java:141)
at org.eclipse.epp.internal.mpc.core.service.RemoteMarketplaceService.processRequest(RemoteMarketplaceService.java:80)
at org.eclipse.epp.internal.mpc.core.service.DefaultCatalogService.listCatalogs(DefaultCatalogService.java:36)
at org.eclipse.epp.internal.mpc.ui.commands.MarketplaceWizardCommand$3.run(MarketplaceWizardCommand.java:200)
... 1 more
Caused by: org.eclipse.ecf.filetransfer.BrowseFileTransferException: Could not connect to http://marketplace.eclipse.org/catalogs/api/p
at com.genuitec.pulse2.common.http.ecf.PulseRetrieveFileTransfer.openStreams(Unknown Source)
at org.eclipse.ecf.provider.filetransfer.retrieve.AbstractRetrieveFileTransfer.sendRetrieveRequest(AbstractRetrieveFileTransfer.java:889)
at org.eclipse.ecf.provider.filetransfer.retrieve.AbstractRetrieveFileTransfer.sendRetrieveRequest(AbstractRetrieveFileTransfer.java:576)
at org.eclipse.ecf.provider.filetransfer.retrieve.MultiProtocolRetrieveAdapter.sendRetrieveRequest(MultiProtocolRetrieveAdapter.java:106)
at org.eclipse.equinox.internal.p2.transport.ecf.FileReader.sendRetrieveRequest(FileReader.java:349)
at org.eclipse.equinox.internal.p2.transport.ecf.FileReader.read(FileReader.java:213)
at org.eclipse.equinox.internal.p2.transport.ecf.RepositoryTransport.stream(RepositoryTransport.java:153)
... 11 more
Is there any alternative or any other step that I can take to resolve this problem. I know I can go through the manual update by downloading the plugin and all. But I really want to solve this issue.
MyEclipse Version Information:
MyEclipse Blue Edition
Version: 10.7.1 Blue
Build id: 10.7.1-Blue-20130201
Apparently it could be a bug.
I just read this whole bug report here.
I tried adding the VM arguments to ensure the the HTTPClient workaround can be achieved via a configuration change. Did not work.
However, I was able to remove the http client libraries from the plugins folder, courtesy Comment #27 and #29 on the bug report.
Now I'm able to connect over proxy and direct as well.

how to get rid of errors in VersionInspectorLinker using GWTP?

When starting my first GWTP application I got this error message:
java.net.ConnectException: Connection timed out: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at java.net.Socket.connect(Socket.java:528)
at java.net.Socket.<init>(Socket.java:425)
at java.net.Socket.<init>(Socket.java:208)
at com.gwtplatform.common.rebind.VersionInspectorLinker.fetchArtifactVersion(VersionInspectorLinker.java:178)
at com.gwtplatform.common.rebind.VersionInspectorLinker.checkLatestVersion(VersionInspectorLinker.java:154)
I could configure a proxy in the jvm args of the gwt-maven-plugin, but the problem is that other developers would need to use different proxies and we also don't have Internet connection in our continuous integration servers.
How can this checking be disabled?
This is very simple. Add this to your .gwt.xml file:
<set-configuration-property name="verifyNewerVersion" value="false"/>

How do I connect the NetBeans profiler to a specic remote instance

I have a remote GlassFish server that has a node agent configured. The instance I want to start in profiling mode is controlled by the node agent.
I've installed and calibrated the remote pack and I've modified my domain.xml for the specific instance as follows:
<profiler enabled="true" name="NetBeansProfiler">
<jvm-options>-agentpath:/home/glassfish/glassfish/profiler-server-6.0rc1-linux/lib/deployed/jdk16/linux/libprofilerinterface.so=/home/glassfish/glassfish/profiler-server-6.0rc1-linux/lib,5140</jvm-options>
</profiler>
Now at this point NetBeans tells you to start the domain with the --verbose command but in my case I'm trying to start an instance and "asadmin start-instance" doesn't support --verbose. I've checked the server.log but I'm not seeing any error nor any language that says it's waiting when I try to start the instances.
However, I think GlassFish is properly configured and my NetBeans setup is the issue. Where I think the issue might be is trying to specify the port. If I leave the port off, it just tries to connect forever. If I put the port on it just closes the dialog and the status shows "Inactive".
UPDATE:
It seems there might be a bug with GF2. After verifying everything and getting the server so that it was listening, the following exception is thrown
Could not load Logmanager "com.sun.enterprise.server.logging.ServerLogManager"
java.lang.ClassNotFoundException: com.sun.enterprise.server.logging.ServerLogManager
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.util.logging.LogManager$1.run(LogManager.java:166)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.logging.LogManager.(LogManager.java:156)
According to this URL, http://java.net/jira/browse/GLASSFISH-3256 it's a known issue and won't be fixed until GF3.
Anyway, my question was about how to connect to a specific instance and I think that was answered.
Do not include the port number in the hostname field. The port number is taken from the global profiler settings.