Trying to debug adapter Java Code in worklight 6.1 - worklight-adapters

I'm trying to debug worklight 6.1 adapter code (java). I figured the most logical way would be to restart the imbedded liberty server in debug mode. That fails with a message:
ERROR: Cannot load this JVM TI agent twice, check your java command line for duplicate jdwp options.
Error occurred during initialization of VM
agent library failed to init: jdwp
I followed the process documented for 6.0 at Logging and debugging Java on Worklight Server but I get the same issue there.

Ok, this is silly, but I just figured it out. You do not need to set anything for debug mode. Apparently in 6.1 this is already set. To begin debugging of your java code in the adapter you need to do the following:
Create a debug configuration for a "Remote Java Application".
Set the project to your worklight hybrid project
I set the port to 10777. which is what jdwp was set to in the jvm.options file for the worklight server.
Once you click on debug for that configuration, it will allow you to debug your adapter.
You can see the jvm.options file if you expand the Worklight Development Server definition in the Servers view. See below for an example of the contents of that file.
-Dfile.encoding=UTF-8
-Duser.language=en
-Duser.country=US
-Djava.awt.headless=true
-Dwas.debug.mode=true
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=10777
-Dcom.ibm.websphere.ras.inject.at.transform=true
Uploaded video to youtube on how to do this

Related

Debug of Angular Dart stopped working in PhpStorm

I have quite big Angular Dart project in PhpStorm. I was able to debug it, but suddenly it doesn't work anymore (for few weeks). I'm not sure what's the reason as I upgraded PhpStorm, Dart Plugin and Dart. But I expect debug to be working with all updates.
I created the simpliest Angular Dart app (ToDo example) to see if it helps. It didn't.
Dart VM version: 2.3.1 (Tue May 21 19:28:38 2019 +0200) on "linux_x64"
PhpStorm 2019.1.2
Build #PS-191.7141.52, built on May 8, 2019
JRE: 1.8.0_202-release-1483-b49 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 5.0.17-300.fc30.x86_64
PhpStorm Dart plugin v191.7221
Google Chrome Version 74.0.3729.169 (Official build) (64bit)
Dart is listening on port 53322 for HTTP connections from browser, PhpStorm is listening on debug port 63344 (and has a connection from Chrome), Chrome is listening on debug port 45389 (and has a connection from PhpStorm).
When I open http://localhost:53322/index.html I see the app, but the execution is not stopped on breakpoints.
I've found similar bugs (https://youtrack.jetbrains.com/issue/WEB-30593, Angular dart on WebStorm. Debug is no more working) but the provided solutions didn't help.
Is there a way to make debug working again? I'd like to avoid downgrading.
Not specific to Angular - debugging web apps doesn't work with SDK 2.3.1. Please follow WEB-39095 for updates.
Workarounds:
Start debug session from WebStorm. Breakpoints won't work. Stop Debug
session.
Without closing the project go to Terminal and run pub global activate webdev 1.0.1.
Start debug session from WebStorm again. Breakpoints should work.
Or:
Run webdev server manually from Terminal explicitly specifying hostname, for example: pub global run webdev serve --hostname 127.0.0.1 web:53322
In the IDE create JavaScript Debug run configuration that opens webdev URL directly, e.g. http://localhost:53322/index.html, press Debug
Update: it was a bug in webdev (no sourcemaps on ipv4). Bug is fixed in webdev 2.0.7. No actions needed, WebStorm will auto-update webdev automatically to the latest version

Create Glassfish windows service error

I have created glassfish service on window but could not start the service. I have checked the domain service error log and getting the following errors:
Error: Registry key 'Software\JavaSoft\Java Runtime Environment'\CurrentVersion'
has value '1.8', but '1.7' is required.
could not find java.dll
Could not find Java SE Runtime Environment.
I have upgraded from Java 7 to Java 8 and after upgrading service could no be started. How can I solve this poroblem
Ok! I had to delete the following files: java.exe, javaw.exe and javaws.exe
from System32 in order to work. Its working fine now.
If you're using any version of GlassFish below 4.1, it won't run on Java 8. You need to upgrade your GlassFish as well or, if that's not an option, revert to Java 7.

debug grails application in eclipse IDE

i want to debug Grails application in the eclipse kepler,i tried Debug As in eclipse and added break points but it runs normally as it in normal run mode , how i do that ?
Thanks
Burt's answer from here
You can start a Grails app (one that has an Eclipse Grails nature,
i.e. it was created in STS or was converted via Configure | Convert to
Grails Project) in STS in debug mode using Run | Debug As | Grails
Command (run-app)
You can also attach to any app that you start from the commandline via
"grails-debug run-app" by creating a Debug Configuration. Go to Run |
Debug Configurations and select Remote Java Application. Click the
'New' button or right-click the Remote Java Application node and
select New. Select the project that you're debugging and give the
configuration a meaningful name (I usually call them "attach
"). Change the port from 8000 to 5005, and I always check
the "Allow termination of remote VM" checkbox so I can kill the app
from the IDE, but that's optional. Click Debug and it'll attach. Note
that this will work for any Grails project that's in your workspace,
not just ones that have a Grails nature.
Burt
in order to allow eclipse or any other debugger to connect to an external grails app running you need to start grails in debug mode:
grails-debug run-app
Doing this grails has to pause and wait for a remote debugger to connect.
The grails-debug appears to be deprecated. Nowadays use:
grails --debug-fork run-app

IBM Worklight application builder error

I am using eclipse juno 4.2.1 and IBM worklight 6.0 on my mac mini. since yesterday I am trying to build and deploy my application but its giving me "Worklight application builder" error.
here is the log:
An internal error occurred during: "Worklight application builder".
loader constraint violation: when resolving method "org.apache.commons.io.FileUtils.iterateFiles(Ljava/io/File;Lorg/apache/commons/io/filefilter/IOFileFilter;Lorg/apache/commons/io/filefilter/IOFileFilter;)Ljava/util/Iterator;" the class loader (instance of org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) of the current class, com/worklight/builder/skins/impl/SkinBuilderImpl, and the class loader (instance of org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) for resolved class, org/apache/commons/io/FileUtils, have different Class objects for the type o/filefilter/IOFileFilter;Lorg/apache/commons/io/filefilter/IOFileFilter;)Ljava/util/Iterator; used in the signature
and console shows this message :
[2013-09-25 15:18:46] Starting build process: application 'TestApp', all environments
[2013-09-25 15:18:46] com.worklight.shared.common.messages:tgn309.trigyn.com: tgn309.trigyn.com: nodename nor servname provided, or not known
java.net.InetAddress.getLocalHost(InetAddress.java:1466)
com.worklight.common.util.GeneralUtil.scanIPAddresses(GeneralUtil.java:581)
com.worklight.common.util.GeneralUtil.scanIPAddresses(GeneralUtil.java:549)
com.worklight.common.util.GeneralUtil.getIPscanResults(GeneralUtil.java:642)
com.worklight.studio.plugin.utils.WSTServers.getServerHost(WSTServers.java:174)
com.worklight.studio.plugin.utils.WSTServers.getServerURL(WSTServers.java:661)
com.worklight.studio.plugin.launch.build.apps.WorkspaceApplicationBuilder.buildApplication(WorkspaceApplicationBuilder.java:325)
com.worklight.studio.plugin.launch.build.apps.WorkspaceApplicationBuilder.runInWorkspace(WorkspaceApplicationBuilder.java:158)
org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
[2013-09-25 15:18:46] FWLPL0010W: "localhost" was detected from the target server configuration. Using the primary IP address of the host machine, 10.30.1.102, to build the Worklight application(s). Consider using a fully qualified hostname (avoid using "localhost") or a valid IP address instead. The value can be modified by opening the configuration editor of Worklight Development Server from the "Servers" view.
Any help would be appreciated.
Try the suggestion given in the following answer, as it seems somewhat related based on the error in your question: IBM Worklight 6.0 - Migration Issue after importing a project
Copy/paste:
Please try to find if you have apache commons IO installed in your
Eclipse plugin directory. That's the source of the conflict.
If you can, please try to:
stop the Eclipse
move the apache commons IO out of the plugin dir
start Eclipse, then close it
move the commons IO back into the plugin dir
Start Eclipse

MyFaces continues to run in DEV mode after project stage changed to Production

Running in Websphere Portal 7 and MyFaces 2.1.10.
The deployment descriptor for the web module in WAS shows the PROJECT_STAGE property has a value of 'Production'.
Yet when the application starts I see the MyFaces warning "Apache MyFaces-2 is running in DEVELOPMENT mode". If an error occurs in JSF I see the full stack trace on the page which indicates that it is in fact running in DEV mode.
Can the property be set somewhere else which overrides the value in the web.xml file? How can I stop DEV mode if the value in web.xml seems to be ignored?
Thanks.
I had setup JRebel on this project and it turns on facelet DEVELOPMENT mode. http://zeroturnaround.com/software/jrebel/features/frameworks/

Resources