It just a JPAQuery, the JamesDomain is an entity of table JAMES_DOMAIN.
:name is a "dynamic marker" as you wrote.

https://github.com/apache/james-project/blob/d7a4f45fa4d248a4911612eb367cef72e56c5f8c/server/data/data-jpa/src/main/java/org/apache/james/domainlist/jpa/model/JPADomain.java#L33


On 12/12/2023 18:42, Matt Pryor wrote:
Hi all, I'm still seeing this error in the logs after setting the domain
using the webadmin:

javax.persistence.NoResultException: Query "SELECT domain FROM JamesDomain
domain WHERE domain.name=:name" selected no result, but expected unique
result.
   at
org.apache.openjpa.persistence.QueryImpl.getSingleResult(QueryImpl.java:346)
   at
org.apache.james.domainlist.jpa.JPADomainList.containsDomainInternal(JPADomainList.java:162)
   at
org.apache.james.domainlist.jpa.JPADomainList.containsDomainInternal(JPADomainList.java:100)
   at
org.apache.james.domainlist.lib.AbstractDomainList.containsDomain(AbstractDomainList.java:179)
   at
org.apache.james.mailetcontainer.impl.LocalResourcesImpl.isLocalServer(LocalResourcesImpl.java:67)

Please can you help me understand what this query is doing and what is it
querying? There is no "JamesDomain" table in the tables generated in our
SQL Server database (there is a James_Domain).
I presume :name is a dynamic marker, in which case what will it be setting
the value to?

Below is a list of tables generated by James in SQL Server:

JAMES_DOMAIN
JAMES_MAIL
JAMES_MAILBOX
JAMES_MAILBOX_ANNOTATION
JAMES_MAIL_PROPERTY
JAMES_MAIL_REPOS
JAMES_MAIL_STORE
JAMES_MAIL_USERFLAG
JAMES_MAX_DOMAIN_MESSAGE_COUNT
JAMES_MAX_DOMAIN_STORAGE
JAMES_MAX_GLOBAL_MESSAGE_COUNT
JAMES_MAX_Global_STORAGE
JAMES_MAX_USER_MESSAGE_COUNT
JAMES_MAX_USER_STORAGE
JAMES_QUOTA_CURRENTQUOTA
JAMES_RECIPIENT_REWRITE
JAMES_SIEVE_QUOTA
JAMES_SIEVE_SCRIPT
JAMES_SUBSCRIPTION
JAMES_USER
OPENJPA_SEQUENCE_TABLE

Thanks and kind regards
Matt





On Thu, 26 Oct 2023 at 12:41, Matt Pryor <pr...@international-presence.com>
wrote:

Many thanks René!

On Thu, 26 Oct 2023 at 03:32, René CORDIER <rcord...@linagora.com> wrote:

Hi Matt,

On addition to using the cli, you have also other ways:

- using webadmin:
https://james.apache.org/server/manage-webadmin.html#Administrating_domains

-  the domainlist.xml file. localhost is configured as defaultDomain, but
you can add extra domains in `domainnames.domainname`, which is a list,
spearated by "," I think... it's undocumented, looks rather obscur (as a
name) and doesn't seem really tested in the code I realized though... Might
need to add a little something there :)

Best regards,

Rene.


On Oct 26, 2023 1:36 AM, from Matt Pryor Thanks a lot Tung will try that
tomorrow.


On Wed, 25 Oct 2023 at 16:33, Tung Tran <vtt...@linagora.com> wrote:

Hi
Have you created a domain name yet?
By admin api, James Command line...
Ex: james.apache.org/server/manage-cli.html#Manage_Domains

Tung,

On 25/10/2023 22:16, Matt Pryor wrote:
Hi, I'm seeing the following error in the logs:

16:07:55.691 [DEBUG] o.a.j.d.j.JPADomainList - No domain found
javax.persistence.NoResultException: Query "SELECT domain FROM
JamesDomain
domain WHERE domain.name=:name" selected no result, but expected
unique
result.
at

org.apache.openjpa.persistence.QueryImpl.getSingleResult(QueryImpl.java:346)
Queried the jamesdomain table and there's one result containing
"localhost".
What should be in there, do I set it manually in the database, or
does it
come from a config file?

Thanks
Matt

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscr...@james.apache.org
For additional commands, e-mail: server-user-h...@james.apache.org




--
Kind regards
Matt Pryor
Software Developer

The International Presence Group of Companies
EMAIL: pr...@presencebpm.com
URL: www.International-presence.com




---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscr...@james.apache.org
For additional commands, e-mail: server-user-h...@james.apache.org

Reply via email to