Removing worklight server config files for new eclipse project - eclipse

I have installed worklight/IBM Mobile first plugin in my eclipse. But I want to enable the worklight server only to specific projects. The issue is, if I create a new eclipse project, the worklight automatically creates the config files in my new eclipse project. I don't want this unnecessary config files to my other projects, only it should be enabled in worklight projects.
I tried deleting the worklight server in server view and deleted files from folders, but when I restart the eclipse, it is again creating the config files.
Is there anyway to disable worklight in eclipse in default?

You could try to untick the Project >> Build automatically option, but I doubt this will help and even if it will help it is not recommended to untick it as it is needed.
The other option would of course to use another Eclipse instance where you do not have the MobileFirst Studio plug-in installed.

Related

Can't choose an existing server in a Dynamic Web Project a in Eclipse

My colleague just set up a Dynamic Web Project in Eclipse and he also configured the server. He shared the entire project on a git repository and I cloned it. When I try to run the html file I click on 'run on server' but then I'm not able to choose an existing server already configured. Eclipse force me to create a new server with default configuration. I am attaching a screenshot of Eclipse
https://www.youtube.com/watch?v=ipqTnzTPgj0
Help --> Install new software ---> install " eclipse repository - https://download.eclipse.org/releases/oxygen ".
Then install the package for -- Web,XML, Java EE and OSGi Enterprise Development.
Reboot your computer and eclipse. Then it will work. Good luck.
It works for me:
Properties -> Project Facets and do it like this
Right click on you project and go to properties. Go to Project Facets and on Dynamic Web Module click the little drop down menu and select 3.1. I initially had it at 4.0 and it was not supported in my version of Eclipse.

How to deploy an Eclipse Plugin?

Environment: Eclipse Oxygen.3a Release (4.7.3a), Build id: 20180405-1200
I have completely developed my new Eclipse Plugin. I have debugged it successfully and It´s ready to be deployed for beta testing by other developers in my organization.
The Overview tab in plugin.xml Eclipse editor offers an Export Wizard that works and produces a .jar file (theoretically) containing the plugin to be installed in other Eclipse installations.
After exporting the plugin to a local folder in my computer I tried to install it in Eclipse by using Help > Install new software... > [Add...] > [Archive...], selecting the .jar file generated and clicking [Ok].
However, I get the error message "Could not find jar:file:*<the selected plugin file>*!" and the [Finnish] button remains disabled.
What is missing to make my new plugin fully installable?
The most robust way to publish a plug-in (or Feature) for others to consume is to produce an Update Site. Then you can direct users to that site so they can install your plug-is/features via the Install New Software UI. It also provides an easy way to publish updates to your plug-ins.
Here is documentation about creating an Update Site.

Eclipse Kepler plugins - Offline Installation

I am trying to install 2 eclipse plugins in offline mode(copy-paste) in Kepler.
I downloaded jenkins & glassfish from update sites in eclipse (lets say Eclipse 1). Later I copied the jenkins plugins (all folders & jars from plugins & features) separately in a folder; similar is done for glassfish.
Installation method - I extracted a fresh eclipse kepler(lets say Eclipse 2), tried to copy paste plugins & features of the Glassfish to my new eclipse. It worked well. But when I copied Jenkins related plugins, Glassfish server option disappeared from Server view.
Please help me to resolve the issue.
Don't extract data from update sites, the features in particular are not in the correct format for direct installation.
Instead open 'Help' > 'Install New Software'. Click 'Add...' on the 'Work with' line. Select 'Archive' on Add Repository dialog that opens and select the update site jar. When you click OK the main install dialog should show you what is available to install.

Debugging Eclipse plug-ins

This is my first attempt at creating an Eclipse plug-in. I've created one, along with a feature and update site. I set the target platform as my local Eclipse installation. When I run/debug the plugin from within the development environment everything works fine.
Now, my colleague installed the plug-in from the update site that I hosted. When he starts using any of the functionality exposed by my plugin he gets runtime exceptions.
He sees null pointer exceptions which didn't occur when I ran my plug-in project from my development environment.
I have a wizard that's part of my plug-in. When he close it he gets a "Unhandled event loop exception", and the wizard doesn't close. I didn't have this issue when I was running/debugging my plugin in my development environment.
Now I'm confused as to why the same plug-in is behaving differently in the production environment, as against the dev environment and when I was debugging it from my IDE. The target platform in both cases is the same Eclipse version. What could be the reasons?
And how do I debug the plug-in in a production environment? Is there a remote debugging capability for debugging the plug-ins on the production environment?
Any suggestions would be really useful!
To remote debug your plug-in, first add debug arguments to your target Eclipse .ini file
-vmargs
-Xdebug
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1044
before launching it.
Then open another Eclipse instance with a workspace containing your plug-in project.
Open Run > Debug Configurations..., select Remote Java Application and create a new configuration.
As Project, browse and select your plug-in project.
Also fill in your connection properties (host of target Eclipse and port 1044).
Launching the newly created debug configuration allows you to debug your plug-in the same way you debug locally.
Now I'm confused as to why the same plug-in is behaving differently in
the production environment, as against the dev environment and when I
was debugging it from my IDE. The target platform in both cases is the
same eclipse version. What could be the reasons?
This is a classic: Eclipse plugins and RCP applications do indeed behave differently between PDT (the Eclipse IDE) and the exported product.
In your case, a NullPointerException thrown from the exported version but not from Eclipse is 9 times out of 10 an image or other resource files (properties, etc.) that is loaded by your code but is not listed in the build.properties of your plugin.
Anyway, you'll need to check the logs to retrieve the stacktrace and hunt down its cause. Such logs could be found in your friend's workspace under le .metadata/.log file
From your development workspace as it stands now, use the "Debug As -> Eclipse Application" menu item to startup a test workspace. When it starts up, you'll have two workspaces running: the original development workspace and the new test workspace. You can set breakpoints in your plugin code in the development workspace and run your plugin in the test workspace.
When your plugin execution in the test workspace gets to one of your breakpoints, execution will pause and you can use the Debug view in your development workspace to look at variables, set more breakpoints or anything else you want to do to debuf your plugin.
See the Apache Wiki for Developing with Eclipse.
Under Windows 10 with Tomcat running as a windows service I started:
tomcat8.5\bin\Tomcat8w.exe
& added in the Java tab as the first entry in Java Options to enable remote debugging:
-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n

Debugging a tomcat project in Eclipse 3.4.2

I downloaded eclipse 3.4.2 and tried installing tomcat plugin (version 3.2.1)for eclipse from sysdeo (http://www.eclipsetotale.com/tomcatPlugin.html)
I have followed installation instructions but when is start tomcat from eclipse toolbar i got the following error
java.lang.NoClassDefFoundError: org/apache/tomcat/util/log/SystemLogHandler
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2357)
at java.lang.Class.getConstructor0(Class.java:2671)
at java.lang.Class.newInstance0(Class.java:321)
at java.lang.Class.newInstance(Class.java:303)
at org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:205)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:390)
I did follow troubleshoot instructions but no success.
I tried to putting plugin in dropin directory too but still got the same error.
This was working fine in eclipse 3.2 and 3.3
Then I tried using standard inbuilt WTP to set up my tomcat server. I am not sure how it will pick my server.xml in conf directory of tomcat, it seems it is not picking as of now.
How do I associate my eclipse project with this setup. I am able to start the server but when i browse the tomcat start page, it does not show anything.
I would appreciate if someone can provide some ways to fix this.
Thanks in advance.
-Dipesh
After trying out few things I was able to debug tomcat project in eclipse 3.4.2
To debug tomcat application/project using eclipse 3.4.2 use WTP plugins which are installed along with it.
Go to Window --> Show View --> Others --> Server
In this view create a new server, please select tomcat installation directory and version information.
Then double click on Tomcat VX.X Server at local host, it opens up configuration settings page
In the Server Locations Section select "Use Tomcat Installation (takes control of Tomcat Installation) and enter deploy path.
In the publishing section select Never Publish automatically and uncheck update context path checkbox.
Voila!! All set to debug tomcat project in eclipse 3.4.2
There is no need to download and copy any extra plugin.
Thanks Juri. Hope this helps.
I'm using Tomcat with Eclipse Java EE version with WTP and it works perfectly. I have Ant scripts which deploy my web app to the tomcat webapp folder. In order to debug, you have to open the Server view in Eclipse, add a new server and choose the correct Tomcat version. Once that's done, open the configuration of Tomcat within eclipse by double-clicking on the server entry in the Eclipse server view you just created. On the left-middle side of the confguration page you should see something like "let Eclipse control the native Tomcat installation", I don't remember the exact text now. You have to choose that. Then you can set a breakpoint in your source code and then start Tomcat in debug mode from within Eclipse's server view.
Hope that helped.
If you are using the Sysdeo plugin, then you don't want to also be using the standard Eclipse WTP servers. To use the Sysdeo plugin, you need to have already downloaded and extracted a standard zipped tomcat directory. Make sure to define CATALINA_HOME in your path. Then, assuming you've correctly installed the sysdeo plugin, go into Eclipse->Windows->Prefs->Tomcat (this is Sysdeo's Tomcat settings, and not the WTP settings). You need to tell the plugin where you've extracted your Tomcat directory, and set it to use Context files.
Now create a new Dynamic web project. Right click it, and go into its properties->Tomcat.
Check it as a 'Tomcat Project'. Give it a context name, and also tell it the directory which would be the base of your war (by default, Eclipse has named this WebContent, I believe). Apply it and close the Window. Right click again your project, and go to the Tomcat section. Add the 'Tomcat Libraries to Build Path' so you can use the Servlet/JSP classes. Finally, click on 'Update Context'. If you go into your Tomcat directory under Conf, you'll see that the plugin has created a context for you that points to your Eclipse workspace. No need for deploying the app to the Tomcat directory. Now, you should be able to click on the Sysdeo Tomcat 'start' button, and your app should be able to connect to your app at localhost:8080/context_name.
HTH,
Bill
Using the excellent Findjar web page for:
org/apache/tomcat/util/log/SystemLogHandler
gives the following:
Information on class org.apache.tomcat.util.log.SystemLogHandler:
Containing JAR files:
jbossweb.jar
gwt-dev-windows.jar
tomcat-util-3.3.2.jar
tomcat-util-4.0.6.jar
tomcat-util-4.1.31.jar
tomcat-util-4.1.34.jar
tomcat-util-4.1.36.jar
tomcat-util-5.0.16.jar
tomcat-util-5.0.18.jar
tomcat-util-5.0.28.jar
tomcat-util-5.5.12.jar
tomcat-util-5.5.15.jar
tomcat-util-5.5.23.jar
tomcat-util-5.5.4.jar
tomcat-util-5.5.7.jar
tomcat-util-5.5.9.jar
tomcat-util-5.5.7-alpha.jar
tomcat-util-5.5.8-alpha.jar
tomcat-util-5.5.9-alpha.jar
Ensure the appropriate jar file is in your CLASSPATH.