Re: [platform][snap] How do I publish a platform app as a snap?

2019-07-25 Thread Laszlo Kishalmi


On 7/25/19 9:08 AM, Patrik Karlström wrote:
It took me a while but the missing dependencies are now published to 
bintray and the just released version 1.1.2 of Mapton is using that.


Regarding #4. Mapton is able to open and save files, will that require 
'Classic confinement' and will someone


It is not needed to have a classic confinement to read and write files. 
Usually it is just enough to read and write files in the home folder. 
That is just a permission requirement you need to add.




evaluate the needs for that?

Will continue to read the snap guides and make a hello world snap...

Den sön 7 juli 2019 kl 21:34 skrev Laszlo Kishalmi 
mailto:laszlo.kisha...@gmail.com>>:


Well that won't be as easy as NetBeans.

Probably you would like to bundle the JRE and all the required
Runtime as well.

I've done some inspection on the code and tried to build some kind
of snap out of it, so:

 1. You need to streamline your build. Right now there is two
pre-build step documented, and it still requires the never
officially released darcula LaF. I'd suggest to put up a
repository on JCenter and put your dependencies there (you
need to alter your pom to check that repo as well, but that
would remove half the hastle)
 2. Make sure that you have the after: [desktop-glib-only] in your
snapcraft.yml in order to have the GTK dependencies required
for the Java UI.
 3. Set the confinement to devmode and then ad the requested snap
plugs to create proper security boundaries.
 4. NB is working with Classic confinement, that means it runs
without sandboxing and having access to all system functions.
That is an easy workaround to a lot of issues, but  you need
to have a compelling reason to ask for a classic confinement
for your Snap. (Being an IDE is one of them).
 5. The good thing is that you can actually bundle the JRE with
your application, so it would be really out of the box.
 6. You can also ask Snapcraft to build the Snaps for you adding a
Github hook.

So for start try to build a working Snap locally, then get a
snapcraft account, ask Snapcraft to build the Snap for you, then
publish the Snap!

On 7/7/19 2:38 AM, Neil C Smith wrote:

On Sun, 7 Jul 2019 at 09:32, Patrik Karlström  
  wrote:

Are there any documented (netbeans) steps somewhere that I can follow?

I'm not sure if the build task is documented anywhere yet?  But
definitely look at
https://github.com/apache/netbeans/tree/release111/nbbuild/packaging/snap
if you haven't already.

You might also want to consider AppImage?  Had a useful chat at LGM
recently with one of the main people working on that, which led to
https://github.com/praxis-live/support/issues/110  - I'm currently also
considering whether to make Snap, AppImage or both for my platform
application.  Mine is slightly awkward in that there are two platform
binaries shipped in one package.

Best wishes,

Neil

-
To unsubscribe, e-mail:users-unsubscr...@netbeans.apache.org  

For additional commands, e-mail:users-h...@netbeans.apache.org  


For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



Re: [platform][snap] How do I publish a platform app as a snap?

2019-07-25 Thread Patrik Karlström
It took me a while but the missing dependencies are now published to
bintray and the just released version 1.1.2 of Mapton is using that.

Regarding #4. Mapton is able to open and save files, will that require
'Classic confinement' and will someone evaluate the needs for that?

Will continue to read the snap guides and make a hello world snap...

Den sön 7 juli 2019 kl 21:34 skrev Laszlo Kishalmi <
laszlo.kisha...@gmail.com>:

> Well that won't be as easy as NetBeans.
>
> Probably you would like to bundle the JRE and all the required Runtime as
> well.
>
> I've done some inspection on the code and tried to build some kind of snap
> out of it, so:
>
>1. You need to streamline your build. Right now there is two pre-build
>step documented, and it still requires the never officially released
>darcula LaF. I'd suggest to put up a repository on JCenter and put your
>dependencies there (you need to alter your pom to check that repo as well,
>but that would remove half the hastle)
>2. Make sure that you have the after: [desktop-glib-only] in your
>snapcraft.yml in order to have the GTK dependencies required for the Java
>UI.
>3. Set the confinement to devmode and then ad the requested snap plugs
>to create proper security boundaries.
>4. NB is working with Classic confinement, that means it runs without
>sandboxing and having access to all system functions. That is an easy
>workaround to a lot of issues, but  you need to have a compelling reason to
>ask for a classic confinement for your Snap. (Being an IDE is one of them).
>5. The good thing is that you can actually bundle the JRE with your
>application, so it would be really out of the box.
>6. You can also ask Snapcraft to build the Snaps for you adding a
>Github hook.
>
> So for start try to build a working Snap locally, then get a snapcraft
> account, ask Snapcraft to build the Snap for you, then publish the Snap!
> On 7/7/19 2:38 AM, Neil C Smith wrote:
>
> On Sun, 7 Jul 2019 at 09:32, Patrik Karlström  
>  wrote:
>
> Are there any documented (netbeans) steps somewhere that I can follow?
>
> I'm not sure if the build task is documented anywhere yet?  But
> definitely look 
> athttps://github.com/apache/netbeans/tree/release111/nbbuild/packaging/snap
> if you haven't already.
>
> You might also want to consider AppImage?  Had a useful chat at LGM
> recently with one of the main people working on that, which led 
> tohttps://github.com/praxis-live/support/issues/110 - I'm currently also
> considering whether to make Snap, AppImage or both for my platform
> application.  Mine is slightly awkward in that there are two platform
> binaries shipped in one package.
>
> Best wishes,
>
> Neil
>
> -
> To unsubscribe, e-mail: users-unsubscr...@netbeans.apache.org
> For additional commands, e-mail: users-h...@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, 
> visit:https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>


Available Plugins

2019-07-25 Thread Bo Andersen
Hi, why can't this be found in the native plugin list within netbeans? - Have 
to download it manually from the website, would also be nice if netbeans 
supported it out of the box 

http://plugins.netbeans.org/plugin/37077/autosave-module-for-6-9-and-later

Thanks

Bo


Re: Is "Run JPQL Query" working?

2019-07-25 Thread Richard Grin
Hi Geertjan,

Simple and quick to reproduce:

  1. Create a new Maven Web Application Project (Java EE 8). Associate it with 
Payara 5.192 server.

  2. Right click on the new project and New Entity classes from database. 
Choose the sample database (Java DB). Add the CUSTOMER table. Any package for 
the entities (i.e. entities). Finish.

  3. Some code must be added into persistence.xml. This step is necessary 
because there is a very annoying problem I have already reported in a previous 
message: no match between the "design" and the "source" view of 
persistence.xml. With the previous versions of NetBeans, these lines were 
automatically added into the file. Now it is "added" in the design view but not 
into the file!

Add jta-data-source and provider in persistence.xml:

org.eclipse.persistence.jpa.PersistenceProvider
jdbc/sample

Add transaction-type="JTA" too.

Finally:


http://java.sun.com/xml/ns/persistence;
 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
 xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence 
http://xmlns.jcp.org/xml/ns/persistence/persistence_2_2.xsd;>
  
  
org.eclipse.persistence.jpa.PersistenceProvider
jdbc/sample

  

  


4. Start Payara and Run the application; no problem, "Hello World!" in the 
brower (is this step necessary?)

5. Right click on persistence.xml > Run JPQL Query and type
select c from Customer c

The error message:
javax.persistence.PersistenceException: No Persistence provider for 
EntityManager named samplePU
at 
javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:85)

If I had dependencies in pom.xml for the group org.eclipse.persistence, the 
error changes:

javax.persistence.PersistenceException: Exception [EclipseLink-7060] (Eclipse 
Persistence Services - 2.5.2.v20140319-9ad6abd): 
org.eclipse.persistence.exceptions.ValidationException
Exception Description: Cannot acquire data source [jdbc/sample].
Internal Exception: javax.naming.NoInitialContextException: Need to specify 
class name in environment or system property, or in an application resource 
file: java.naming.factory.initial
at 
org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:766)
at 
org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getAbstractSession(EntityManagerFactoryDelegate.java:204)
at 
org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactoryDelegate.java:304)
at 
org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:336)
at 
org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:302)
Caused by: Exception [EclipseLink-7060] (Eclipse Persistence Services - 
2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.ValidationException
Exception Description: Cannot acquire data source [jdbc/sample].
Internal Exception: javax.naming.NoInitialContextException: Need to specify 
class name in environment or system property, or in an application resource 
file: java.naming.factory.initial
at 
org.eclipse.persistence.exceptions.ValidationException.cannotAcquireDataSource(ValidationException.java:520)
at 
org.eclipse.persistence.sessions.JNDIConnector.connect(JNDIConnector.java:109)
at 
org.eclipse.persistence.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:162)
at 
org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.setOrDetectDatasource(DatabaseSessionImpl.java:204)
at 
org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:741)
at 
org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:239)
at 
org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:685)
... 6 more
Caused by: javax.naming.NoInitialContextException: Need to specify class name 
in environment or system property, or in an application resource file: 
java.naming.factory.initial
at 
java.naming/javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:685)
at 
java.naming/javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:305)
at 
java.naming/javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:402)
at java.naming/javax.naming.InitialContext.lookup(InitialContext.java:413)
at 
org.eclipse.persistence.sessions.JNDIConnector.connect(JNDIConnector.java:103)
... 11 more


However if I add some code to the project for JSF, the project works well 
without any error to display the data of the database linked to the data source 
jdbc/sample. So the problem happens only 

Rationale for "equals() method not checking type of its parameter".

2019-07-25 Thread Owen Thomas
I want to override the equals method of a common ancestor class so it will
compare two subtypes for equality regardless of what subtype they are. I
noticed that when I replace this code:

if (getClass() != obj.getClass()) {
return false;
}
final Referentother = (Referent) obj;

With this code:

Referentother;
try{
other=(Referent) obj;
}catch(ClassCastException x){return false;}

However, I get the warning in the title of this email.

I don't think this warning is correct. Who is right; me or NB 11?

Thanks,

  Owen.